var g_do=document,g_currFeaId=1,g_CurrSqrTab=0,g_CurrSqrHTML,g_currSlide=1,g_maxSlInd=0,g_clrTime,g_isPlay=1,g_msgLoc,g_pushpinImage,g_pinHoverImage,g_CurrTopTabName="Rest",g_CurrTopTab=2;function ShowNeighbor(b){var a="Neigh";if(b!=g_currId){var c=g_do.getElementById(a+b).className;g_do.getElementById(a+b).className=g_do.getElementById(a+g_currId).className;g_do.getElementById(a+g_currId).className=c;g_currId=b}}function ShowFeature(a){var b="FeatureTab",c="FeatureLink";if(a!=g_currFeaId){var g,f,i=g_do.getElementById(c+a),h=g_do.getElementById(c+g_currFeaId),e=i.getElementsByTagName("a"),d=h.getElementsByTagName("a");g=e[0].id;e[0].id=d[0].id;d[0].id=g;f=g_do.getElementById(b+a).className;g_do.getElementById(b+a).className=g_do.getElementById(b+g_currFeaId).className;g_do.getElementById(b+g_currFeaId).className=f;g_currFeaId=a}}function HideDropDown(b){var a;if(window.event)a=window.event.srcElement;else if(b)a=b.target;if(a.id!="drpanc"){ShowDropDown(g_CurrSqrTab);document.detachEvent("onmouseup",HideDropDown)}}function ShowDropDown(a){var b="SquareTab";if(g_CurrSqrTab!=0)g_do.getElementById(b+g_CurrSqrTab).parentNode.innerHTML=g_CurrSqrHTML;if(g_CurrSqrTab!=a){g_CurrSqrHTML=g_do.getElementById(b+a).parentNode.innerHTML;g_do.getElementById(b+a).parentNode.innerHTML+=g_do.getElementById("drpdwn").innerHTML;g_CurrSqrTab=a;document.attachEvent("onmousedown",HideDropDown)}else{g_CurrSqrTab=0;g_CurrSqrHTML=""}}function OnChange(d){var f=g_CurrSqrTab,a=GetCookie("Square");if(a!=""){var c=a.split("||");a="";var b;for(b=0;b<c.length;b++){var g=c[b].split("^^");if(g[0]!=f)a=a+c[b]+"||"}}if(!(d=="default"&&a==""))if(d=="default"&&a!="")a=a.substr(0,a.length-2);else a=a+f+"^^"+d;var e=new Date;e.setDate(e.getDate()+365);document.cookie="Square="+a+"; expires="+e.toUTCString()+"; path=/;";location.href=location.href}function GetCookie(d){var c="",a,b;if(document.cookie.length>0){a=document.cookie.indexOf(d+"=");if(a!=-1){a=a+d.length+1;b=document.cookie.indexOf(";",a);if(b==-1)b=document.cookie.length;c=unescape(document.cookie.substring(a,b))}}return c}function ShowTop(a){var b="TopTab";if(g_CurrTopTab!=a){g_isPlay=1;if(g_currSlide!=1)DisplaySlide(1);else ShowControlRLP();clearInterval(g_clrTime);var d=g_do.getElementById(b+a).className;g_do.getElementById(b+a).className=g_do.getElementById(b+g_CurrTopTab).className;g_do.getElementById(b+g_CurrTopTab).className=d;g_do.getElementById("On"+g_CurrTopTab).className=g_do.getElementById("On"+a).className;g_do.getElementById("On"+a).className="";g_do.getElementById("Off"+a).className=g_do.getElementById("Off"+g_CurrTopTab).className;g_do.getElementById("Off"+g_CurrTopTab).className="";g_CurrTopTabName=a==2?"Rest":"Night";g_CurrTopTab=a;var c=new Date;c.setDate(c.getDate()+365);document.cookie="RLPTopSelectedTab="+g_CurrTopTab+"; expires="+c.toUTCString()+"; path=/;";g_maxSlInd=g_do.getElementById("Total"+g_CurrTopTabName).value;if(CityGuidesMap.GetMapObject())CityGuidesMap.ClearAllPins();DisplayRLPPushpins()}}function Play(){if(g_isPlay==0){g_isPlay=1;IncrementId()}g_clrTime=setInterval(function(){StartRotate()},g_rotatetime)}function StartRotate(){IncrementId()}function Pause(){g_isPlay=0;ShowControlRLP();clearInterval(g_clrTime)}function MoveNext(){Pause();IncrementId()}function MovePrevious(){Pause();DecrementId()}function IncrementId(){var a=g_currSlide+1;if(a>g_maxSlInd)a=1;DisplaySlide(a)}function DecrementId(){var a=g_currSlide-1;if(a<1)a=g_maxSlInd;DisplaySlide(a)}function DisplaySlide(a){if(a!=g_currSlide){g_do.getElementById(g_CurrTopTabName+a).style.display="block";g_do.getElementById(g_CurrTopTabName+g_currSlide).style.display="none";var b=RLPIconHTML(a,g_pinHoverImage);CityGuidesMap.pushpinobjects[a-1].GetPushpinObject().SetCustomIcon(b);if(g_do.getElementById("Pin"+g_CurrTopTabName+a)==null)CityGuidesMap.GetMapObject().SetCenter(CityGuidesMap.pushpinobjects[a-1].GetPushpinCenter());b=RLPIconHTML(g_currSlide,g_pushpinImage);CityGuidesMap.pushpinobjects[g_currSlide-1].GetPushpinObject().SetCustomIcon(b);g_currSlide=a;ShowControlRLP()}}function ShowControlRLP(){var e=g_do.getElementById(g_CurrTopTabName+g_currSlide),d,c,b=e.getElementsByTagName("div"),a=0;for(a=0;a<b.length;a++)if(b[a].id=="Play")d=b[a];else if(b[a].id=="Pause")c=b[a];if(g_isPlay==0){d.style.display="block";c.style.display="none"}else{c.style.display="block";d.style.display="none"}}function LoadMapForRLP(){if(g_TabShow=="1"){g_CurrTopTabName="Night";g_CurrTopTab=1}else{g_CurrTopTabName="Rest";g_CurrTopTab=2}var a=g_do.getElementById("Total"+g_CurrTopTabName);if(a){g_rotatetime=g_rotatetime*1e3;g_pushpinImage=g_do.getElementById("PushPin").value;g_pinHoverImage=g_do.getElementById("PushPinHover").value;g_maxSlInd=a.value;CityGuidesMap.SetMap("slider_map");CityGuidesMap.Load();DisplayRLPPushpins()}else g_do.getElementById("landing_slider_container").style.display="none"}function DisplayRLPPushpins(){if(CityGuidesMap.GetMapObject()!=null){AddPushPinRLP();Play()}else window.setTimeout("DisplayRLPPushpins();",1e3)}function RLPIconHTML(a,b){return "<img onmouseover='PinHover(this,"+a+");' id='Pin"+g_CurrTopTabName+a+"' src='"+b+"'/>"}function AddPushPinRLP(){var e="text_list2",c,b,d;for(b=1;b<=g_maxSlInd;b++){var h=g_do.getElementById(g_CurrTopTabName+"Map"+b).value,a=h.split("^"),i=b==1?g_pinHoverImage:g_pushpinImage;d=RLPIconHTML(b,i);var g='<img src="'+a[7]+'"/>',f=CGUtilityGetPhotoUploadPageUrlWithYpId(a[9],a[0]);c=new CGBusinessPushpin4(a[1],a[2],escape(a[3]),escape(a[4]),a[5],d,a[6],g,a[8]+"&amp;rrbtnwr=1#writeReview",f,a[8],null,e,e,b-1);CityGuidesMap.AddPushpin(c);CityGuidesMap.GetMapObject().AddShape(c.GetPushpinObject(b-1))}CityGuidesMap.SetMapView()}function PinHover(b,a){Pause();b.src=g_pinHoverImage;if(g_currSlide!=a)DisplaySlide(a)}function RLPRedirect(a){location.href=a}function RLPAddToCollection(d,a,e){g_msgLoc=e;UpdateMsg("");if(a!="0"&&a!="1"){var c="RLPStubPage.aspx?queryType="+escape(d)+"^"+escape(a),b=new AjaxRequest(c,AjaxRequestType.GET,null,AjaxResponseType.Text,RLPCallBack);b.Send()}else if(a=="1")location.href=g_do.getElementById("CreateColl").value}function UpdateMsg(b){var a;switch(g_msgLoc){case 1:a="text_prompt";break;case 2:a="beenmsg";break;case 3:a="planmsg"}g_do.getElementById(a).innerHTML=b}function RLPCallBack(a){UpdateMsg(a)}function GetQueryStringURL(d){var e=window.location.search.substring(1),c=e.split("&");for(var a=0;a<c.length;a++){var b=c[a].split("=");if(b[0]==d)return b[1]}return null}