function $(a){return document.getElementById(a)}function Utility(){var b=null,a=this,d=[],c=[];a.URLEncodednewLine="%250A";a.WebserverPath;a.ImagePath;var f="/DetailsPage.aspx",e="http://maps.live.com/";a.LoadAll=function(){var a;for(a=0;a<c.length;a++){var f=c[a];f.Load()}for(a=0;a<d.length;a++){var e=d[a];e()}d=b;c=b;c=[]};a.AddFunction=function(a){d.push(a)};a.AddObject=function(a){c.push(a)};a.GetDetailsPageURL=function(a){return this.WebserverPath+f+"?ypid="+a};a.GetDrivingDirectionURL=function(g,h,i,d,b,c,f){var a="pos."+h+"_"+i+"_"+escape(b)+"_"+escape(d)+"_"+c+"_e_"+g;if(f)return e+"?rtp="+a+"~";else return e+"?rtp=~"+a};a.escapeSingleQuote=function(a){return a.replace("'","\\'")};a.getXML=function(d){var a=b;try{a=new ActiveXObject("Microsoft.XMLDOM");a.async="false";a.loadXML(d);return a}catch(c){try{parser=new DOMParser;a=parser.parseFromString(d,"text/xml");return a}catch(c){alert(c.message)}}};a.getEvent=function(a){var d=new CGEvent,c;if(!a)a=window.event;if(a.target)c=a.target;else if(a.srcElement)c=a.srcElement;if(c&&c.nodeType==3)c=c.parentNode;if(c&&c.id){d.EventType=CityGuidesEventType.DOMEvent;d.EventTargetID=c.id;d.Event=a}else if(a.elementID){d.EventType=CityGuidesEventType.VEEvent;d.EventTargetID=a.elementID;d.Event=a}else return b;return d}}var CGUtility=new Utility,CityGuidesEventType={NoEvent:0,DOMEvent:1,VEEvent:2,AJAXEvent:3};function CGEvent(){this.EventType=CityGuidesEventType.NoEvent;this.EventTargetID;this.Event}function CGMap(){var e="undefined",a=null,c=this,b,k,f=a,h=a,n=a,m=false,d=a,j=0,g=13,i=a;c.pushpinobjects=[];var l=false;c.Load=function(){if(typeof VEMap==e){if(!l){downloadjs("http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2",CityGuidesMap.LoadMap);l=true}}else this.LoadMap()};c.LoadMap=function(){if(h!=a||h!=undefined)f=new VELatLong(h,n);if(!b){b=new VEMap(k);if(i!=a)b.onLoadMap=i;b.LoadMap(f)}var c=0;if(this.pushpinobjects)for(c=j;c<this.pushpinobjects.length;c++){var l=this.pushpinobjects[c];b.AddShape(l.GetPushpinObject(c));if(!d)d=[];d.push(l.GetPushpinCenter())}j=c;if(m&&d!=a&&typeof d!=e){b.SetMapView(d);if(b.GetZoomLevel()>g)b.SetZoomLevel(g)}};c.setOnLoadMapEvent=function(a){i=a};c.AttachEvent=function(c,a){b.AttachEvent(c,a)};c.DetachEvent=function(c,a){b.DetachEvent(c,a)};c.GetMapObject=function(){return b};c.AddPushpin=function(a){if(!this.pushpinobjects)this.pushpinobjects=[];this.pushpinobjects.push(a)};c.SetMap=function(f,b,d,c){k=f;if(b!=a&&b!=e&&b!=""){h=b;n=d}if(c)m=c;CGUtility.AddObject(CityGuidesMap)};c.SetMapCenter=function(a){f=a};c.SetZoomLevel=function(a){b.SetZoomLevel(a)};c.SetCenterAndZoom=function(c,a){b.SetCenterAndZoom(c,a)};c.ClearAllPins=function(){var c=this;if(c.pushpinobjects!=a){var d;for(d=0;d<c.pushpinobjects.length;d++)if(c.pushpinobjects[d]!=a&&c.pushpinobjects[d].GetElementID!=undefined&&c.pushpinobjects[d].GetElementID!=a&&c.pushpinobjects[d].GetElementID()!=a&&$(c.pushpinobjects[d].GetElementID())!=a)$(c.pushpinobjects[d].GetElementID()).arrayIndex=a}b.Clear();c.ClearLatLongsForBestView();c.pushpinobjects=a;j=0;if(f)b.SetCenter(f);if(typeof showTraffic!=e&&showTraffic!=a&&showTraffic==1)ShowTraffic()};c.ClearLatLongsForBestView=function(){d=a};c.SetMapView=function(f){if(d!=a)b.SetMapView(d);else if(this.pushpinobjects!=a){var e=[];for(var c=0;c<this.pushpinobjects.length;c++)e.push(this.pushpinobjects[c].GetPushpinCenter());b.SetMapView(e)}if(!f&&b.GetZoomLevel()>g)b.SetZoomLevel(g)}}var CityGuidesMap=new CGMap;function CGPushpin(e,f,c,g,d,b){var a;this.GetPushpinObject=function(){if(a)return a;a=new VEShape(VEShapeType.Pushpin,this.GetPushpinCenter());if(b){var e='<div style="width:60px;height:60px;float:left;">';e+='<a href="#" onclick="window.open(\''+b+"', '_blank' , 'menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,width=800,height=600,screenX=200,left=200,screenY=200,top=200');return false;\">";e+='<img src="'+b+'" height="60" width="60" onerror="this.parentNode.parentNode.style.display=\'none\';" onload="resize(this,60,60);"/></a></div>';c=e+c}a.SetTitle(c);a.SetDescription(g);if(d)a.SetCustomIcon(d);return a};this.GetPushpinCenter=function(){if(e!=null&&f!=null)return new VELatLong(e,f);return null}}function AjaxRequest(f,e,g,h,b,c){var a;try{a=new XMLHttpRequest}catch(d){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(d){try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(d){a=false}}}this.Send=function(){if(!a){b();return}if(c==null||c==AjaxSyncType.Async)a.open(e,f,true);else a.open(e,f,false);a.setRequestHeader("Content-Type","application/x-www-form-urlencoded");a.onreadystatechange=this.ParseResponse;a.send(g);if(c==AjaxSyncType.Sync)this.ParseResponse()};this.ParseResponse=function(){if(a.readyState==AjaxResponseState.Loaded&&a.status==HTTPStatus.Ok)if(h==AjaxResponseType.Text)b(a.responseText);else b(a.responseXML)}}var AjaxRequestType={GET:"GET",POST:"POST"},AjaxResponseState={Uninitialized:0,Open:1,Sent:2,Receiving:3,Loaded:4},HTTPStatus={Ok:200,NotFound:404},AjaxResponseType={Xml:0,Text:1},AjaxSyncType={Async:true,Sync:false};function resize(a,c,d){var b="px";if(!c)c=60;if(!d)d=60;var h=new Image;h.src=a.src;var f=parseInt(h.width),e=parseInt(h.height);if(e<c&&f<d){a.style.height=e+b;a.style.width=f+b;a.style.marginTop=c/2-e/2+b;a.style.marginBottom=c/2-e/2+b;a.style.marginLeft=d/2-f/2+b;a.style.marginRight=d/2-f/2+b}else if(e/c>f/d){a.style.height=c+b;var i=f*c/e;a.style.width=i+b;a.style.marginLeft=d/2-i/2+b;a.style.marginRight=d/2-i/2+b}else{a.style.width=d+b;var g=e*d/f;a.style.height=g+b;a.style.marginTop=c/2-g/2+b;a.style.marginBottom=c/2-g/2+b}}function GetBusinessDescription(g,l,m,f,k,h,i,a){var b='<a href="',c="";if(f)c='<div id="hover_image"><img src="'+f+'" width="102" height="75" align="right"/></div>';var d=g,e="";if(a){e=b+a+'">More information</a><br />';d=b+a+'">'+g+"</a>"}var j='<div id="map_hover_container" onmouseover="clearInterval(g_HideInfoBoxTimeoutId);">    \t '+c+'<div id="hover_title"><strong>'+d+"</strong><br />"+k+'</div>    \t<div id="hover_text"><br/>'+l+"<br />"+m+'</div>                <div id="hover_footer">'+e+'Contribute: <a href="'+h+'">Write review</a> | <a href="'+i+'">Upload photo</a>        </div>  </div> </div>';return j}function CGUtilityGetWriteReviewUrl(a,b){return a+"?ypid="+b+"&rrbtnwr=1"}function CGUtilityGetBDPUrl(a,b){return a+"?ypid="+b+"&iscanned=true"}function CGUtilityGetIcon(a){return '<span class="map_list_item_pin"  id="pushpin'+a+'" >'+a+"</span>"}function CGUtilityGetPhotoUploadUrl(a,d,c,b){return a+"?latitude="+d+"&longitude="+c+"&name="+b}function CGUtilityGetPhotoUploadPageUrlWithYpId(a,b){return a+"?ypid="+b}var TextUtility={GetInnerTextForHTML:function(b){var a=document.createElement("span");if(a.innerText!=undefined)a.innerText=b;else a.textContent=b;return a.innerHTML.replace(/<((br)|(BR))(\/)?>/g," ")},GetTruncatedText:function(f,c,d){var e="...";f.innerHTML='<span id="ellipsisSpan" style="white-space:nowrap;border:0px;padding:0px;margin:0px"/>';var a=$("ellipsisSpan");a.innerHTML=c;if(a.offsetWidth>d){var b=Math.round(c.length*(d/a.offsetWidth));a.innerHTML=c.substr(0,b)+e;if(a.offsetWidth>d)while(a.offsetWidth>d&&b>0){b--;a.innerHTML=c.substr(0,b)+e}else if(a.offsetWidth<d){while(a.offsetWidth<d&&b<c.length){b++;a.innerHTML=c.substr(0,b)+e}if(a.offsetWidth>d)b--}f.innerHTML="";return c.substr(0,b)+e}f.innerHTML="";return c}};function downloadjs(c,b){var d=document.getElementsByTagName("HEAD")[0],a=document.createElement("script");a.type="text/javascript";if(b){a.onreadystatechange=function(){if(a.readyState=="loaded"||a.readyState=="complete")b()};a.onload=b}a.src=c;d.appendChild(a)}var infoboxInUse=false;function infoboxHovered(){infoboxInUse=true}function infoboxLeft(){infoboxInUse=false}function IsInfoBoxShown(){return ero.isVisible()}function IsInfoBoxInUse(){return infoboxInUse}function IsEventBubble(a){if(!a)a=window.event;var b;if(a.target)b=a.target;else if(a.srcElement)b=a.srcElement;if(b&&b.nodeType==3)b=b.parentNode;var c;if(a.type=="mouseover"){c=a.relatedTarget||a.fromElement;if(IsChild(b,c))return true}if(a.type=="mouseout"){c=a.relatedTarget||a.toElement;if(IsChild(b,c))return true}return false}function IsChild(d,c){if(d==null||c==null)return false;var a=d.childNodes;if(a==null)return false;for(var b=0;b<a.length;b++){if(a[b]==c)return true;if(IsChild(a[b],c))return true}return false}