/* tools
 
@author Jacob at Goby
 @version 03/10/10
@svn 120
*/

var objects=[];$(window).unload(function()
{j=0;var length=objects.length;while(objects.length>0)
{var obj=objects.pop();try
{if(obj._destruct)
obj._destruct();if(obj!=null)
{obj=null;}
delete obj;}
catch(e)
{obj=null;delete obj;}
if(obj!=null)
obj=null;}
objects=null;});function SlideShow(container,ctrl)
{this.container=container;this.controls=ctrl;this.container.items=[];var i=0;for(var index in this.container.childNodes)
{var item=this.container.childNodes[index];if(item.tagName=="LI")
{this.container.items.push(item);item.index=i++;$(item).css("position","absolute");$(item).hide();}}
this.current=this.container.items.shift();this.container.items.unshift(this.current);$(this.current).show();this.activateControls();this.showControls();objects.push(this);}
SlideShow.prototype={selectNext:function()
{var length=this.container.items.length-1;var index=this.current.index;var cur=index+1
if(cur>length)
cur=0;this.selectNode(cur);},selectPrev:function()
{var length=this.container.items.length-1;var index=this.current.index;var cur=index-1
if(cur<0)
cur=length;this.selectNode(cur);},showControls:function()
{$(this.controls).hover(function()
{$(this).children().show();},function()
{$(this).children().hide();});},selectNode:function(id)
{var node=this.container.items[id];if(node)
{$(this.current).fadeOut(250);$(node).fadeIn(250);this.current=node;}},activateControls:function()
{for(var index in this.controls.childNodes)
{var item=this.controls.childNodes[index];if(item.tagName=="A")
{$(item).data("slideshow",this);$(item).click(function()
{var slide=$(this).data('slideshow');if($(this).hasClass("prev"))
{slide.selectPrev();}
else if($(this).hasClass("next"))
{slide.selectNext();}});}}}}
var browser={IE:1,FIREFOX:2,OPERA:3,SAFARI:4,DEFAULT:5,IE_SIX:6,IE_SEVEN:7,IE_EIGHT:8,CHROME:9}
navigator.isIE=function(){return navigator.isBrowser(browser.IE)?true:navigator.isBrowser(browser.IE_SIX)?true:navigator.isBrowser(browser.IE_SEVEN)?true:navigator.isBrowser(browser.IE_EIGHT)?true:false;}
navigator.isValid=function()
{return true;}
navigator.isBrowser=function(code)
{if(this.getBrowserCode()==code)
return true;else
return false;}
navigator.getBrowserName=function()
{switch(this.getBrowserCode())
{case browser.IE:return"Microsoft Internet Explorer";break;case browser.IE_SIX:return"Internet Explorer 6";break;case browser.IE_SEVEN:return"Internet Explorer 7";break;case browser.IE_EIGHT:return"Internet Explorer 8";break;case browser.FIREFOX:return"Mozilla Firefox";break;case browser.OPERA:return"Opera";break;case browser.SAFARI:return"Safari";break;case browser.CHROME:return"Chrome";break;default:return"browser";}}
navigator.getBrowserCode=function()
{var userAgent=this.userAgent.toString();var appname=this.appName.toString();if(userAgent.match("MSIE [8]{1}"))
return browser.IE_EIGHT;else if(userAgent.match("MSIE [7]{1}"))
return browser.IE_SEVEN;else if(userAgent.match("MSIE [6]{1}"))
return browser.IE_SIX;else if(userAgent.match("MSIE [345]{1}"))
return browser.IE;else if(userAgent.match("Opera"))
return browser.OPERA;else if(userAgent.match("Chrome"))
return browser.CHROME;else if(userAgent.match("Safari"))
return browser.SAFARI;else if(userAgent.match("(?:Firefox|Gecko)"))
return browser.FIREFOX;else
return browser.DEFAULT;}
function browserDetect()
{var location=window.location.toString();if(!location.match("unsupportedBrowser"))
{if((navigator==undefined)||(!navigator.isValid()))
{window.open(BASE_PATH+"/unsupportedBrowser","_self");}}}
browserDetect();function BinaryTree(index)
{this.index=index;}
BinaryTree.prototype.add=function(node)
{if(!this.trunk)
{this.trunk={right:null,left:null,data:[]};this.trunk[this.index]=node[this.index]
this.trunk.data.push(node);}
else
this.addRecurse(node,this.trunk);}
BinaryTree.prototype.addRecurse=function(item,node)
{var itemIndex=item[this.index];var nodeIndex=node[this.index];if(itemIndex==nodeIndex)
{node.data.push(item);}
else if(itemIndex<nodeIndex)
{if(node.right)
this.addRecurse(item,node.right);else
{node.right={right:null,left:null,data:[],parent:node};node.right[this.index]=item[this.index];node.right.data.push(item);}}
else
{if(node.left)
this.addRecurse(item,node.left);else
{node.left={right:null,left:null,data:[],parent:node};node.left[this.index]=item[this.index];node.left.data.push(item);}}}
BinaryTree.prototype.isBalanced=function(node)
{return false;}
BinaryTree.prototype.balance=function()
{}
BinaryTree.prototype.balanceNode=function()
{}
BinaryTree.prototype.rotateLeft=function(p)
{var r=p.right;p.right=r.left;if(r.left!=null)
r.left.parent=p;r.parent=p.parent;if(p.parent==null)
root=r;else if(p.parent.left==p)
p.parent.left=r;else
p.parent.right=r;r.left=p;p.parent=r;}
BinaryTree.prototype.deleteNode=function()
{}
BinaryTree.prototype.getNode=function(value)
{if(this.trunk)
return this.getNodeRecurse(value,this.trunk);else
return false;}
BinaryTree.prototype.toStack=function(params)
{this.returnType="stack";return this.iterator(params);}
BinaryTree.prototype.toQueue=function(params)
{this.returnType="queue";return this.iterator(params);}
BinaryTree.prototype.iterator=function(params)
{this.result=null;this.i=0;this.result=[];switch(params.type)
{case"lt":this.getLesser(params.value,this.trunk);break;case"eq":this.getNodeRecurse(params.value,this.trunk);break;case"span":this.getSpan({hi:params.hi,lo:params.lo},this.trunk);break;case"gt":default:this.getGreater(params.value,this.trunk);}
var result=this.result;return result;}
BinaryTree.prototype.getSpan=function(params,node)
{if(node==null)
return false;this.i++;if((node[this.index]<params.hi)&&(node[this.index]>params.lo))
{this.getSpan(params,node.left);this.getSpan(params,node.right);this.iterate(node);}
else if(node.left)
{this.getSpan(params,node.left);}
else if(node.right)
{this.getSpan(params,node.right);}
else
return false;}
BinaryTree.prototype.getLesser=function(value,node)
{if(node==null)
return false;this.i++;if(value<node[this.index])
{this.getLesser(value,node.right);}
else
{this.iterate(node);this.getLesser(value,node.right);this.getLesser(value,node.left);}}
BinaryTree.prototype.getGreater=function(value,node)
{if(node==null)
return false;this.i++;if(value>node[this.index])
{this.getGreater(value,node.left);}
else
{this.iterate(node);this.getGreater(value,node.left);this.getGreater(value,node.right);}}
BinaryTree.prototype.getNodeRecurse=function(value,node)
{if(node==null)
return false;var result=false;if(node[this.index]==value)
{return this.iterate(node);}
if(node[this.index]>value)
{node.right[this.index];result=this.getNodeRecurse(value,node.right);}
if(node[this.index]<value)
result=this.getNodeRecurse(value,node.left);return result;}
BinaryTree.prototype.doIteration=function(node)
{}
BinaryTree.prototype.iterate=function(node)
{switch(this.returnType)
{case"stack":this.result.push(node);break;case"queue":this.result.unshift(node);break;default:this.doIteration(node);}}
function ImportScript()
{this.files=[];this.pointer=null;this.source=[];this.scripts=[];this.callback=[];this.request=[];this.head=null;this.queue=[];this.displayable=false;if(document.importScripts==null)
document.importScripts=[];document.importScripts.push(this);objects.push(this);}
ImportScript.prototype={getHead:function()
{if(this.head==null)
this.head=document.getElementsByTagName('head')[0];return this.head;},importFile:function(filename,params)
{if(!this.scripts[filename])
{this.scripts[filename]=new ScriptObject(filename,params,this);this.scripts[filename].fetchScript();return true;}
else
return false;},isLoaded:function(filename)
{return this.scripts[filename]!=null?true:false;},importStyle:function(filename)
{this.scripts[filename]=new StyleObject(filename,this);},importCode:function(code,label)
{if(!this.scripts[label])
{this.scripts[label]=new CodeObject(label,code,this);}
else
{}},removeScript:function(label)
{if(this.scripts[label])
{this.scripts[label]._destruct();this.scripts[label]=null;}},queueScript:function(script)
{if(script.inline)
{script.runScript();}
else
this.queue.push(script);},isDisplayable:function()
{return(this.displayable?true:false);},loadScript:function(script)
{if(this.displayable)
script.runScript();else
this.queueScript(script);},loadQueuedScripts:function()
{this.displayable=true;while(this.queue.length>0)
this.queue.pop().runScript();},_destruct:function()
{for(var i in this.scripts)
this.scripts[i]._destruct();for(var index in this)
this[index]=null;killself(this);}}
function ScriptObject(filename,params,mgr)
{this.remote=false;this.mgr=mgr;var data=[];this.pointer=filename;this.inline=false;this.filename=filename;this.code=null;if(params!=null)
for(var i in params)
this[i]=params[i];}
ScriptObject.prototype={fetchScript:function()
{var data={};if(this.remote)
this.loadScript('remote');else
{this.request=new AjaxRequest(this.filename,{object:this,method:"loadScript"},data,"GET");this.request.makeRequest({noExec:1});}},runScript:function()
{var script=document.createElement("script");if(this.remote)
{script.src=this.filename;}
else
{var script=document.createElement("script");script.text=this.source;}
if(this.inline)
{var head=this.mgr.getHead();head.appendChild(script);}
else
document.body.appendChild(script);this.code=script;if(this.callback)
{if(this.callback.object!=null)
this.callback.object[this.callback.method]();else
eval(this.callback+"()");}},loadScript:function(data)
{this.source=data;this.mgr.loadScript(this);},_destruct:function()
{if(this.code!=null)
this.code.parentNode.removeChild(this.code);for(var i in this)
if(i!="mgr")
this[i]=null;}}
function CodeObject(label,code,mgr)
{this.mgr=mgr;this.pointer=label;this.filename=label;this.loadScript(code);}
CodeObject.prototype=new ScriptObject();function StyleObject(label,mgr)
{this.mgr=mgr;this.pointer=label;this.filename=label;this.remote=true;this.runScript();}
StyleObject.prototype=new ScriptObject();StyleObject.prototype.runScript=function()
{var script=document.createElement("link");script.href=this.filename;script.type="text/css";script.rel="stylesheet";document.body.appendChild(script);}
document.loadedImages={};document.erroredImages={};function ImagePreloader(source,container,constraints)
{$(container).addClass((constraints.loaderStyle!=null?constraints.loaderStyle:"loader_image"));var ImageLoader=new Image();ImageLoader.container=null;ImageLoader.constraints={"height":1000,"width":1000,'isBG':false,"loaderSource":"getImg=loaders/image_loader.gif","callback":null};ImageLoader.loaderStyle="loader_image"
ImageLoader.container=container;ImageLoader.src=source+"#"+Math.random()*400;ImageLoader.constraints=constraints;if(ImageLoader.container.tagName=="IMG")
{ImageLoader.constraints.loaderSource=IMG_PATH+"/loaders/image_loader.gif";if(ImageLoader.constraints.loaderSource)
{ImageLoader.container.alt='loading';ImageLoader.container.src=ImageLoader.constraints.loaderSource;}}
ImageLoader.onload=function()
{if(document.loadedImages[this.src]==null)
this.load();}
ImageLoader.load=function()
{document.loadedImages[this.src]=true;try
{if(!this.src)
{if(ImageLoader.constraints.loaderSource)
{this.src="";}}
else
{if(this.width>this.constraints.width)
{this.height=Math.round(this.constraints.width*(this.height/this.width));this.width=this.constraints.width;}
if(this.height>this.constraints.height)
{this.width=Math.round(this.constraints.height*(this.width/this.height));this.height=this.constraints.height;}
this.container.src=this.src;this.container.appendChild(this);}
if(this.constraints.loaderStyle!=null)
$(this.container).removeClass(this.constraints.loaderStyle);if(this.constraints.callback!=null)
{try
{this.constraints.callback.object[this.constraints.callback.method](this);}
catch(e)
{}}}
catch(e)
{}}
ImageLoader._destruct=function()
{delete this;}
ImageLoader.onabort=function()
{}
ImageLoader.onerror=function()
{this.setAttribute("title",this.src);document.erroredImages[this.src]=true;this.src=(this.constraints.failureImage!=null?BASE_PATH+this.constraints.failureImage:IMG_SERVER+"getErrorImage_"+this.constraints.width+"x"+this.constraints.height);if(this.container.tagName=="IMG")
{this.container.setAttribute("title",this.src);this.container.src=this.src;}
else
this.container.appendChild(this);if(this.constraints.loaderStyle!=null)
$(this.container).removeClass(this.constraints.loaderStyle);if(this.constraints.callback!=null)
{try
{this.constraints.callback.object[this.constraints.callback.method](this);}
catch(e)
{}}}
if(document.loadedImages[ImageLoader.src]!=null)
{ImageLoader.load();}
else if(document.loadedImages[ImageLoader.src]!=null)
{$("#searchHeader").text("already errored"+ImageLoader.src);ImageLoader.onerror();}
return ImageLoader;}
function trackSearchEvent(params,useLabel)
{var category=PAGE_ID+"_search_bar";var label=params[0];try
{if(params[1]!=undefined)
{var params2=new Array(category,label,params[1]);if(useLabel)
params2['useLabel']=true;trackEvent(params2);}
else
{var params2=new Array(category,label);trackEvent(params2);}}
catch(e)
{}}
function trackOffsite(result)
{try
{if(pageTracker==null)
return false;pageTracker._trackPageview('/result_click_conversion/');}
catch(e)
{}}
function trackEvent(params,pageview)
{try
{if(pageTracker==null)
return false;if((params[2]!=undefined)&&(params['useLabel']!=undefined))
{pageTracker._trackEvent(params[0],params[1],params[2]);}
else if(pageTracker._trackEvent(params[0],params[1]))
{pageTracker._trackEvent(params[0],params[1],303);}
else
{}
if(pageview)
pageTracker._trackPageview((PAGE_URL?PAGE_URL:''));}
catch(e)
{}}
function _initPageTracker()
{try
{pageTracker=_gat._getTracker(GOOGLE_ANALYTIC_KEY);pageTracker._setDomainName(GOOGLE_ANALYTIC_DOMAIN?GOOGLE_ANALYTIC_DOMAIN:'goby.com');pageTracker._trackPageview((PAGE_URL?PAGE_URL:''));objects.push(pageTracker);}
catch(e)
{setTimeout("_initPageTracker()",100);}}
Date.prototype.getTimestamp=function()
{return this.getTime()/1000;}
Date.prototype.dayCodes={1:"monday",2:"tuesday",3:"wednesday",4:"thursday",5:"friday",6:"saturday",0:"sunday"}
Date.prototype.sameDay=function(date)
{if(!date)
return false;if(date.getMonth()==this.getMonth()&&date.getDate()==this.getDate()&&date.getFullYear()==this.getFullYear())
return true;else
return false;}
Date.prototype.monthShortCodes={0:"jan",1:"feb",2:"mar",3:"apr",4:"may",5:"jun",6:"jul",7:"aug",8:"sep",9:"oct",10:"nov",11:"dec"}
Date.prototype.format=function(format)
{var today=new Date();if((this.getTime()<=today.getTime())||(this.sameDay(today)))
return(format=="oldway"?(today.getMonthShort()+" "+today.getDate()).toString():"today, "+(today.getMonthShort()+" "+today.getDate()).toString());if(format=="oldway")
return(this.getMonthShort()+" "+this.getDate()).toString();else if(format)
return(this.getWeekday()+", "+this.getMonthShort()+" "+this.getDate()).toString();else
return(this.getMonthShort()+" "+this.getDate()).toString();}
Date.prototype.getWeekday=function()
{var today=new Date();if(this.sameDay(new Date()))
return"today";return this.dayCodes[this.getDay()]}
Date.prototype.getMonthShort=function()
{return this.monthShortCodes[this.getMonth()];}
String.prototype.replaceAll=function(FindString,ReplaceString)
{var NewString=this.toString();while(NewString.match(FindString))
{var oldeString=NewString.toString();NewString=NewString.replace(FindString,ReplaceString);if(NewString==oldeString)
return NewString;}
return NewString;}
String.prototype.htmlentities=function()
{var output='';var char_='';var len=this.length;for(i=0;i<len;i++)
{var char_=this.charCodeAt(i);if((char_>47&&char_<58)||(char_>62&&char_<127))
output+=this.charAt(i);else
output+="&#"+char_+";";}
return output;}
function getClear()
{var clear=document.createElement("div");clear.className="clear";return clear;}
Number.prototype.formatPrice=function()
{return"$"+this.toString();}
String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"");}
String.prototype.ltrim=function(){return this.replace(/^\s+/,"");}
String.prototype.rtrim=function(){return this.replace(/\s+$/,"");}
String.prototype.pluralize=function()
{return this.toString()+"s";}
String.prototype.urlEncode=function()
{var string=this.toString();string=string.toLowerCase();string=string.replaceAll("&","and");string=string.replaceAll("/","_");string=string.replaceAll("-","+");string=string.replaceAll(", ","-");string=string.replaceAll(",","-");string=string.replaceAll(" ","-");var nonword=/([^a-z0-9\+\-\'])+/g;string=string.replace(nonword,"");return string;}
String.prototype.urlDecode=function()
{var utftext=unescape(this.toString());var string="";var i=0;var c=c1=c2=0;while(i<utftext.length){c=utftext.charCodeAt(i);if(c<128){string+=String.fromCharCode(c);i++;}
else if((c>191)&&(c<224)){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2;}
else{c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}}
string=string.replaceAll("-"," ");return string;}
function compileThumbnail(src,type,size)
{if(size)
TB_SIZE[type]=size;return IMG_SERVER+"getThumbnail"+(TB_SIZE[type]!=null?"_"+TB_SIZE[type]:'')+"="+src.toString().replace("http://",'');}
function getPageTitle(params,page)
{if(params.locationType==null)
params.locationType="UNKNOWN";if((!params.locationName)&&(!params.locationLabel))
{params.locationName=LOC_US_NAME;params.locationType="COUNTRY";}
switch(page)
{case"location":default:if(params.lat&&params.lng)
{if(params.locationLabel!=null)
var locationParams=params.locationLabel;else
var locationParams=params.lat+"&deg; / "+params.lng+"&deg;";}
else
var locationParams=params.locationName;switch(params.locationType)
{case"ZIPCODE":case"CITY":case"ADDRESS":var delimeter=" near ";break;case"COUNTY":case"COUNTRY":case"REGION":case"STATE":default:var delimeter=" in ";}
var query=(params.categoryName?params.categoryName.toLowerCase():'')+
(params.categoryName&&locationParams?delimeter:'')+
(locationParams?locationParams.toLowerCase():'')+
(params.dateID&&params.dateID!="anytime"?" for "+params.dateName.toString().toLowerCase():"");}
return query;}
function getFormattedUrl(params,page)
{if(params.locationType==null)
params.locationType="UNKNOWN";if(!params.locationName)
{params.locationName=LOC_US_NAME;params.locationType="COUNTRY";}
switch(page)
{case"location":case"category":default:if(params.lat&&params.lng)
var locationParams=params.lat+"x"+params.lng;else
var locationParams=params.locationName.urlEncode();switch(params.locationType)
{case"ZIPCODE":case"CITY":case"ADDRESS":var delimeter="--near--";break;case"COUNTY":case"COUNTRY":case"REGION":case"STATE":default:var delimeter="--in--";}
var query=(params.categoryName?params.categoryName.urlEncode():'')+
((params.categoryName)&&(locationParams)?delimeter:'')+
(locationParams?locationParams:'')+
(params.dateID&&params.dateID!="anytime"?"/date-"+params.dateID.urlEncode():"");}
return BASE_PATH+"/"+query;}
function displayException(e)
{if(DEBUG_MODE)
{var p=document.createElement("p");p.innerHTML="<strong>"+e.name+"</strong><br />"+e.message;$("body").append(p);}}
function killself(obj)
{try
{if(!navigator.isIE())
delete obj;else
obj=null;}
catch(e)
{obj=null;}}
function writeStyle(style)
{var link=document.createElement("link");link.rel="stylesheet";link.href=CSS_PATH+"/"+style;link.type="text/css";link.id="js-style";var head=document.getElementsByTagName("HEAD")[0];head.appendChild(link);}
function _initFooterLinks()
{$(".footerLink").click(function()
{var url=this.title;this.href="#";var link=new SearchLink({'url':url,'type':'url',debug:false});link.open();});}
function _initSitemapLinks()
{$(".searchLink").click(function()
{if(this.link==null)
{this.link=new SearchLink({url:this.href,type:'url',debug:false});this.link.open();this.href="#";}
else
this.link.open();});}
function getDistance(corA,corB)
{try
{if((corA.lat==undefined)||(corA.lng==undefined))
return-1;var lat1=parseFloat(corA.lat);var lon1=parseFloat(corA.lng);var lat2=parseFloat(corB.lat);var lon2=parseFloat(corB.lng);var destLat=lat1;var destLon=lon1;var srcLat=lat2;var srcLon=lon2;var d=(Math.acos(Math.sin(srcLat.toRad())*Math.sin(destLat.toRad())+
Math.cos(srcLat.toRad())*Math.cos(destLat.toRad())*Math.cos((destLon-srcLon).toRad()))*3956);}
catch(e)
{return-1;}
return d;}
if(typeof XMLHttpRequest=="undefined")
XMLHttpRequest=function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}
try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}
try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}
try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}
throw new Error("This browser does not support XMLHttpRequest or XMLHTTP.")};if(AJAX_PATH==undefined)
var AJAX_PATH="/ajax/";function AjaxRequest(url,callback,data,requestType)
{if(!requestType)
requestType="GET";this.terminal=false;this.setURL(url);this.loader=null;this.setCallback(callback);this.noExec=0;this.appendLoader=false;this.setRequestType(requestType);this.isJQuery=false;this.stream=false;this.matchParentHeight=false;if(data)
this.hashToRequestParams(data);this.defaultLoaderStyle="default_loader";objects.push(this);this.headers={"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}}
AjaxRequest.prototype={setLoader:function(loaderClass,loaderStyles,parentElement)
{loader=document.createElement("div");loader.className=(loaderClass!=undefined?loaderClass:this.defaultLoaderStyle);if(loaderStyles)
for(index in loaderStyles)
loader.style[index]=extraStyles[index];if(parentElement)this.setLoaderParent(parentElement);this.loader=loader;return this.loader;},setLoaderTxt:function(string)
{this.loaderText=string;},setLoaderIterator:function(params)
{this.loaderInterval=(params.interval?params.interval:100);this.loaderData=params.data;this.loaderIterator=true;this.loaderTitle=params.title;this.loaderMethod=params.method;return this.loader;this.loaderData=params.data;},removeLoader:function()
{if(this.loader)
{if(this.loaderIterator)
clearInterval(this.loadInterval);if(this.isJQuery)
$(this.loader).remove();else
this.loaderParent.removeChild(this.loader);this.loader=null;}},setURL:function(url)
{this.url=url;},setCallback:function(callback)
{if(callback.method)
{this.callbackMethod=callback.method;this.callbackObject=callback.object;}
else if(callback.match)
this.callbackMethod=callback;else
this.callbackMethod=false;},setLoaderParent:function(element)
{if(element)
{this.loaderParent=element;return this.loaderParent;}
else
this.loaderParent=document.body;},displayLoader:function()
{if(!this.loader)
this.loader=this.setLoader();if(this.loaderIterator)
{var loaderTitle=document.createElement("h3");loaderTitle.innerHTML=this.loaderTitle;this.loader.appendChild(loaderTitle);var iteratorDiv=document.createElement("span");var iteratorIco=document.createElement("div");this.loader.appendChild(iteratorIco);this.loader.appendChild(iteratorDiv);var ajax=this;this.loadInterval=setInterval(function()
{var data=ajax.loaderData.pop();if(data.status==1)
iteratorIco.className="good";else
iteratorIco.className="bad";iteratorDiv.innerHTML=data.text;ajax.loaderData.unshift(data);},this.loaderInterval);}
if(this.loaderText)
{this.loader.innerHTML=this.loaderText;}
if((this.isJQuery)&&(this.loaderParent))
{if(this.appendLoader)
this.loaderParent.append(this.loader);else
this.loaderParent.prepend(this.loader);}
else
{if(!this.loaderParent)this.loaderParent=document.body;if(this.matchParentHeight)
{$(this.loader).css("height",$(this.loaderParent).outerHeight());}
if(this.appendLoader)
this.loaderParent.appendChild(this.loader);else
{this.loaderParent.insertBefore(this.loader,this.loaderParent.firstChild);}}},setRequestType:function(value)
{switch(value)
{case"GET":this.requestType="GET";break;case"POST":default:this.requestType="POST";}},setAdtlParams:function(params)
{if(params!==undefined)
{if(params.useLoader)
{if(params.append)this.appendLoader=true;if(params.isJQuery)this.isJQuery=true;if(params.loaderParent)this.setLoaderParent(params.loaderParent);if(params.loaderClass)this.setLoader(params.loaderClass,params.loaderStyles);if(params.loaderText)this.setLoaderTxt(params.loaderText);if(params.loaderIterator)this.setLoaderIterator(params.loaderIterator);if(params.matchParentHeight)this.matchParentHeight=true;this.displayLoader();}
this.stream=(params.stream!=null?params.stream:false);if(params.noExec)
this.noExec=1;}},makeRequest:function(params)
{if(!this.url)
return false;if(params)
this.setAdtlParams(params);var ajax=new XMLHttpRequest();this.terminal=false;this.ajax=ajax;switch(this.requestType)
{case"POST":ajax.open(this.requestType,this.url,true);break;case"GET":var url=this.url;if(this.params!=""){url+="?"+this.params;}
ajax.open(this.requestType,url,true);break;}
for(index in this.headers)
{ajax.setRequestHeader(index,this.headers[index]);}
if(this.requestType=="POST")
ajax.send(this.params);var obj=this;this.ajax=ajax;if(navigator.isBrowser(browser.IE_SIX))
this.compliantRequest();else
this.goodRequest(this.ajax);if(this.requestType=="GET")
ajax.send(null);return true;},hashToRequestParams:function(data)
{var params="";for(key in data)
params+=key+"="+data[key]+"&";this.params=params;return params;},addHeader:function(header,content)
{this.headers[header]=content;},logout:function()
{window.open(BASE_PATH+"/logout/","_self");},terminateRequest:function(callback)
{this.removeLoader();if(callback)
{if(this.callbackMethod)
{var data={error:{message:"We were unable to process your request",hint:"sorry :(",type:"MAX_EXECUTION"}};if(this.callbackObject)
this.callbackObject[this.callbackMethod](data);else
eval(this.callbackMethod+"(data)"+";");}}
this.ajax.abort();this.terminal=true;},showTimer:function(time)
{if(document.getElementById("timer")==null)
{var timerArea=document.createElement("div");timerArea.id="timer";timerArea.onclick=function()
{$(this).remove();}}
else
{var timerArea=document.getElementById("timer");}
timerArea.innerHTML=time;$("body").prepend(timerArea);},_destruct:function()
{for(var i in this)
this[i]=null;killself(this);},compliantRequest:function()
{this.resultbuffer=0;var ajax=this.ajax;this.amt=0;var object=this;this.ajaxInterval=setInterval(function()
{object.amt=object.amt+50;if(object.terminal)
{object.removeLoader();clearInterval(object.ajaxInterval);}
try
{if((typeof object.ajax.readyState=="undefined")||(object.ajax.readyState==null))
{return false;}}
catch(e)
{return false;}
if((object.ajax==null)||(object.ajax.readyState==null))
return false;if(object.ajax.readyState==4&&object.ajax.status==200)
{if(object!=null)
object.removeLoader();clearInterval(object.ajaxInterval);var json=object.ajax.responseText;try
{if(json)
{if(!object.noExec)
{if(object.stream)
{var json=object.ajax.responseText.substring(object.resultbuffer);}
else
var json=object.ajax.responseText;eval("var data ="+json+";");}
else
var data=object.ajax.responseText.substring(object.resultbuffer);}
else
{var data=null;}}
catch(e)
{}
if(data=="logout")
object.logout();if((DEBUG_MODE)&&(data.timer!=undefined))
{object.showTimer(data.timer);}
if(object.callbackMethod)
{if((object.cheat)&&(object.push!=null))
{for(var w=0;w<data.length;w++)
{var d=data[w];if(object.callbackObject)
object.callbackObject[object.callbackMethod](d);else
eval(object.callbackMethod+"(d)"+";");}}
else
{if(object.callbackObject)
object.callbackObject[object.callbackMethod](data);else
eval(object.callbackMethod+"(data)"+";");}}}
else if(object.ajax.readyState==4)
{object.terminateRequest();}
if(object.terminal)
object.ajax.abort();},50);if(this.requestType=="GET")
ajax.send(null);},goodRequest:function(ajax)
{ajax.object=this;ajax.onreadystatechange=function()
{var object=ajax.object;if(this.object.terminal)
this.abort();if(this.object.terminal)
{this.object.removeLoader();clearInterval(this.object.ajaxInterval);}
try
{if((typeof this.readyState=="undefined")||(this.readyState==null))
return false;}
catch(e)
{return false;}
if(this.readyState==4&&this.status==200)
{if(this.object!=null)
this.object.removeLoader();var json=this.responseText;try
{if(json)
{if(!this.object.noExec)
{if(this.object.stream)
var json=this.responseText.substring(object.resultbuffer);else
var json=this.responseText;eval("var data ="+json+";");}
else
var data=this.responseText.substring(object.resultbuffer);}
else
{var data=null;}}
catch(e)
{}
if(data=="logout")
this.object.logout();if((DEBUG_MODE)&&(data.timer!=undefined))
{this.object.showTimer(data.timer);}
if(this.object.callbackMethod)
{if((this.object.cheat)&&(this.object.push!=null))
{for(var w=0;w<data.length;w++)
{var d=data[w];if(this.object.callbackObject)
this.object.callbackObject[this.object.callbackMethod](d);else
eval(this.object.callbackMethod+"(d)"+";");}}
else
{if(this.object.callbackObject)
this.object.callbackObject[this.object.callbackMethod](data);else
eval(this.object.callbackMethod+"(data)"+";");}}}
else if(this.readyState==4)
this.object.terminateRequest();if(this.object.terminal)
this.abort();}}}
var msgCode={EMAIL:"email",DATE:"date",REQUIRED:"required",MATCH:"match",MIN_LEN:"minlen",ALPHA:"alpha",INT:"int",FLOAT:"float",ALL:"all",ZIPCODE:"zipcode",PHONE:"phone",CREDIT:"credit"}
function Validator(form)
{this.form=form;this.labels=this.form.getElementsByTagName("label");this.errorCnt=0;this.fields=new Array();if(this.labels.length)
{for(index in this.labels)
{var label=this.labels[index];if(label==undefined)
continue
try
{var fieldName=$(label).attr("for");}
catch(e)
{continue;}
if(fieldName==null)
{continue;}
if(fieldName=="undefined")
continue;if(typeof fieldName=="undefined")
continue;if((fieldName)&&(this.form.elements[fieldName]!=undefined))
{var inst2=label.className.match(/\[(.*?)\]/);if(!inst2)
continue;inst=inst2[1];var fieldItem={label:label,field:this.form.elements[fieldName],ins:inst};this.fields.push(fieldItem);}}}}
Validator.prototype.validate=function()
{while(this.fields.length>0)
{if(!this.validateField(this.fields.pop()))
this.errorCnt++;}
return this.errorCnt;}
Validator.prototype.validateField=function(fieldItem)
{var instructions=fieldItem.ins;var field=fieldItem.field;var label=fieldItem.label;var blah=instructions.split(":");var type=blah[0];var isRequired=(blah[1]==1?true:false);var msgParams=false;var valid=true;if(field.value.length>0)
{switch(type)
{case"date":if(string=field.value.match(/^[0-9]{1,2}[/]{1}[0-9]{1,2}[/]{1}[0-9]{4}$/))
valid=true;else
{msgID=msgCode.DATE;valid=false;}
break;case"email":if(string=field.value.match(/^[0-9a-zA-Z_\.\+\-]+@([1-9a-zA-Z\.\+\-\_]+)[\.]{1}[a-zA-Z]{2,4}$/))
valid=true;else
{msgID=msgCode.EMAIL;valid=false;}
break;case"alpha":if(field.value.match(/^[A-Za-z ]+$/))
valid=true;else
{msgID=msgCode.ALPHA;valid=false;}
break;case"int":if(field.value.match(/^[0-9]+$/))
valid=true;else
{msgID=msgCode.INT;valid=false;}
break;case"float":if(field.value.match(/^[0-9\.\,]+$/))
valid=true;else
{msgID=msgCode.FLOAT;valid=false;}
break;case"zipcode":if(field.value.match(/^[0-9]{5}$/)?true:false)
valid=true;else
{msgID=msgCode.ZIPCODE;valid=false;}
break;case"phone":if(field.value.match(/^(\(??[0-9]{3}(?:\) |-)+?[0-9]{3}[-| ][0-9A-Z]{4})$/))
valid=true;else
{msgID=msgCode.PHONE;valid=false;}
break;case"credit":if(field.value.match(/^(\(??[0-9]{4}(?:\) |-)+?[0-9]{4}[-| ][0-9]{4}[-| ][0-9]{4})$/))
valid=true;else
{msgID=msgCode.CREDIT;valid=false;}
break;case"all":case"pwd":valid=true;break;}}
else if(isRequired)
{var valid=false;msgID=msgCode.REQUIRED;}
else
{valid=true;}
if(blah[2]!=undefined)
{var advIns=blah[2].split("&");for(index in advIns)
{scrap=advIns[index].split("=");switch(scrap[0])
{case"matchField":var fieldName=scrap[1];var eField=this.form.elements[fieldName];if(valid)
{var valid=(eField.value==field.value?true:false);msgID=msgCode.MATCH;msgParams={field:eField.name}}
break;case"minlen":if(valid==true)
{var valid=(field.value.length>=scrap[1]?true:false);msgID=msgCode.MIN_LEN;msgParams={length:scrap[1]}}
break;}}}
if(!valid)
{$(label).addClass("error");$(field).addClass("error");var msg=this.getMsg(msgID,msgParams,fieldItem);$(label).parent().contents(".validmsg").text(msg);$("#msg-"+field.name).text(msg);$("#msg-"+field.name).show();return false;}
else
{$(label).parent().contents(".validmsg").text('');$("#msg-"+field.name).text('');$("#msg-"+field.name).hide();$(label).removeClass("error");$(field).removeClass("error");return true;}}
Validator.prototype.getMsg=function(msgID,params,fieldObject)
{var label=(fieldObject.label.innerHTML?fieldObject.label.innerHTML:"This");switch(msgID)
{case msgCode.EMAIL:return"invalid email address";break;case msgCode.INT:return label+" needs to be a valid number";break;case msgCode.DATE:return label+" needs to be a valid date format (eg. MM/DD/YYYY)";break;case msgCode.ALPHA:return label+" needs to contain only word characters";break;case msgCode.PHONE:return label+" needs to be a valid phone number";break;case msgCode.CREDIT:return label+" needs to be a valid credit card number";break;case msgCode.REQUIRED:return label+" is required";break;case msgCode.MATCH:var msg=label+" must match";return msg;break;case msgCode.ZIPCODE:var msg=label+" must be a valid zipcode";return msg;break;case msgCode.MIN_LEN:var msg=label+" must be at least "+params.length+" characters long";return msg;break;default:return"there was an error, apparently";}}
function _rmGame(container)
{$(container).html("");}
function _initGame(container)
{if(container!=null)
{$(container).html("<embed src=\""+FLASH_GAME+"\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"425\" height=\"310\"  wmode=\"transparent\"></embed><small id=\"game_instructions\">Use the left and right <strong>arrows</strong> to move &amp; the <strong>space bar</strong> to fire. Thank you for your patience.</small>");}}
function _initFortuneCookie(container)
{return new FortuneCookie(container);}
function FortuneCookie(container)
{var cookie=document.createElement("div");objects.push(this);cookie.id="cookie";$(cookie).css({'background':"url("+IMG_PATH+"/cookies/cookie_start.png)"});cookie.handler=this;$(cookie).toggle(function()
{var handler=$(this).attr('handler');var request=new AjaxRequest(AJAX_PATH+"result_requests.php",{object:handler,method:"revealFortune"},{action:"getFortuneCookie"},"GET");request.makeRequest();},function()
{$item=$(this);$item.css({'width':'200','background':"url("+IMG_PATH+"/cookies/cookie_start.png)"});});$(cookie).appendTo(container);this.cookie=cookie;}
FortuneCookie.prototype.revealFortune=function(data)
{$item=$(this.cookie);$item.css({'width':"359px",'background':"url("+data.image+")"});}
FortuneCookie.prototype._destruct=function()
{for(var i in this)
this[i]=null;killself(this)}
Facebook=function(api_key,configbase,registered,logged_in){var logging_out=false;FB_RequireFeatures(["XFBML","Api"],function(){FB.Facebook.init(api_key,configbase+"/ajax/xd_receiver.html",{"ifUserConnected":function(){if(!registered){}
else if(!logged_in){}},"ifUserNotConnected":function(){if(logged_in&&!logging_out)
{window.location.href=configbase+'/logout.php?redirect='+escape(window.location);}}});});$("#loginFacebook").click(function(event)
{event.preventDefault();FB.Connect.requireSession(function()
{$.post(AJAX_PATH+"/user_requests.php",{'action':'2','fb':true},function(result)
{if(result.firstFacebookLogin)
{FB.Connect.showPermissionDialog("email",function(response){FB.Facebook.get_sessionState().waitUntilReady(function(session){var dialog=new FB.UI.FBMLPopupDialog('Invite friends to check out Goby','');var fbml='<fb:fbml>'+'<fb:request-form style="width:625px; height:500px;" action="'+window.location.href+'" method="POST" invite="false" type="Goby"'
+'content="<fb:name uid=\''+FB.Connect.get_loggedInUser()+'\' firstnameonly=\'true\'></fb:name> wants you to find fun things to do at <a href=\'http://www.goby.com\'>Goby</a>.'
+'<fb:req-choice url=\'http://goby.com?fbaccept\' label=\'Go\' />">'
+'<fb:multi-friend-selector showborder="false" actiontext="Which of your friends could use some fun?" cols="4" rows="3"/>'
+'</fb:request-form>'
+'</fb:fbml>';dialog.setFBMLContent(fbml);dialog.setContentWidth(625);dialog.setContentHeight(511);dialog.add_closing(function(close_naturally){if(!close_naturally){location.reload(true);}});dialog.show();});});}
else{location.reload(true);}},"json");},true);});$("#logoutFacebook").click(function(event){logging_out=true;event.preventDefault();FB.Connect.logout(function(){window.location=configbase+'/logout.php?redirect='+escape(window.location);});});}
function postToNewsFeed(result){var locationName=result.resultSet.locationName;var categoryName=result.resultSet.categoryName;var resultTitle=result.facets.title;var urlParams={locationID:result.resultSet.locationID,locationName:locationName,categoryID:(result.resultSet.categoryID),categoryName:categoryName}
var link="http://goby.com"+getFormattedUrl(urlParams,"search");var attachment={'name':'Check out more '+categoryName+' near '+locationName+'','href':link,'caption':'{*actor*} found \''+resultTitle+'\' using Goby, what will you find?','description':result.facets.description};var action_links=[{'text':'Find stuff to do with Goby','href':link}];FB.Connect.streamPublish('Great find on Goby!',attachment,action_links,null,'What do you think of \''+resultTitle+'\'?',null,true);}
var exc={ERROR_NO_RESULTS:300,ERROR_FATAL:301,ERROR_HARVEST:400,ERROR_HARVEST_WITH_RESULTS:401}
function Exception(error)
{for(i in error)
this[i]=error[i];this.body=document.createElement("div");$(this.body).addClass("bubble_body");var header=document.createElement("h5");this.content=document.createElement("p");header.innerHTML=this.message;this.content.text=this.hint;this.header=header;objects.push(this);this.body.appendChild(header);this.body.appendChild(this.content);}
Exception.prototype.display=function(wrapper,noCookie)
{this.container=document.createElement("div");this.container.className="exception";if(!noCookie)
{this.stem=document.createElement("div");$(this.stem).addClass("bubble_stem");this.container.appendChild(this.stem);}
this.container.appendChild(this.body);if(this.type===exc.ERROR_NO_RESULTS)
{var allCategories=document.createElement("a");$allCategories=$(allCategories);$allCategories.addClass("allCategories");$allCategories.text("browse all categories");$allCategories.appendTo(this.header);$allCategories.click(function()
{(Goby.has('searchbox')?Goby.get('searchbox').getField('what').openPanel():'');});$allCategories.show();}
switch(this.type)
{case exc.ERROR_HARVEST:this.content.innerHTML="";var span1=document.createTextNode("Please try hitting the search button again in ");var span2=document.createTextNode(" seconds");this.timer=document.createElement("span");this.timer.innerHTML='60';this.content.appendChild(span1);this.content.appendChild(this.timer);this.content.appendChild(span2);var gameContainer=document.createElement("div");gameContainer.id="gameContainer";_initGame(gameContainer);this.body.appendChild(gameContainer);this.activateTimer();break;case exc.ERROR_HARVEST_WITH_RESULTS:break;default:if(!noCookie)
{var cookieContainer=document.createElement("div");cookieContainer.id="cookieContainer";this.fortuneCookie=new FortuneCookie(cookieContainer);this.body.appendChild(cookieContainer);}
break;}
if(this.tandem)
{var closeLink=document.createElement("a");closeLink.title="[close]";$(closeLink).addClass("closeLink");closeLink.appendChild(document.createTextNode("[X]"));closeLink.handler=this;closeLink.onclick=function()
{this.handler.close();}
$(this.body).prepend(closeLink);}
$(wrapper).prepend(this.container);}
Exception.prototype.activateTimer=function()
{var handler=this;this.timerInt=setInterval(function()
{var count=parseInt(handler.timer.innerHTML)
handler.timer.innerHTML=count-1;if(count<2)
{handler.content.innerHTML="The results should be harvested by now!";clearInterval(handler.timerInt);}},1000);}
Exception.prototype._destruct=function()
{for(var i in this)
this[i]=null;killself(this);}
Exception.prototype.close=function()
{$(this.container).fadeOut(500,$(this.container).remove());}
function Parameter(type,source,object)
{this.declared=false;this.location=(source?source:window.location).toString();this.type=type;if(object!=null)
this.data=object;else
this.data=this.serialize();}
Parameter.prototype.deserialize=function()
{switch(this.type)
{case"page":return this.type+"="+(this.data+1);break;case"sort":return this.type+"="+this.data.label+":"+this.data.dir;break;case"filters":var filterset=[];for(var index in this.data)
{if(this.data[index].join!=null)
var filterData=this.data[index].join(",");else
var filterData=this.data[index];if(filterData)
filterset.push(index+":"+filterData);}
return this.type+"="+filterset.join("|");break;}}
Parameter.prototype.isDeclared=function()
{return this.declared;}
Parameter.prototype.diff=function(parameter)
{var diffData=parameter.serialize();switch(this.type)
{case"page":return(this.data!=diffData?true:false);break;case"sort":if((this.data.label!=diffData.label)||(this.data.dir!=diffData.dir))
return true;else
return false;break;case"filters":if(this.data.length!=diffData.length)
{return true;}
function diff(dataSetA,dataSetB)
{if(dataSetA==null)
return false;if(dataSetB==null)
return true;for(var label in dataSetA)
{if(dataSetB[label]==null)
{return true;}
if(dataSetB[label]==null)
return true;var filterHashA=[];var filterHashB=[];if(dataSetA[label].replace!=null)
{var _a=dataSetA[label].toString();filterHashA[_a]=_a;}
else
{for(var i in dataSetA[label])
if(filterHashA[dataSetA[label][i]]==null)
filterHashA[dataSetA[label][i]]=dataSetA[label][i];}
if(dataSetB[label].replace!=null)
{var _b=dataSetB[label].toString();filterHashB[_b]=_b;}
else
{for(var i in dataSetB[label])
if(filterHashB[dataSetB[label][i]]==null)
filterHashB[dataSetB[label][i]]=dataSetB[label][i];}
for(var j in filterHashA)
if(filterHashB[j]==null)
return true;for(var k in filterHashB)
if(!filterHashA[k]==null)
return true;filterHashA=null;filterHashB=null;}
return false;}
if(diff(this.data,diffData))
{return true;}
if(diff(diffData,this.data))
{return true;}
return false;break;}}
Parameter.prototype.serialize=function(value)
{if(this.data!=null)
return this.data;var value=(value!=null?value:this.location).toString();switch(this.type)
{case"sort":var data=value.match("sort=([a-zA-Z]{1,9}):((?:ASC|DESC)?)[&]??");if(!data)
data=value.match("sort=([a-zA-Z]{1,9})[&]??");if((data)&&(data.label!="relevance"))
{this.declared=true;parameter={label:(data[1]!=null?data[1]:null),dir:(data[2]!=null?data[2]:"ASC")};}
else
{var resultSet=Goby.get("resultSet");this.declared=false;if(resultSet.getParameter("sort"))
return resultSet.getParameter("sort").serialize();else
{var parameter={label:"relevance",dir:"ASC"}}}
return parameter;break;case"page":var data=value.match("page=([^&][0-9]*)[&]??");if(data!=null)
{this.declared=true;return data[1]-1;}
else
return 0;break;case"filters":var data=value.match("filters=([^&]{1,100})[&]??");if((data!=null)&&(data[1]!=null))
{var filters=data[1];var filterSet=filters.split("|");parameter=[];for(var i in filterSet)
{var item=filterSet[i].split(":");var name=item[0];var value=item[1].urlDecode();if(value.match(","))
var v=value.split(",");else if(value.match("-"))
var v=value.split("-");else
var v=value;parameter[name]=v;}
this.declared=true;return parameter;}
else
{this.declared=false;return[];}
break;}}
window.deserializeParameters=function()
{var darray=[];for(var i in this.parameters)
{darray.push(this.parameters[i].deserialize());}
return darray.join("&");}
window.setParameter=function(param)
{this.parameters[param.type]=param;}
window.setParameters=function()
{this.parameters={};this.parameters['page']=new Parameter("page");this.parameters['filters']=new Parameter("filters");this.parameters['sort']=new Parameter("sort");this.loque=this.location.toString();this.tmp=this.location.toString();}
window.compareParameter=function(type)
{var param=new Parameter(type);return(this.parameters[type].diff(param));}
window.setHistoryStorage=function()
{if(navigator.isIE())
{var ifrm=document.createElement("iframe");this.iframe=ifrm;ifrm.name="ajaxhistory";ifrm.style.display="none";document.body.appendChild(ifrm);}}
window.compareParameters=function()
{if((this.loque==this.location.toString())||(this.tmp==this.location.toString()))
{return false;}
else
{}
var update=false;if(window.compareParameter("page"))
{this.parameters.page=new Parameter("page");$("#portalPage").html("new:"+this.parameters.page.deserialize());update=true;}
else
{$("#portalPage").html("fixed:"+this.parameters.page.deserialize());}
if(window.compareParameter("sort"))
{this.parameters.sort=new Parameter("sort");$("#portalSort").html("new:"+this.parameters.sort.deserialize());update=true;}
else
{$("#portalSort").html("fixed:"+this.parameters.sort.deserialize());}
if(window.compareParameter("filters"))
{this.parameters.filters=new Parameter("filters");var serialized=this.parameters.filters.serialize();$("#portalFilters").html("updated:"+this.parameters.filters.deserialize());update=true;}
else
{$("#portalFilters").html("fixed:"+this.parameters.filters.deserialize());}
this.loque=window.location.toString();this.tmp=window.location.toString();return update}
window.history.go=function()
{alert('k.');}
function bindAnchor(item)
{$(item).click(function()
{window.mergeParameters(this);});}
window.bookmarkPage=function(parameters)
{var param=this.compileLink(parameters);window.open(param.hash,"_self");}
window.compileLink=function(parameters,anchor)
{var dset=[];for(var i in this.parameters)
{if((parameters!=null)&&(parameters[i]))
this.parameters[i]=parameters[i];dset.push(this.parameters[i].deserialize());}
if(anchor)
var remote=anchor.href.match("([^#]+?)#");var remote=(remote!=null&&remote[1]!=null?remote[1]:'')
var hash=dset.join("&");var result={href:remote+"#"+hash,hash:"#"+hash}
this.tmp=result.toString();if(navigator.isIE())
this.updateIframe(hash);return result;}
window.mergeParameters=function(anchor)
{var dset=[];if(anchor.href_old!=null)
anchor.href=anchor.href_old;for(var i in this.parameters)
{var param=new Parameter(i,anchor.href);if(param.isDeclared())
{dset.push(param.deserialize());this.parameters[i]=param;}
else
dset.push(this.parameters[i].deserialize());}
var remote=anchor.href.match("([^#]{0,100})#");var remote=(remote!=null&&remote[1]!=null?remote[1]:'')
var hash=dset.join("&");var result=remote+"#"+hash;anchor.href_old=anchor.href;this.tmp=result.toString();if(navigator.isIE())
this.updateIframe(hash);return result;}
window.onFrameLoaded=function(json)
{this.location.hash=json.hash;if(window.compareParameters())
{if(this.resultSet!=null)
{try
{this.resultSet.setParameters(this.parameters);}
catch(e)
{}}}}
window.updateIframe=function(hash)
{if(navigator.isIE())
{var title="title="+document.title.toString().urlEncode();this.iframe.src=AJAX_PATH+"draw.php?"+hash+"&"+title;}}
window.stopComparing=function()
{clearInterval(this.diffInterval);}
window.getResultSet=function()
{if(this.resultSet!=null)
return this.resultSet;else
return null;}
window.setResultSet=function(resultSet)
{this.resultSet=resultSet;}
window.startComparing=function(resultSet)
{this.setResultSet(resultSet);this.diffInterval=setInterval(function()
{if(window.compareParameters())
{if(this.resultSet!=null)
{this.resultSet.setParameters(this.parameters);}}
else
{}},1000);}
window.getParameters=function()
{if(this.parameters==null)
parameters=this.setParameters();else
parameters=this.parameters;if(parameters)
return parameters;else
return 0;}
window.getParameter=function(label)
{var parameters=this.getParameters();if(parameters[label]!=null)
return this.parameters[label];else
return false;}
window.setPage=function()
{this.parameters.page=new Parameter();}
window.getPage=function()
{this.getParameter('page').serialize();}
window.getSort=function()
{this.getParameter('sort').serialize();}
window.getFilters=function()
{this.getParameter('filters').serialize();}
window.onerror=function(e)
{try
{}
catch(e)
{}}
var aras;window.makeAnchorsCompatable=function()
{$("a").each(function()
{if((!this.hash&&(this.href.toString().match("#")||(this.href.toString().match("#"+BASE_ANCHOR))))||(this.hash=="#")||(this.hash==("#"+BASE_ANCHOR)))
{$(this).bind("click.parameter",function(e)
{var data=window.compileLink(null,this);this.href=data.href;this.hash=data.hash;});}});}
function _initSlidableObject(params)
{var mui={container:params.container,area:params.area,mapY:0,newMapY:0,offset:{y:params.offset},lastScrollMS:0,mouseDown:false,locked:false,scrollIdleDelay:400,mapSlide:$(params.area),winHeight:$(window).height(),footLimitY:function(){return $(this.container).height()},mapHeight:function(){return $(this.area).height()+mui.offset.y;},init:function(){mui.originY=parseInt($("#searchWrapper").outerHeight());mui.mapY=0+mui.offset.y;mui.originDiff=mui.originY-mui.getScrollY();mui.mapSlide.css({marginTop:mui.mapY});mui.mapSlide.css("position","relative");var scrollTimer;mui.toggleLock=function(lock)
{mui.locked=lock;if(!lock)
scrollChecker();}
var scrollChecker=function()
{if(mui.locked)
return false;var diff=(mui.getScrollY()+(mui.mapHeight()))-mui.originY;mui.mapY=((mui.originY+mui.offset.y)-mui.getScrollY())
mui.position="fixed";if(diff>mui.footLimitY())
{mui.mapY=(mui.footLimitY()-(mui.mapHeight()))+mui.offset.y;mui.position="relative";}
else if(mui.mapY<mui.offset.y)
{mui.position="fixed";mui.mapY=mui.offset.y;}
else if(mui.mapY>(0-mui.offset.y))
{mui.position="static";mui.mapY=mui.originY;}
else
{}
mui.mapSlide.css({top:mui.mapY,position:mui.position});}
window.onscroll=function()
{scrollChecker();}},getScrollY:function(){var scrOfY=0;if(typeof(window.pageYOffset)=='number'){scrOfY=window.pageYOffset;}
else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrOfY=document.body.scrollTop;}
else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrOfY=document.documentElement.scrollTop;}
return scrOfY;return 0;}}
return mui;}
function PopupMgr()
{objects.push(this);}
PopupMgr.prototype={popups:[],closeAllBut:function(item)
{for(var j=0;j<this.popups.length;j++)
if(this.popups[j]!==item)
{if(this.popups[j]==null)
{this.popups[j]=null;}
else if((!this.popups[j].isClosed())&&(!this.popups[j].isProtected))
{this.popups[j].close();}
else
{}}},add:function(item)
{this.popups.push(item);}}
var popupMgr=new PopupMgr;function Popup(params)
{if(popupMgr!=null)
popupMgr.add(this);for(var i in params)
this[i]=params[i];}
Popup.prototype={stem:null,id:null,label:null,isCloser:false,isProtected:false,shell:null,ratio:0.5,fixed:false,closerText:"close",wrapperClass:null,noClick:false,blindColor:"#004d7b",slidable:false,isShell:true,verifyClose:null,isMask:false,mask:"#wrapper",maskOpacity:0,prepend:false,useBlind:false,blindClass:"pageBlind",automargin:true,closed:false,getNode:function()
{if(this.shell!=null)
return this.shell.content.center;else
return this.content;},isClosed:function()
{return this.closed;},hide:function()
{if(this.useBlind)
{if(this.blind.parentNode!=null)
this.blind.parentNode.removeChild(this.blind);}
else if(this.isMask)
{if(navigator.isIE())
$(this.mask).show();else
$(this.mask).fadeTo(250,1);}
if(this.isShell)
{if(this.slidable)
{$(this.shell).slideUp(600);var obj=this;var timeout=setTimeout(function(){obj.wipeout();},600);return false;}
else
{if(this.shell.parentNode!=null)
this.shell.parentNode.removeChild(this.shell);else
$(this.shell).remove();}}
else
{if(this.content.parentNode!=null)
this.content.parentNode.removeChild(this.content);else
this.content=null;}
this.closed=true;if(this.verifyClose!=null)
this.verifyClose.destruct();},wipeout:function()
{$(this.shell).remove();this.closed=true;if(this.verifyClose!=null)
this.verifyClose.destruct();},close:function()
{this.hide();this.closed=true;},getClass:function()
{if(this.customClass)
{return(this.wrapperClass!=null?this.wrapperClass:'');}
else if(this.isMask)
return"popup-mask "+(this.wrapperClass!=null?this.wrapperClass:'');else
return"popup "+(this.wrapperClass!=null?this.wrapperClass:'');},display:function()
{popupMgr.closeAllBut(this);this.content.container=this.container;this.closed=false;if(this.isShell)
{var shell=this.createShell();if(this.slidable)
$(shell).hide();if(this.prepend)
$(this.container).prepend(shell);else
this.container.appendChild(shell);if(this.slidable)
$(shell).slideDown(600);}
else
{if(this.prepend)
$(this.container).prepend(this.content);else
this.container.appendChild(this.content);}
if(!this.isShell)
{$(this.content).addClass(this.getClass());}
if(this.useBlind)
{this.blindPage();}
else if(this.isMask)
{if(navigator.isIE())
{$(this.mask).hide();}
else
$(this.mask).fadeTo(250,this.maskOpacity);}
else
this.positionContent();if((this.fixed)||(this.isCloser))
{if(this.isCloser)
{var closer=document.createElement("a");closer.popup=this;closer.onclick=function(e)
{this.popup.close();}
var closebutton=document.createElement("div");var closeText=document.createElement("div");$(closebutton).addClass("closeButton");closer.className="closer";closeText.innerHTML=(this.closerText?this.closerText:"close");closeText.className="closeText"
closer.appendChild(closebutton);$(closer).append(closeText);this.closerNode=closer;$(this.content).prepend(closer);}
if(this.isShell)
{var node=this.getWrapper();if(this.slidable)
{var row=node.insertRow(node.rows.length);var cell=document.createElement("td");cell.colSpan=3;cell.appendChild(closer);row.appendChild(cell);}}
else
var node=this.getNode();}
if((!this.noClick)&&(!this.fixed))
{if(this.isShell)
var node=this.getWrapper();else
var node=this.getNode();if(this.wrappers)
safeWrappers=this.wrappers;else
{var safeWrappers=[];safeWrappers[node.id]=node;}
this.verifyClose=new keywordCloser(safeWrappers,{object:this,method:"close"});this.verifyClose.initStgClick(100);}
return this.content;},createShell:function()
{this.shell=document.createElement("table");this.shell.id=this.content.id.toString();$(this.shell).addClass(this.getClass());$(this.shell).addClass("popup_"+this.position);var rows=[];rows.push('top');if(this.label)
rows.push('label');rows.push('content');rows.push('bot');var cols=['left','center','right'];for(var i=0;i<rows.length;i++)
{var name=rows[i];this.shell.insertRow(i);var row=this.shell.insertRow(i);for(var j=0;j<cols.length;j++)
{row[cols[j]]=row.insertCell(j);}
this.shell[name]=row;}
if(this.label)
{this.shell.label.center.className="label";this.shell.label.left.className="label-left";this.shell.label.right.className="label-right";this.shell.label.center.appendChild(this.label);}
this.shell.bot.center.className="bot";this.shell.bot.left.className="corner bot-left";this.shell.bot.right.className="corner bot-right";this.shell.top.center.className="top";this.shell.top.left.className="corner top-left";this.shell.top.right.className="corner top-right";this.shell.content.center.className="content";this.shell.content.left.className="left";this.shell.content.right.className="right";var popContent=this.shell.content.center;popContent.appendChild(this.content);if(this.stem)
{var stem=document.createElement("div");$(stem).addClass("stem");this.stemArea=stem;switch(this.position)
{case"left":this.shell.content.right.appendChild(stem);break;case"right":this.shell.content.left.appendChild(stem);break;case"top":default:this.shell.bot.center.appendChild(stem);}}
this.content.id=null;return this.shell;},getWrapper:function()
{return this.shell;},positionContent:function()
{if(this.isShell)
var area=this.getWrapper();else
var area=this.getNode();var height=$(area).outerHeight();var width=$(area).outerWidth();var shell=this.getWrapper();var stemHeight=0;var stemWidth=0;switch(this.position)
{case"none":return false;var offset=0;var xoffset=0;break;case"top":var offset=Math.round(((height)-(height*2))-32);var xoffset=Math.round(((width+60)-(width*2))*this.ratio);break;case"left":if(this.stemArea)
{var stemHeight=$(this.stemArea).outerHeight()/2;var stemWidth=$(this.stemArea).outerWidth()*2;var stemOffset=(h-stemHeight)-(shell.label?$(shell.label).outerHeight():0);}
var h=height*this.ratio;var w=$(area).outerWidth();var offset=Math.round(h-(h*2));var xoffset=w-(w*2)-stemWidth;break;case"right":var w=$(area.parentNode).outerWidth();var h=(height*this.ratio);var offset=Math.round(h-(h*2));if(this.stemArea)
{var stemHeight=$(this.stemArea).outerHeight()/2;var stemWidth=$(this.stemArea).outerWidth()*2;var stemOffset=(h-stemHeight)-(shell.label?$(shell.label).outerHeight():0);}
var xoffset=w+stemWidth;break;case"center":break;default:var offset=Math.round(((height)-(height*2)*this.ratio)-32);var xoffset=width;}
if((this.stemArea)&&(stemOffset))
$(this.stemArea).css("marginTop",stemOffset+"px");if(this.automargin)
$(area).css("marginTop",offset+"px");try
{$(area).css("marginLeft",xoffset+"px");}
catch(e)
{}},blindPage:function()
{this.blind=document.createElement("div");$(this.blind).addClass(this.blindClass);$(this.blind).css({position:'absolute',opacity:1-this.maskOpacity,zIndex:8000});this.blind.adjust=function()
{if(navigator.isIE())
{var y=$(window).height();var x=$(window).width();$(this).css({width:x,height:y});}
else
{var scrollX=(window.pageXOffset!=null?window.pageXOffset:document.body.scrollLeft);var scrollY=(window.pageYOffset!=null?window.pageYOffset:document.body.scrollTop);var offsetY=parseInt($(this).css("top"))+parseInt($(this).css("margin-top"));var offsetX=parseInt($(this).css("left"))+parseInt($(this).css("margin-left"));if(navigator.isBrowser(browser.SAFARI))
{offsetX+=40;offsetY+=40;}
offsetX+=20;var y=$(window).height()+scrollY-offsetY;var x=$(window).width()+scrollX-offsetX;$(this).css({width:x,height:y});}}
this.blind.adjust();window.blind=this.blind;$(window).scroll(function(){if(this.blind!=null){this.blind.adjust()}});$(window).resize(function(){if(this.blind!=null){this.blind.adjust()}});if(this.isShell)
var area=this.getWrapper();else
var area=this.getNode();$(area).css({zIndex:8000});this.container.insertBefore(this.blind,area);}}
var WIDGET_PATH=AJAX_PATH+"widget_requests.php";TabMgr=function(params)
{if(params!=null)
{this._construct(params);}}
TabMgr.prototype={_construct:function(params)
{if(params.container!=null)
this.container=params.container;else if(params.containerID)
this.container=document.getElementById(params.containerID);else
this.container=document.createElement("div");if(params.tabList!=null)
this.tabList=params.tabList;else if(params.tabListID!=null)
this.tabList=document.getElementById(params.tabListID);else
this.tabList=document.createElement("ul");objects.push(this);this.initTabs(params.tabs);},getContainer:function()
{return this.container;},getTabByID:function(id)
{return this.tabs[id];},getTabContainer:function()
{return this.tabList;},_destruct:function()
{var count=0;for(var i in this.tabs)
this.tabs[i]._destruct();for(var i in this)
{if(this[i]!=null)
{if(this[i]._destruct)
this[i]._destruct();else
this[i]=null;count++;}}
killself(this);},currentMenu:null,initTabs:function(tabs)
{var list=this.getTabContainer();for(var i in tabs)
{var tabData=tabs[i];var name=tabData.title;var item=document.createElement("li");item.className="tab-"+i;var link=document.createElement("a");var params=tabData.params;params.mgr=this;params.link=link;params.title=name;params.id=i;this.tabs[i]=eval("new "+tabData.object+"(params);");link.tab=this.tabs[i];link.handler=this;link.onclick=function()
{this.handler.displayTab(this.tab);}
link.innerHTML=name;item.appendChild(link);list.appendChild(item);}},toggleMenu:function(id)
{$(this.currentMenu).hide();$(id).show();},displayTab:function(tab)
{if(this.currentTab!==tab)
{if(this.currentTab!=null)
this.currentTab.close();$(tab.link.parentNode).addClass("sel");this.currentTab=tab;this.currentTab.display();}},currentTab:null,tabs:[]}
var PortalTab=function(param)
{if(param)
this._construct(param);}
PortalTab.prototype={_construct:function(params)
{if(params!=null)
{this.mgr=params.mgr;this.link=params.link;this.params=params;this.id=params.id;}
objects.push(this);},_destruct:function()
{if(this.content.parentNode!=null)
this.content.parentNode.removeChild(this.content);for(var i in this)
this[i]=null;},showTab:function()
{},select:function()
{},isCurrent:function()
{},close:function()
{$(this.link.parentNode).removeClass("sel");if(this.content.parentNode!=null)
this.content.parentNode.removeChild(this.content);},drawContent:function()
{var portalItem=document.createElement("div");$(portalItem).addClass("portalItem");this.content=portalItem;this.mgr.getContainer().appendChild(this.content);$(this.content).show();return this.content;},init:function()
{return this.display();},makeRequest:function(callback,params)
{params.widgetID=this.id;var request=new AjaxRequest(WIDGET_PATH,callback,params,"GET");request.makeRequest({useLoader:true,loaderParent:this.content,loaderClass:"loader_widget",append:true});return request;},display:function()
{if(this.mgr)
{var content=this.drawContent();content.innerHTML="hi. i am a portal";}}}
function ClientWidget(container)
{this.container=container;}
ClientWidget.prototype={reloadPage:function()
{window.open(window.location.href,"_self");},setClient:function(option)
{var id=option.value;var request=new AjaxRequest(AJAX_PATH+"widget_requests.php",{object:this,method:'reloadPage'},{clientID:id,action:"setClient"});request.makeRequest();},display:function()
{var request=new AjaxRequest(AJAX_PATH+"widget_requests.php",{object:this,method:'showClients'},{action:"getClients"});request.makeRequest();},showClients:function(data)
{var selector=new Selector({container:this.container,className:"selectGhost",id:"radiusGhost"},{callbackObject:this,callbackMethod:"setClient"});selector.active=false;selector.defaultOption=makeOption("-1","choose a client");for(var i in data)
{var client=data[i];selector.addOption(makeOption(client.id,client.name));}
selector.display();}}
function getWrappers()
{wrappers=[];wrappers.push({'text':'www.abc-of-rockclimbing.com','status':0});wrappers.push({'text':'www.alabama.travel','status':0});wrappers.push({'text':'www.alwaysonvacation.com','status':1});wrappers.push({'text':'www.americangolf.com','status':0});wrappers.push({'text':'www.americanwhitewater.org',"status":0});wrappers.push({'text':'www.anglerweb.com','status':0});wrappers.push({'text':'www.arizonaguide.com','status':1});wrappers.push({'text':'www.arkansas.com','status':0});wrappers.push({'text':'www.artnet.com','status':0});wrappers.push({'text':'www.aza.org',"status":1});wrappers.push({'text':'www.bachtrack.com','status':0});wrappers.push({'text':'www.bbonline.com','status':1});wrappers.push({'text':'www.bedandbreakfast.com','status':0});wrappers.push({'text':'www.bedandbreakfastnetwork.com','status':0});wrappers.push({'text':'www.bnbfinder.com','status':0});wrappers.push({'text':'www.bnbstar.com','status':0});wrappers.push({'text':'www.bostoncentral.com','status':0});wrappers.push({'text':'www.cloud9living.com','status':0});wrappers.push({'text':'www.colorado.com','status':0});wrappers.push({'text':'www.critterplaces.com','status':0});wrappers.push({'text':'www.ct.gov',"status":0});wrappers.push({'text':'www.ctvisit.com','status':1});wrappers.push({'text':'www.culturemob.com','status':0});wrappers.push({'text':'www.dirtworld.com','status':0});wrappers.push({'text':'www.discoveramerica.com','status':0});wrappers.push({'text':'www.discoverohio.com','status':0});wrappers.push({'text':'www.discoversouthcarolina.com','status':0});wrappers.push({'text':'www.enjoyillinois.com','status':1});wrappers.push({'text':'www.e-raft.com','status':1});wrappers.push({'text':'www.exploreminnesota.com','status':0});wrappers.push({'text':'www.findrentals.com','status':0});wrappers.push({'text':'www.georgia.org/foundation.htm',"status":0});wrappers.push({'text':'www.gocampingamerica.com','status':0});wrappers.push({'text':'www.gohawaii.com','status':0});wrappers.push({'text':'www.goingtothebeach.com','status':0});wrappers.push({'text':'www.golfbuzz.com','status':0});wrappers.push({'text':'www.golflink.com','status':0});wrappers.push({'text':'www.golfnow.com','status':1});wrappers.push({'text':'www.gotobus.com','status':0});wrappers.push({'text':'www.grandparents.com','status':0});wrappers.push({'text':'www.hihostels.com','status':0});wrappers.push({'text':'www.hostels.com','status':1});wrappers.push({'text':'www.iloveny.com','status':0});wrappers.push({'text':'www.infohub.com','status':1});wrappers.push({'text':'www.in.gov//visitindiana',"status":0});wrappers.push({'text':'www.jambase.com','status':1});wrappers.push({'text':'www.kentuckytourism.com','status':0});wrappers.push({'text':'www.landbigfish.com','status':0});wrappers.push({'text':'www.lanierbb.com','status':0});wrappers.push({'text':'www.louisianatravel.com','status':0});wrappers.push({'text':'www.mass.gov',"status":0});wrappers.push({'text':'www.massvacation.com','status':0});wrappers.push({'text':'www.michigan.org',"status":0});wrappers.push({'text':'www.museumca.org',"status":1});wrappers.push({'text':'www.museumsofboston.org',"status":0});wrappers.push({'text':'www.museumsusa.org',"status":0});wrappers.push({'text':'www.napavalley.com','status':0});wrappers.push({'text':'www.ndtourism.com','status':1});wrappers.push({'text':'www.newmexico.org',"status":0});wrappers.push({'text':'www.nps.gov',"status":0});wrappers.push({'text':'www.nysparks.state.ny.us',"status":0});wrappers.push({'text':'www.onthesnow.com','status':0});wrappers.push({'text':'www.opentable.com','status':1});wrappers.push({'text':'www.parksandcampgrounds.com','status':0});wrappers.push({'text':'www.parks.ca.gov',"status":0});wrappers.push({'text':'www.pedaling.com','status':1});wrappers.push({'text':'www.playbill.com','status':0});wrappers.push({'text':'www.priceline.com','status':0});wrappers.push({'text':'www.railstotrails.org',"status":0});wrappers.push({'text':'www.reserveamerica.com','status':0});wrappers.push({'text':'www.roadsideamerica.com','status':0});wrappers.push({'text':'www.rotor.com','status':0});wrappers.push({'text':'www.snocountry.com','status':0});wrappers.push({'text':'www.spaemergency.com','status':0});wrappers.push({'text':'www.spafinder.com','status':1});wrappers.push({'text':'www.state.me.us',"status":0});wrappers.push({'text':'www.state.nj.us',"status":1});wrappers.push({'text':'www.swimmersguide.com','status':0});wrappers.push({'text':'www.swimmingholes.org',"status":0});wrappers.push({'text':'www.theatermania.com','status':0});wrappers.push({'text':'www.thegolfcourses.net',"status":0});wrappers.push({'text':'www.thetrustees.org',"status":0});wrappers.push({'text':'www.thinkrentals.com','status':0});wrappers.push({'text':'www.tnvacation.com','status':0});wrappers.push({'text':'www.tourism.wa.gov',"status":1});wrappers.push({'text':'www.travelalaska.com','status':0});wrappers.push({'text':'www.traveliowa.com','status':0});wrappers.push({'text':'www.travelks.com','status':0});wrappers.push({'text':'www.travelok.com','status':0});wrappers.push({'text':'www.travelsd.com','status':1});wrappers.push({'text':'www.traveltex.com','status':0});wrappers.push({'text':'www.trustedtours.com','status':1});wrappers.push({'text':'www.unitedstatestours.us',"status":0});wrappers.push({'text':'www.usms.org',"status":1});wrappers.push({'text':'www.utah.com','status':1});wrappers.push({'text':'www.vacationhomerentals.com','status':0});wrappers.push({'text':'www.vacationrealty.com','status':0});wrappers.push({'text':'www.vermontvacation.com','status':0});wrappers.push({'text':'www.viator.com','status':1});wrappers.push({'text':'www.viptickets.com','status':0});wrappers.push({'text':'www.virginia.org',"status":1});wrappers.push({'text':'www.visitcalifornia.com','status':0});wrappers.push({'text':'www.visitdelaware.com','status':0});wrappers.push({'text':'www.visitflorida.com','status':0});wrappers.push({'text':'www.visitidaho.org',"status":0});wrappers.push({'text':'www.visitmaine.com','status':0});wrappers.push({'text':'www.visitmaryland.org',"status":0});wrappers.push({'text':'www.visitmississippi.org',"status":0});wrappers.push({'text':'www.visitnebraska.org',"status":0});wrappers.push({'text':'www.visitnh.gov',"status":1});wrappers.push({'text':'www.visitpa.com','status':1});wrappers.push({'text':'www.visitrhodeisland.com','status':0});wrappers.push({'text':'www.vtstateparks.com','status':1});wrappers.push({'text':'www.washington.org',"status":0});wrappers.push({'text':'www.wayspa.com','status':0});wrappers.push({'text':'www.whatsonwhen.com','status':0});wrappers.push({'text':'www.wine.com','status':0});wrappers.push({'text':'www.winerybound.com','status':1});wrappers.push({'text':'www.worldgolf.com','status':1});wrappers.push({'text':'www.wvtourism.com','status':1});wrappers.push({'text':'www.yelp.com','status':0});wrappers.push({'text':'www.zvents.com','status':1});return wrappers;}
var MapLoader={initialized:false,loaded:false,threads:[],extras:[],callback:"_activateMap",runThread:function(thread)
{if(thread.object!=null)
thread.object[thread.method]();else if(thread.method)
eval(thread.method+"()");},addExtra:function(src)
{this.extras.push(src);},_activateMap:function()
{try
{if(typeof mapCtrl!="undefined")
{this.loaded=true;while(this.threads.length>0)
this.runThread(this.threads.pop());}
else
{setTimeout("MapLoader._activateMap()",150);}}
catch(e)
{}},init:function()
{if(!this.initialized)
{Goby.get("scriptLoader").importFile(GOOGLE_API_URL,{remote:true,inline:false});if(GOOGLE_API_URL_TWO!=null)
Goby.get("scriptLoader").importFile(GOOGLE_API_URL_TWO,{remote:true,inline:false});this.initialized=true;}},loadMap:function(thread)
{if(!this.loaded)
{this.threads.push(thread);this.init();}
else
{this.runThread(thread);}},capture:function()
{if(!Goby.has("scriptLoader"))
return false;var scriptLoader=Goby.get("scriptLoader");scriptLoader.importFile(JS_PATH+"/lib/googlemaps/",{callback:{object:this,method:this.callback},remote:true});while(this.extras.length>0)
scriptLoader.importFile(this.extras.pop(),{remote:true,inline:false});}}
if(this.objects)
this.objects.push(MapLoader);function _googleMapCallback(){document.mapLoader.capture();}
breadType={'CAT':'category','LOC':'location'}
TYPE_CATEGORY=breadType.CAT;TYPE_LOCATION=breadType.LOC;Breadcrumb=function(params,mgr)
{var node=document.createElement("li");var link=document.createElement("a");link.innerHTML=params.label.toLowerCase();link.href="#_breadcrumb";for(var i in this)
node[i]=this[i];node.mgr=mgr;objects.push(this);objects.push(node);if(params.type==breadType.LOC)
node.loc_type=params.loc_type;node.label=params.label;node.node_id=params.id;node._type=params.type;node.appendChild(link);node.init();node.link=link;return node;}
Breadcrumb.prototype={remove:function()
{if(this.child!=null)
this.child.remove();if(this.mgr.isCurrent(this))
this.mgr.setCurrent(this.parent);if(this.parentNode)
this.parentNode.removeChild(this);this.parent.makeChild();this.parent.child=null;},makeChild:function()
{if(this.link2!=null)
{this.removeChild(this.link2);this.link2=null;}},addChild:function(node)
{if(this.child!=null)
this.child.remove();if(node!="dummy")
{this.child=node;this.child.parent=this;}
if(this.link2==null)
{var link2=document.createElement("span");$(link2).addClass("link");link2.innerHTML="<small>&gt;</small>";this.appendChild(link2);this.link2=link2;}},setFirst:function()
{$(this).addClass("first");},init:function()
{this.onmouseover=function()
{if(this._type==breadType.CAT)
{var location=this.mgr.getCurrent(breadType.LOC);var data={locationName:location.label,locationID:location.node_id,locationType:location.loc_type,categoryName:this.label,categoryID:this.node_id,type:"search"}
this.link.searchLink=new SearchLink(data,this.link);this.link.onclick=function()
{this.href="#";this.searchLink.open();}}
else if(this._type==breadType.LOC)
{this.mgr.getCurrent(breadType.CAT);var data={locationName:this.label,locationID:this.node_id,locationType:this.loc_type,type:"location"}
this.link.href=getFormattedUrl(data,'location');}}},getChild:function()
{return this.child;},getParent:function()
{return this.parent;}}
BreadcrumbMgr=function(params)
{var node=document.getElementById("breadcrumbs");node.innerHTML='';this.count=0;objects.push(this);objects.push(node);for(var i in this)
node[i]=this[i];return node;}
BreadcrumbMgr.prototype={data:[],hasCategories:true,hasLocations:true,index:{"location":{},"category":{}},currentNode:{"location":null,"category":null},getCurrent:function(type)
{return this.currentNode[type];},setCurrent:function(node)
{this.currentNode[node._type]=node;},isCurrent:function(node)
{if(this.currentNode[node._type]===node)
return true;else
return false;},add:function(data)
{this.count++;(this.count>1?$(this).show():$(this).hide());var type=data.type;var dummy="dummy";if(this.index[type][data.id]!=null)
{var mynode=this.index[type][data.id];if(mynode.child!=null)
mynode.child.remove();return mynode;}
var bc=new Breadcrumb(data,this);if((data.parent!=null)&&(this.index[type][data.parent]!=null))
this.index[type][data.parent].addChild(bc);else if(this.currentNode[type]!=null)
this.currentNode[type].addChild(bc);if(bc.parent)
$(bc).insertAfter(bc.parent);else
{if((bc._type==TYPE_CATEGORY)&&(this.hasLocations))
{}
else
{bc.setFirst();}
this.appendChild(bc);}
if((bc._type==TYPE_LOCATION)&&(this.hasCategories))
bc.addChild(dummy);this.index[type][data.id]=bc;this.setCurrent(bc);return bc;},remove:function()
{}}
var ieVALID=true;function generateFlashMovie(src,params)
{if(DetectFlashVer(8,0,0))
{var myNode=document.createElement("object");var _embed=document.createElement("embed");myNode.setAttribute("width",params.width);myNode.setAttribute("data",src);myNode.setAttribute("height",params.height);for(var p in params)
{var param=document.createElement("param");param.setAttribute("name",p);param.setAttribute("value",params[p]);_embed.setAttribute(p,params[p]);myNode.appendChild(param);}
_embed.setAttribute("type","application/x-shockwave-flash");_embed.setAttribute("src",src);_embed.setAttribute("allowscriptaccess","always");var containerNode=document.createElement("div");containerNode.appendChild(myNode);containerNode.valid=true;return containerNode;}
else
{var myNode=document.createElement("div");myNode.valid=false;myNode.innerHTML="<p>This content requires the Adobe Flash Player.<br /><a href=\"http://www.adobe.com/go/getflash/\">Get Flash</a></p>";return myNode;}}
function loadFlashMovie(id,src,params)
{var container=document.getElementById(id);var node=generateFlashMovie(src,params);if(navigator.isIE()&&(node.valid))
{container.innerHTML='<object id="ie_fix" width="'+params.width+'" height="'+params.height+'">'+'<param name="movie" value="'+src+'"></param>'+'<param name="allowFullScreen" value="true"></param>'+'<param name="allowscriptaccess" value="always"></param>'+'<param value="transparent" name="wmode"></param>'+'<embed src="'+src+'"  wmode="transparent" bgcolor="#FFFFFF" flashVars="videoGUID={12D22860-B5A9-4AF8-8FE9-B112911EFF20}&playerid=1000&plyMediaEnabled=1&configURL=http://wsj.vo.llnwd.net/o28/players/&autoStart=false" base="http://s.wsj.net/media/swf/" name="flashPlayer" width="'+params.width+'" height="'+params.height+'" seamlesstabbing="false" type="application/x-shockwave-flash" swLiveConnect="true" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>'+'</object>';}
else
{container.appendChild(node);}}