function Details(){}Details.Address=null;Details.Items=new System.Collections.ArrayList();Details.Position=undefined;Details.Panel=null;Details.Clear=function(){FreshLogicStudios.Atlas.Items.Clear(Details.Items);Details.Panel.SetBody("");Details.Address=null};Details.Initialize=function(){var a="<div>";a+='<form name="DetailsForm" action="about:blank" method="get" target="hiddenframe" onsubmit="Details.Search(this.Where.value); return false;">';a+="<label>Where: Address, city or landmark</label>";a+='<input type="text" name="Where" value="'+System.Configuration.Settings.Defaults.DefaultWhere+"\" onfocus=\"if(this.value == System.Configuration.Settings.Defaults['DefaultWhere']){this.value='';} else{this.select();}\" onblur=\"if(this.value==''){this.value=System.Configuration.Settings.Defaults['DefaultWhere'];}\" /><br />";a+='<button class="Button" type="submit" name="submit" value="Search">Search</button>';a+="</form>";a+="</div>";Details.Panel=new Panel("_Details");Details.Panel.SetIcon("/Basic/Details/Details.png");Details.Panel.SetTitle("Details");Details.Panel.SetHeader(a);Details.Panel.SetHeaderHeight(60);Details.Panel.SetSize(new System.Drawing.Size(250,"auto"));Details.Panel.Minimize(false);Details.Panel.Events.Add(new System.Event("Closed",Details.Clear));try{pageTracker._trackEvent("Details","Open")}catch(b){}};Details.OnGetAmbiguousPlacesComplete=function(b){if(b.length==1){Details.Address=b[0].Address;Details.Search(new VELatLong(b[0].Position.Latitude,b[0].Position.Longitude))}else{var a='<div class="PanelBodyHeader">';a+='<div class="Summary">';a+="Did you mean?";a+="</div>";a+="</div>";a+="<ul>";for(var c=0;c<b.length;c++){a+='<li><a href="#" onclick="document.DetailsForm.Where.value = \''+b[c].Address.replace(/\'/g,"\\'")+"'; Details.Search(new VELatLong("+b[c].Position.Latitude+","+b[c].Position.Longitude+')); return false;">'+b[c].Address+"</a></li>"}a+="</ul>";Details.Panel.SetBody(a)}};Details.OnReverseGeocodeComplete=function(d){document.DetailsForm.Where.value=d;var b=System.String.Format("Latitude: {0}<br />Longitude: {1}",Details.Position.Latitude,Details.Position.Longitude);var c=new FreshLogicStudios.Atlas.Item(d,b,b,Details.Position,Pushpin.GetNextColor(),1);Details.Items.Add(c);c.ShowPushpin();c.ShowContextMenu();c.Center();Details.Panel.SetBody(FreshLogicStudios.Atlas.Items.GetSidebarHtml(Details.Items));var a=new Sys.Net.WebRequest();a.set_url(System.String.Format("/Features/Wikipedia/Wikipedia.ashx?Latitude={0}&Longitude={1}",Details.Position.Latitude,Details.Position.Longitude));a.add_completed(Details.OnWikipediaWebRequestComplete);a.invoke()};Details.OnWikipediaWebRequestComplete=function(b){if(b.get_statusCode()==200){var c=b.get_xml().getElementsByTagName("item");if(c.length>0){var d=(c[0].getElementsByTagName("description")[0].firstChild)?c[0].getElementsByTagName("description")[0].firstChild.data:"";var a=(c[0].getElementsByTagName("title")[0].firstChild)?c[0].getElementsByTagName("title")[0].firstChild.data:"";Details.Panel.SetBody(System.String.Format("<p><strong>{1}</strong><br />{2}</p>{0}",Details.Panel.GetBody(),a,d))}}};Details.Populate=function(b){var a=Details.Address;Details.Clear();Details.Position=b;if(Details.Position!=undefined){Details.Panel.SetBody("Loading...");if(!a){FreshLogicStudios.Atlas.Web.WebService.ReverseGeocode(Details.Position.Latitude,Details.Position.Longitude,Details.OnReverseGeocodeComplete)}else{Details.OnReverseGeocodeComplete(a)}}};Details.Search=function(a){if(typeof(a)=="string"){document.DetailsForm.Where.value=a;if(a==System.Configuration.Settings.Defaults.DefaultWhere){Details.Populate(map.GetCenter())}else{FreshLogicStudios.Atlas.Web.WebService.GetAmbiguousPlaces(a,Details.OnGetAmbiguousPlacesComplete)}}else{Details.Populate(a)}};Details.ShowPanel=function(){if(Sidebar.Contains("_Details")){Details.Panel.Maximize(true)}else{if(Details.Panel==null){Details.Initialize()}Sidebar.Add(Details.Panel)}};function Directions(){}Directions.StartPosition=undefined;Directions.EndPosition=undefined;Directions.Route=null;Directions.Pushpins=new Array();Directions.Panel=null;Directions.Clear=function(){Directions.ClearRoute();Directions.StartPosition=undefined;Directions.EndPosition=undefined;document.getElementById("DirectionsStart").value="";document.getElementById("DirectionsEnd").value="";Directions.Route=null};Directions.ClearPushpins=function(){map.RemovePushpins(Directions.Pushpins);Directions.Panel.SetBody("")};Directions.ClearRoute=function(){Directions.ClearPushpins();map.DeleteRoute()};Directions.Email=function(){var b=new System.Uri(window.location.href);var c=(Directions.Route.StartLocation.Address==""?"Start":Directions.Route.StartLocation.Address);var a=(Directions.Route.EndLocation.Address==""?"End":Directions.Route.EndLocation.Address);var d=System.String.Format("Directions from {0} to {1}",c,a);var f=System.String.Format("Atlas - powered by Fresh Logic Studios\n\n{0}://{1}/{2}",b.GetScheme(),b.GetAuthority(),Directions.GetQueryString());var e=System.String.Format("mailto:?subject={0}&body={1}",d,f);document.location.href=encodeURI(e)};Directions.FindStartLocationCallback=function(a,c,b,d){Directions.OnFindLocationComplete(b,"DirectionsStart")};Directions.FindEndLocationCallback=function(a,c,b,d){Directions.OnFindLocationComplete(b,"DirectionsEnd")};Directions.GetDirections=function(){if(map.GetMapStyle()==VEMapStyle.Birdseye){map.SetMapStyle(VEMapStyle.Hybrid)}var a=document.getElementById("DirectionsStart").value;var b=document.getElementById("DirectionsEnd").value;Directions.SetStart(a,(a=="Start"?Directions.StartPosition:null));Directions.SetEnd(b,(b=="End"?Directions.EndPosition:null));Directions.GetDirectionsWorker()};Directions.GetDirectionsWorker=function(){if(Directions.StartPosition==undefined){if(document.getElementById("DirectionsStart").value!=""){Directions.Panel.SetBody("Loading...");map.Find(null,document.getElementById("DirectionsStart").value,null,null,null,null,false,false,false,false,Directions.FindStartLocationCallback)}else{map.ShowMessage("Please specify a start location")}}else{if(Directions.EndPosition==undefined){if(document.getElementById("DirectionsEnd").value!=""){Directions.Panel.SetBody("Loading...");map.Find(null,document.getElementById("DirectionsEnd").value,null,null,null,null,false,false,false,false,Directions.FindEndLocationCallback)}else{map.ShowMessage("Please specify an end location")}}else{var a=new VERouteOptions();a.RouteCallback=Directions.OnGetRouteComplete;a.RouteColor=new VEColor(0,0,0,0.75);a.RouteWeight=2;a.ShowDisambiguation=false;a.ShowErrorMessages=false;a.UseTraffic=true;Directions.Panel.SetBody("Loading...");map.GetDirections(new Array(Directions.StartPosition,Directions.EndPosition),a)}}};Directions.GetQueryString=function(){var a="?rtp=";if(Directions.Route.StartLocation.Address==""||Directions.Route.StartLocation.Address=="Start"){a+="pos."+Directions.Route.StartLocation.Latitude+"_"+Directions.Route.StartLocation.Longitude+"_Start"}else{a+="adr."+encodeURIComponent(Directions.Route.StartLocation.Address)}a+="~";if(Directions.Route.EndLocation.Address==""||Directions.Route.EndLocation.Address=="End"){a+="pos."+Directions.Route.EndLocation.Latitude+"_"+Directions.Route.EndLocation.Longitude+"_End"}else{a+="adr."+encodeURIComponent(Directions.Route.EndLocation.Address)}return a};Directions.Initialize=function(){Directions.ContextMenus=new ContextMenuCollection();b();a();function a(){var g=new System.Uri(window.location.href);var e=g.GetQueryParameters();if(e.rtp){Directions.ShowPanel();var f=e.rtp.split("~");if(f[0]){if(f[0].search("\\badr.")==0){Directions.SetStart(f[0].replace("adr.",""))}else{if(f[0].search("\\bpos.")==0){var h=f[0].replace("pos.","").split("_");Directions.SetStart("Start",new VELatLong(h[0],h[1]))}}}if(f[1]){if(f[1].search("\\badr.")==0){Directions.SetEnd(f[1].replace("adr.",""))}else{if(f[1].search("\\bpos.")==0){var d=f[1].replace("pos.","").split("_");Directions.SetEnd("End",new VELatLong(d[0],d[1]))}}Directions.GetDirectionsWorker()}}}function b(){var d='<div id="DirectionsForm"><form name="DirectionsForm" action="about:blank" method="get" target="hiddenframe" onsubmit="Directions.GetDirections(); return false;">';d+="<label>From</label>";d+='<input id="DirectionsStart" type="text" name="DirectionsStart" onchanged="Directions.OnStartChanged();" /><br />';d+="<label>To</label>";d+='<input id="DirectionsEnd" type="text" name="DirectionsEnd" onchanged="Directions.OnEndChanged();" /><br />';d+='<button class="Button" type="submit" name="submit" value="Get Directions">Get Directions</button>';d+="</form></div>";Directions.Panel=new Panel("_Directions");Directions.Panel.SetIcon("/Basic/Directions/Images/Directions.png");Directions.Panel.SetTitle("Directions");Directions.Panel.SetHeader(d);Directions.Panel.SetHeaderHeight(100);Directions.Panel.SetSize(new System.Drawing.Size(250,"auto"));Directions.Panel.Minimize(false);Directions.Panel.Events.Add(new System.Event("Closed",Directions.OnPanelClosed))}try{pageTracker._trackEvent("Directions","Open")}catch(c){}};Directions.OnEndChanged=function(){Directions.SetEnd(document.getElementById("DirectionsEnd").value,undefined);Directions.Panel.SetBody("")};Directions.OnFindLocationComplete=function(d,b){if(d.length==1){if(b=="DirectionsStart"){Directions.SetStart(null,new VELatLong(d[0].LatLong.Latitude,d[0].LatLong.Longitude))}else{Directions.SetEnd(null,new VELatLong(d[0].LatLong.Latitude,d[0].LatLong.Longitude))}Directions.GetDirectionsWorker()}else{if(d.length>1){var a='<div class="PanelBodyHeader">';a+='<div class="Summary">';a+="Did you mean?";a+="</div>";a+="</div>";a+='<ol class="AmbiguousPlaces">';for(var c=0;c<d.length;c++){a+=System.String.Format("<li><a href=\"javascript:Directions.UpdateAddressFromAmbiguousPanel('{0}', '{1}', new VELatLong({2}, {3}));\">{4}</a></li>",b,d[c].Name.replace(/\'/g,"\\'"),d[c].LatLong.Latitude,d[c].LatLong.Longitude,d[c].Name)}a+="</ol>";Directions.Panel.SetBody(a)}}};Directions.OnGetRouteComplete=function(m){Directions.Route=m.RouteLegs[0];Directions.Route.StartLocation.Address=(document.getElementById("DirectionsStart").value=="Start"||document.getElementById("DirectionsStart").value=="")?"":document.getElementById("DirectionsStart").value;Directions.Route.EndLocation.Address=(document.getElementById("DirectionsEnd").value=="Start"||document.getElementById("DirectionsEnd").value=="")?"":document.getElementById("DirectionsEnd").value;Directions.ClearPushpins();for(var b=0;b<Directions.Route.Itinerary.Items.length;b++){Directions.Route.Itinerary.Items[b].Step=b+1}var f=new System.TimeSpan(0,0,0,Directions.Route.Time);var k=System.String.Format("{0}{1} ",f.GetDays()>0?f.GetDays()+" day":"",f.GetDays()>1?"s":"");k+=System.String.Format("{0}{1} ",f.GetHours()>0?f.GetHours()+" hour":"",f.GetHours()>1?"s":"");k+=System.String.Format("{0}{1} ",f.GetMinutes()>0?f.GetMinutes()+" minute":"",f.GetMinutes()>1?"s":"");var c='<div class="PanelBodyHeader">';c+='<div class="Summary">';c+='Distance:<span id="DirectionsTotalDistance">'+Directions.Route.Distance.toFixed(1)+" mi</span><br />";c+='Time:<span id="DirectionsEstimatedTime">'+k+"</span>";c+="</div>";c+='<div class="Commands"><a href="javascript:Directions.Clear();">Clear</a> | <a href="javascript:Directions.Email();">Email</a> | <a href="javascript:Directions.Print();">Print</a> | <a href="javascript:Directions.Reverse();">Reverse</a></div>';c+="</div>";c+='<ul id="DirectionsInstructions">';for(var b=0;b<Directions.Route.Itinerary.Items.length;b++){var a=Directions.Route.Itinerary.Items[b];var d=System.Guid.NewGuid();var g=System.String.Format("/Pushpin/Image.ashx?Color={0}&Text={1}","Blue",a.Step);var e="";var l="";if(a.Step==1){a.Instruction="Depart from "+(Directions.Route.StartLocation.Address==""?"Start":Directions.Route.StartLocation.Address);g="/Basic/Directions/Images/Start.png";e="Start";l="<div>"+a.Text+"</div>"}else{if(a.Step==Directions.Route.Itinerary.Items.length){a.Instruction="Arrive at "+(Directions.Route.EndLocation.Address==""?"End":Directions.Route.EndLocation.Address);g="/Basic/Directions/Images/End.png";e="End";l="<div>"+a.Text+"</div>"}else{var h=a.Distance?'<div class="InstructionDistance">'+a.Distance.toFixed(1)+'<br /><span class="InstructionUnit">mi</span></div>':"";e="Step "+a.Step+" of "+Directions.Route.Itinerary.Items.length;l='<div class="Instruction">'+a.Text+"</div>"+h}}c+='<li class="PanelItem">';c+=System.String.Format('<a href="javascript:Pushpin.ShowContextMenu(\'{1}\'); Pushpin.Center(\'{1}\');"><img class="PanelPushpin" src="{0}" /></a>',g,d);c+='<div class="PanelItemDetail">';c+=System.String.Format("<a class=\"DetailTitle\" href=\"javascript:Pushpin.ShowContextMenu('{0}'); Pushpin.Center('{0}');\">{1}</a>",d,e);c+=System.String.Format('<div class="DetailContent">{0}</div>',l);c+="</div>";c+="</li>";map.DeleteShape(a.Shape);var j=new VEPushpin(d,new VELatLong(a.LatLong.Latitude,a.LatLong.Longitude),g,e,l,"AtlasPushpin");map.AddAtlasPushpin(j);Directions.Pushpins.push(j)}c+="</ul>";Directions.Panel.SetBody(c)};Directions.OnPanelClosed=function(){Directions.Clear();map.HideTraffic()};Directions.OnStartChanged=function(){Directions.SetStart(document.getElementById("DirectionsStart").value,undefined);Directions.Panel.SetBody("")};Directions.Print=function(){var a=new System.Uri(window.location.href);var b=System.String.Format("{0}://{1}/Basic/Directions/Print.aspx{2}",a.GetScheme(),a.GetAuthority(),Directions.GetQueryString());window.open(b)};Directions.Reverse=function(){Directions.ClearRoute();var a=(document.getElementById("DirectionsStart").value=="Start")?"End":document.getElementById("DirectionsStart").value;document.getElementById("DirectionsStart").value=(document.getElementById("DirectionsEnd").value=="End")?"Start":document.getElementById("DirectionsEnd").value;document.getElementById("DirectionsEnd").value=a;var b=Directions.StartPosition;Directions.StartPosition=Directions.EndPosition;Directions.EndPosition=b;if(Directions.Route){Directions.GetDirections()}};Directions.SetEnd=function(b,a){Directions.ClearRoute();if(b){document.getElementById("DirectionsEnd").value=b}if(a){Directions.EndPosition=a.Clone();var c=new VEPushpin(System.Guid.NewGuid(),Directions.EndPosition,"/Basic/Directions/Images/End.png","End","Arrive at End","");map.AddAtlasPushpin(c);Directions.Pushpins.push(c)}else{Directions.EndPosition=undefined}if(Directions.StartPosition!=undefined){var c=new VEPushpin(System.Guid.NewGuid(),Directions.StartPosition,"/Basic/Directions/Images/Start.png","Start","Depart from Start","");map.AddAtlasPushpin(c);Directions.Pushpins.push(c)}};Directions.SetStart=function(b,a){Directions.ClearRoute();if(b){document.getElementById("DirectionsStart").value=b}if(a){Directions.StartPosition=a.Clone();var c=new VEPushpin(System.Guid.NewGuid(),Directions.StartPosition,"/Basic/Directions/Images/Start.png","Start","Depart from Start","");map.AddAtlasPushpin(c);Directions.Pushpins.push(c)}else{Directions.StartPosition=undefined}if(Directions.EndPosition!=undefined){var c=new VEPushpin(System.Guid.NewGuid(),Directions.EndPosition,"/Basic/Directions/Images/End.png","End","Arrive at End","");map.AddAtlasPushpin(c);Directions.Pushpins.push(c)}};Directions.ShowPanel=function(){if(Sidebar.Contains("_Directions")){Directions.Panel.Maximize(true)}else{map.ShowTraffic();Sidebar.Add(Directions.Panel)}};Directions.UpdateAddressFromAmbiguousPanel=function(b,a,c){if(b=="DirectionsStart"){Directions.SetStart(a,c)}else{Directions.SetEnd(a,c)}Directions.GetDirectionsWorker()};Events.Add(new System.Event("MapLoaded",Directions.Initialize));function Email(){}Email.Send=function(){var d=new System.Uri(window.location.href);var c="Atlas - powered by Fresh Logic Studios";var a="Atlas - powered by Fresh Logic Studios\n\n";a+=System.String.Format("{0}://{1}/{2}",d.GetScheme(),d.GetAuthority(),Email.GetQueryString());var b="mailto:?subject="+c+"&body="+IOSec.EncodeUrl(a);document.location.href=b;try{pageTracker._trackEvent("Email","Send")}catch(f){}};Email.GetQueryString=function(){var a="?";a+=System.String.Format("cp={0}~{1}&style={2}&lvl={3}",map.GetCenter().Latitude,map.GetCenter().Longitude,map.GetMapStyle(),map.GetZoomLevel());return a};function Help(){}Help.Open=function(){window.open("http://www.freshlogicstudios.com/Products/Atlas/Help.aspx");try{pageTracker._trackEvent("Help","Open")}catch(a){}};RegisterNamespace("FreshLogicStudios.Atlas.Features");FreshLogicStudios.Atlas.Features.Search=function(g,d){FreshLogicStudios.Atlas.Plugin.call(this,d);var a=new System.Collections.ArrayList();var e=20;var b=this;this.Index=1;this.What=g||"";function f(){b.Panel.SetIcon("/Basic/Search/Search.png");b.Panel.SetTitle("Search");b.RenderPanelHeader();try{pageTracker._trackEvent("Search","Open")}catch(h){}}function c(q,n,k,m){b.Panel.SetTitle(b.What);if(n==null){b.Panel.SetBody(System.String.Format("No results found. Try <a href=\"javascript:map.ZoomOut(); Plugins['{0}'].Refresh();\">zooming out</a>.",b.GetId()));return}for(var j=0;j<n.length;j++){var r=(j+1)+((b.Index-1)*e);var l=n[j].Name;var o=n[j].LatLong.Clone();DecodeLatLong(o);var h=System.String.Format("{0}<br />{1}",n[j].Description,n[j].Phone);var s=new FreshLogicStudios.Atlas.Item(l,h,h,o,b.Color,r);b.Items.Add(s);if(a.GetCount()<r){a.Add(n[j])}}var p='<div class="PanelBodyHeader">';p+='<div class="Summary">';p+=(b.Items.GetCount()>0)?System.String.Format("Results {0} - {1}",(b.Index-1)*e+1,(b.Index-1)*e+n.length):"";p+="</div>";p+='<div class="Commands">';p+=(b.Index==1)?"":"<a href=\"javascript:Plugins['"+b.GetId()+"'].Index--; Plugins['"+b.GetId()+"'].Refresh();\">Previous</a>";p+=((b.Index!=1)&&(n.length>=e))?" | ":"";p+=(n.length<e)?"":"<a href=\"javascript:Plugins['"+b.GetId()+"'].Index++; Plugins['"+b.GetId()+"'].Refresh();\">Next</a>";p+="</div>";p+="</div>";b.EndSearch();b.Panel.SetBody(System.String.Format("{0}{1}",p,FreshLogicStudios.Atlas.Items.GetSidebarHtml(b.Items)))}this.RenderPanelHeader=function(){var h='<div class="SearchForm">';h+=System.String.Format('<form name="SearchForm{0}" action="about:blank" method="get" target="hiddenframe" onsubmit="Plugins[\'{0}\'].What = this.What.value; Plugins[\'{0}\'].Where = this.Where.value; Plugins[\'{0}\'].BeginSearch(); return false;">',b.GetId());h+="<label>What: Business name or category</label>";h+=System.String.Format('<input name="What" type="text" value="{0}" /><br />',b.What);h+="<label>Where: Address, city or landmark</label>";h+=System.String.Format('<input id="Where_{0}" name="Where" type="text" value="{1}" onfocus="if(this.value == System.Configuration.Settings.Defaults[\'DefaultWhere\']){this.value=\'\';} else{this.select();}" onblur="if(this.value==\'\'){this.value=System.Configuration.Settings.Defaults[\'DefaultWhere\'];}" /><br />',b.GetId(),System.Configuration.Settings.Defaults.DefaultWhere);h+='<button class="Button" type="submit" name="submit" value="Search">Search</button>';h+="</form>";h+="</div>";b.Panel.SetHeader(h);b.Panel.SetHeaderHeight(100)};this.Refresh=function(){b.Panel.SetBody("Loading...");FreshLogicStudios.Atlas.Items.Clear(b.Items);b.Index=parseInt(b.Index);if(b.What==""){b.Items.Add(new FreshLogicStudios.Atlas.Item("",b.Where.Name,b.Where.Name,b.Where.LatLong,b.Color,""));b.EndSearch()}else{if(a.GetCount()>=b.Index*e){var j=a.GetRange((b.Index-1)*e,Math.min(e,a.GetCount()-((b.Index-1)*e)));c(null,j.ToArray(),null,false)}else{var h=(b.What=="*")?"pinpoint_highres":b.What;var i=(b.Where.Name==System.Configuration.Settings.Defaults.DefaultWhere)?null:b.Where.Name;map.Find(h,i,VEFindType.Businesses,null,b.Index,e,false,false,false,false,c)}}};this.Search=function(){b.Index=1;a.Clear();if(b.Where.Name!=System.Configuration.Settings.Defaults.DefaultWhere){map.Find(null,b.Where.Name,null,null,null,null,false,false,false,true,b.Refresh)}else{b.Refresh()}};f()};FreshLogicStudios.Atlas.Features.Search.ParseQueryString=function(){var c=new System.Uri(window.location.href);var b=c.GetQueryParameters();if(b.ss){var f=b.ss.split("~");var e=b.where1||System.Configuration.Settings.Defaults.DefaultWhere;for(var a=0;a<f.length;a++){var d=new FreshLogicStudios.Atlas.Features.Search(f[a],e);if(a==0){d.BeginSearch()}}}else{if(b.where1){new FreshLogicStudios.Atlas.Features.Search(null,b.where1).BeginSearch()}}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Features.Search.ParseQueryString));function Compass(){}Compass.Panning=false;Compass.MaxScrollSpeed=15;Compass.Initialize=function(){map.AttachEvent("onchangeview",Compass.OnMapChangeView);map.AttachEvent("onchangemapstyle",Compass.OnMapChangeStyle)};Compass.MouseDown=function(b){var a=document.getElementById("AtlasCompass");if(a.setCapture){a.setCapture()}Compass.Panning=true;Compass.Pan(b)};Compass.MouseMove=function(a){if(Compass.Panning){Compass.Pan(a)}};Compass.MouseUp=function(b){var a=document.getElementById("AtlasCompass");if(a.releaseCapture){a.releaseCapture()}Compass.Panning=false;map.EndContinuousPan()};Compass.OnMapChangeView=function(a){Compass.SetOrientation()};Compass.OnMapChangeStyle=function(a){Compass.SetOrientation()};Compass.Pan=function(f){if(!f){f=window.event}var g=document.getElementById("AtlasCompass");var a=document.getElementPosition(g);var b=document.getEventLocation(f);var c=b.X-a.X-(g.offsetWidth/2);var d=b.Y-a.Y-(g.offsetHeight/2);c=Math.min(Math.max(c,-Compass.MaxScrollSpeed),Compass.MaxScrollSpeed);d=Math.min(Math.max(d,-Compass.MaxScrollSpeed),Compass.MaxScrollSpeed);map.StartContinuousPan(c,d)};Compass.SetOrientation=function(){var a=document.getElementById("AtlasCompass");var b="url(/Basic/Toolbox/Images/CompassNorth.gif)";if(map.GetMapStyle()==VEMapStyle.Birdseye||map.GetMapStyle()==VEMapStyle.BirdseyeHybrid){b=System.String.Format("url(/Basic/Toolbox/Images/Compass{0}.gif)",map.GetBirdseyeScene().GetOrientation())}if(a.style.backgroundImage!=b){a.style.backgroundImage=b}};Events.Add(new System.Event("MapLoaded",Compass.Initialize));Toolbox.Panel=null;function Toolbox(){}Toolbox.Initialize=function(){MainMenu.Events.Add(new System.Event("MenuResized",Toolbox.OnMenuResized));Toolbox.Panel=new Panel("Toolbox");Toolbox.Panel.SetIcon("/Basic/Toolbox/Images/Toolbox.png");Toolbox.Panel.SetTitle("Toolbox");var a="";a+='<ul id="MapStyle">';a+='<li id="Road"><a href="javascript:map.SetMapStyle(VEMapStyle.Shaded);" id="MapStyleRoad">Road</a> <img class="Caret" onclick="Toolbox.ToggleCaretMenu(\'Road\');" src="/Basic/Toolbox/Images/Caret.png" /><div class="CaretMenu" id="RoadCaretMenu"><a href="javascript:map.SetMapStyle(VEMapStyle.Road); Toolbox.HideCaretMenus();">Flat</a><br /><a href="javascript:map.SetMapStyle(VEMapStyle.Shaded); Toolbox.HideCaretMenus();">Shaded</a></div></li>';a+='<li id="Satellite"><a href="javascript:map.SetMapStyle(VEMapStyle.Hybrid);" id="MapStyleAerial">Satellite</a> <img class="Caret" onclick="Toolbox.ToggleCaretMenu(\'Satellite\');" src="/Basic/Toolbox/Images/Caret.png" /><div class="CaretMenu" id="SatelliteCaretMenu"><a href="javascript:map.SetMapStyle(VEMapStyle.Aerial); Toolbox.HideCaretMenus();">Hide Labels</a><br /><a href="javascript:map.SetMapStyle(VEMapStyle.Hybrid); Toolbox.HideCaretMenus();">Show Labels</a></div></li>';a+='<li id="Birdseye"><a href="javascript:map.SetMapStyle(VEMapStyle.BirdseyeHybrid);" id="MapStyleBirdsEye">Bird\'s Eye</a> <img class="Caret" onclick="Toolbox.ToggleCaretMenu(\'Birdseye\');" src="/Basic/Toolbox/Images/Caret.png" /><div class="CaretMenu" id="BirdseyeCaretMenu"><a href="javascript:map.SetMapStyle(VEMapStyle.Birdseye); Toolbox.HideCaretMenus();">Hide Labels</a><br /><a href="javascript:map.SetMapStyle(VEMapStyle.BirdseyeHybrid); Toolbox.HideCaretMenus();">Show Labels</a></div></li>';a+="</ul>";a+='<div id="ViewOptions">';a+='<div id="AtlasCompass" class="Compass" onmousedown="Compass.MouseDown(event);" onmousemove="Compass.MouseMove(event);" onmouseup="Compass.MouseUp(event);"></div>';a+='<ul id="ZoomOptions">';a+='<li><a id="ZoomIn" href="javascript:map.ZoomIn();">Zoom In</a></li>';a+='<li><a id="ZoomOut" href="javascript:map.ZoomOut();">Zoom Out</a></li>';a+='<li id="Rotate"><a href="javascript:map.RotateClockwise();">Rotate</a></li>';a+="</ul>";a+="</div>";Toolbox.Panel.SetSize(new System.Drawing.Size(235,100));Toolbox.Panel.SetLocation(new System.Drawing.Point(GetWindowWidth()-Toolbox.Panel.GetCurrentSize().Width,MainMenu.GetHeight()+20));Toolbox.Panel.SetHeaderHeight(77);Toolbox.Panel.SetHeader(a);map.AttachEvent("onchangeview",Toolbox.OnMapChangeView);map.AttachEvent("onchangemapstyle",Toolbox.OnMapChangeStyle);Toolbox.SetSelectedMapStyle(map.GetMapStyle());window.setTimeout("Toolbox.Panel.Show();",500)};Toolbox.OnMapChangeView=function(a){Toolbox.SetSelectedMapStyle(map.GetMapStyle())};Toolbox.OnMapChangeStyle=function(a){Toolbox.SetSelectedMapStyle(map.GetMapStyle())};Toolbox.OnMenuResized=function(){if(Toolbox.Panel){Toolbox.Panel.SetLocation(new System.Drawing.Point(GetWindowWidth()-Toolbox.Panel.GetCurrentSize().Width,MainMenu.GetHeight()+20))}};Toolbox.OnWindowResized=function(){if(Toolbox.Panel){Toolbox.Panel.SetLocation(new System.Drawing.Point(GetWindowWidth()-Toolbox.Panel.GetCurrentSize().Width,MainMenu.GetHeight()+20))}};Toolbox.SetSelectedMapStyle=function(a){document.getElementById("MapStyleRoad").className="";document.getElementById("MapStyleAerial").className="";document.getElementById("MapStyleBirdsEye").className="";Toolbox.HideCaretMenus();document.getElementById("Rotate").style.display="none";document.getElementById("ZoomOptions").style.top="5px";document.getElementById("Birdseye").style.display=map.IsBirdseyeAvailable()?"block":"none";switch(a){case VEMapStyle.Road:document.getElementById("MapStyleRoad").className="Selected";break;case VEMapStyle.Shaded:document.getElementById("MapStyleRoad").className="Selected";break;case VEMapStyle.Aerial:document.getElementById("MapStyleAerial").className="Selected";break;case VEMapStyle.Hybrid:document.getElementById("MapStyleAerial").className="Selected";break;case VEMapStyle.Birdseye:document.getElementById("MapStyleBirdsEye").className="Selected";document.getElementById("Rotate").style.display="block";document.getElementById("ZoomOptions").style.top="-2px";break;case VEMapStyle.BirdseyeHybrid:document.getElementById("MapStyleBirdsEye").className="Selected";document.getElementById("Rotate").style.display="block";document.getElementById("ZoomOptions").style.top="-2px";break}if(map.IsBirdseyeAvailable()&&map.GetMapStyle()!=VEMapStyle.Birdseye&&map.GetMapStyle()!=VEMapStyle.BirdseyeHybrid){Toolbox.Panel.SetSize(new System.Drawing.Size(235,145));Toolbox.Panel.SetBody('<div id="BirdseyeMessage"><a href="javascript:map.SetMapStyle(VEMapStyle.BirdseyeHybrid);">See this location in bird\'s eye view</a></div>')}else{Toolbox.Panel.SetSize(new System.Drawing.Size(235,120));Toolbox.Panel.SetBody("")}};Toolbox.ShowCaretMenu=function(a){Toolbox.HideCaretMenus();document.getElementById(a).style.backgroundColor="#000";document.getElementById(a).style.borderColor="#484848";document.getElementById(a+"CaretMenu").style.display="block"};Toolbox.HideCaretMenu=function(a){document.getElementById(a+"CaretMenu").style.display="none";document.getElementById(a).style.backgroundColor="transparent";document.getElementById(a).style.borderColor="transparent"};Toolbox.ToggleCaretMenu=function(a){if(document.getElementById(a+"CaretMenu").style.display=="none"){Toolbox.ShowCaretMenu(a)}else{Toolbox.HideCaretMenu(a)}};Toolbox.HideCaretMenus=function(){Toolbox.HideCaretMenu("Road");Toolbox.HideCaretMenu("Satellite");Toolbox.HideCaretMenu("Birdseye")};Events.Add(new System.Event("MapLoaded",Toolbox.Initialize));AddEvent(window,"resize",Toolbox.OnWindowResized);ContextMenu.PanelOffset=new System.Drawing.Size(27,20);function ContextMenu(j,i,e,b,l){var f=this;var m=l;var k=new Panel(j);this.Events=new System.EventCollection();function g(){k.SetTitle(i);k.SetIcon(e);k.GetElement().style.zIndex="80";k.Events.Add(new System.Event("Closed",function(p){a(p)}));f.SetBody(b);f.SetLocation(m);var n=k.GetElement();var o=document.createElement("div");o.className="Arrow";n.appendChild(o);map.AttachEvent("onchangeview",c)}function d(){var o="new VELatLong("+m.Latitude+", "+m.Longitude+")";var n="";if(m&&m.Latitude&&m.Longitude){if(f.GetBody()!=""){n='<div class="ContextMenuFooter">';k.SetFooterHeight(100)}else{k.SetFooterHeight(85)}n+='<div class="DirectionsOptions">';n+='<h1 class="DirectionsOptionsLabel">Directions</h1>';n+="<ul>";n+=System.String.Format("<li><a href=\"javascript:Directions.ShowPanel(); Directions.SetStart('Start', {0}); AtlasContextMenu.Hide();\">from</a> | </li>",o);n+=System.String.Format('<li><a href="javascript:Directions.ShowPanel(); Directions.SetEnd(\'End\', {0}); AtlasContextMenu.Hide();" style="border-right:none;">to</a></li>',o);n+="</ul>";n+="</div>";n+='<div class="ViewOptions">';n+='<h1 class="ViewOptionsLabel">View</h1>';n+="<ul>";if(map.GetMapStyle()!=VEMapStyle.Birdseye){n+=System.String.Format('<li><a href="javascript:map.SetCenterAndZoom({0}, {1}); AtlasContextMenu.Hide();">region</a> | </li>',o,System.Configuration.Settings.RegionZoomLevel);n+=System.String.Format('<li><a href="javascript:map.SetCenterAndZoom({0}, {1}); AtlasContextMenu.Hide();">city</a> | </li>',o,System.Configuration.Settings.CityZoomLevel);n+=System.String.Format('<li><a href="javascript:map.SetCenterAndZoom({0}, {1}); AtlasContextMenu.Hide();">street</a> | </li>',o,System.Configuration.Settings.StreetZoomLevel)}n+=System.String.Format('<li><a href="javascript:map.SetCenter({0}); AtlasContextMenu.Hide();" style="border-right:none;">center here</a></li>',o);n+="</ul>";n+="</div>";n+='<div class="DetailsOptions">';n+='<h1 class="DetailsOptionsLabel">Details</h1>';n+="<ul>";n+=System.String.Format('<li><a href="javascript:Details.ShowPanel(); Details.Populate({0}); AtlasContextMenu.Hide();">about this location</a></li>',o);n+="</ul>";n+="</div>";if(f.GetBody()!=""){n+="</div>"}}else{n='<div>No options available.<br /><br />Try changing the map style to <a href="javascript:map.SetMapStyle(VEMapStyle.Road);">road</a>, <a href="javascript:map.SetMapStyle(VEMapStyle.Aerial);">aerial</a>, or <a href="javascript:map.SetMapStyle(VEMapStyle.Hybrid);">hybrid</a>.</div>';k.SetFooterHeight(55)}f.SetFooter(n)}function h(){try{var o=map.LatLongToPixel(m);return new System.Drawing.Point(o.x,o.y)}catch(n){return new System.Drawing.Point(0,0)}}function c(){if(k.IsVisible()){if(m&&m.Latitude&&m.Longitude){f.SetLocation(m)}else{k.Hide()}}}function a(n){f.Events.Fire("Closed",f)}this.GetBody=function(){return k.GetBody()};this.GetElement=function(){return k.GetElement()};this.GetFooter=function(){return k.GetFooter()};this.GetHeader=function(){return k.GetHeader()};this.GetId=function(){return k.GetId()};this.GetLocation=function(){return m};this.GetSize=function(){var n=k.GetCurrentSize();n.Width=n.Width+ContextMenu.PanelOffset.Width;return n};this.Hide=function(){k.Hide()};this.IsVisible=function(){return k.IsVisible()};this.SetBody=function(n){k.SetBody(n);d()};this.SetFooterHeight=function(n){k.SetFooterHeight(n)};this.SetFooter=function(n){k.SetFooter(n)};this.SetHeader=function(n){k.SetHeader(n)};this.SetLocation=function(n){m=n||new VELatLong(0,0);var o=h();o.Offset(ContextMenu.PanelOffset.Width,-1*ContextMenu.PanelOffset.Height);k.SetLocation(o);d()};this.SetSize=function(n){k.SetSize(n)};this.SetTitle=function(n){k.SetTitle(n)};this.Show=function(r){var o=new System.Drawing.Size(0,0);var t=GetWindowWidth();var s=GetWindowHeight();if(r){var p=h();var n=f.GetSize();if(p.X<0){o.Width=p.X-25}if(p.Y-ContextMenu.PanelOffset.Height<MainMenu.GetHeight()){o.Height=p.Y-ContextMenu.PanelOffset.Height-MainMenu.GetHeight()-25}if(p.X+n.Width>t){o.Width=(p.X+n.Width+25)-t}if(p.Y+n.Height>s){o.Height=(p.Y+n.Height)-s}}if(o.Width!=0||o.Height!=0){map.SetAnimationEnabled(false);var q=new VEPixel(Math.floor(t/2)+o.Width,Math.floor(s/2)+o.Height);map.SetCenter(map.PixelToLatLong(q));map.SetAnimationEnabled(true)}f.SetLocation(m);k.Show(false)};g()}function ContextMenuCollection(){var a=this;this.ContextMenus=new Object();this.Add=function(b){a.ContextMenus[b.GetId()]=b};this.Clear=function(){a.ContextMenus=new Object()};this.Hide=function(b){if(a.ContextMenus[b]){a.ContextMenus[b].Hide()}};this.HideAll=function(){for(var b in a.ContextMenus){a.ContextMenus[b].Hide()}};this.Remove=function(b){delete a.ContextMenus[b.GetId()]};this.Show=function(b){if(a.ContextMenus[b]){a.ContextMenus[b].Show(true)}}}RegisterNamespace("FreshLogicStudios.Atlas.Experimental");FreshLogicStudios.Atlas.Experimental.Foursquare=function(a){FreshLogicStudios.Atlas.Plugin.call(this,a);var c=this;function b(){c.Panel.SetIcon("/Experimental/Foursquare/Foursquare.png");c.Panel.SetTitle("Foursquare");try{pageTracker._trackEvent("Foursquare","Open")}catch(f){}}function d(g){if(g.get_statusCode()==200){var p=g.get_xml().getElementsByTagName("event");for(var f=0;f<p.length;f++){if(p[f].getElementsByTagName("latitude")[0].firstChild&&p[f].getElementsByTagName("longitude")[0].firstChild){var n=p[f].getAttribute("id");var k="http://www.eventful.com/events/"+n;var h=p[f].getElementsByTagName("title")[0].firstChild.data;var e=(p[f].getElementsByTagName("venue_address")[0].firstChild?p[f].getElementsByTagName("venue_address")[0].firstChild.data+", ":"")+(p[f].getElementsByTagName("city_name")[0].firstChild?p[f].getElementsByTagName("city_name")[0].firstChild.data+", ":"")+(p[f].getElementsByTagName("region_name")[0].firstChild?p[f].getElementsByTagName("region_name")[0].firstChild.data:"")+" "+(p[f].getElementsByTagName("postal_code")[0].firstChild?p[f].getElementsByTagName("postal_code")[0].firstChild.data:"");var o=ParseDate(p[f].getElementsByTagName("start_time")[0].firstChild.data);o=new System.DateTime(o.getFullYear(),o.getMonth()+1,o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds(),o.getMilliseconds());var l=new VELatLong(p[f].getElementsByTagName("latitude")[0].firstChild.data,p[f].getElementsByTagName("longitude")[0].firstChild.data);var q=System.String.Format("{0}<br /><br />{1}<br /><br />",o.ToString("g"),e);q+=System.String.Format('<a href="{0}" style="color:#6A6967;" target="_blank">event&nbsp;&raquo;</a><br />',k);var m=new FreshLogicStudios.Atlas.Item(h,q,q,l,c.Color,f+1);c.Items.Add(m)}}}var j='<div class="PanelBodyHeader"><div class="Summary">Data provided by <a href="http://foursquare.com/" target="_blank">eventful.com</a></div></div>';c.EndSearch();c.Panel.SetBody(System.String.Format("{0}{1}",j,FreshLogicStudios.Atlas.Items.GetSidebarHtml(c.Items)))}this.Search=function(){var e=System.String.Format("http://api.foursquare.com/v1/tips?geolat={0}&geolong={1}",c.Where.LatLong.Latitude,c.Where.LatLong.Longitude);alert(e);e=System.String.Format("/proxy.ashx?uri={0}",encodeURIComponent(e));$.get(e,function(f){alert("Data Loaded: "+f)})};b()};RegisterNamespace("FreshLogicStudios.Atlas.Experimental.Twitter");FreshLogicStudios.Atlas.Experimental.Twitter=function(i,d){FreshLogicStudios.Atlas.Plugin.call(this,d);var g=Pushpin.GetNextColor();var b=1;var j=100;var a=this;var h=null;var c=null;this.Channel=new FreshLogicStudios.Atlas.GeoRss.Channel();this.What=i||"";function f(){if(a.Where===System.Configuration.Settings.Defaults.DefaultWhere){a.Where=""}a.Panel.SetIcon("/Experimental/Twitter/Twitter.png");a.Panel.SetTitle("Twitter");a.RenderPanelHeader();var l=new System.Uri(window.location.href);var k=l.GetQueryParameters();if(!k.lvl){map.SetZoomLevel(6)}a.BeginSearch();try{pageTracker._trackEvent("Twitter","Open")}catch(m){}}function e(n){var o=FreshLogicStudios.Atlas.GeoRss.Channel.FromDom(n);var m=a.Channel.GetUniqueItems(o.Items.ToArray());a.Channel.Items.AddRange(m);if(a.Channel.Items.GetCount()>j){a.Channel.Items.RemoveRange(0,a.Channel.Items.GetCount()-j)}for(var k=m.length-1;k>=0;k--){if(m[k].Shape){var r=new FreshLogicStudios.Atlas.Item(m[k].Title,m[k].Description,m[k].Description,m[k].Shape.GetPoints()[0],g,b++);a.Items.Add(r);r.ShowPushpin()}}while(a.Items.GetCount()>j){a.Items.GetItem(0).HidePushpin();a.Items.RemoveAt(0)}if(b>=j){b=1}if(m.length>0){try{var q=a.Items.GetItem(a.Items.GetCount()-1);q.Center();q.ShowContextMenu()}catch(p){}}var l="<ul>";for(var k=a.Items.GetCount()-1;k>=0;k--){l+=a.Items.GetItem(k).GetSidebarHtml()}l+="</ul>";a.Panel.SetBody(l)}this.Clear=function(){if(c){try{c.abort()}catch(k){}}if(h){window.clearTimeout(h)}b=1;a.HidePushpins();a.Items.Clear()};this.RenderPanelHeader=function(){var k='<div class="SearchForm twitter">';k+=System.String.Format("<form name=\"SearchForm{0}\" action=\"about:blank\" method=\"get\" target=\"hiddenframe\" onsubmit=\"Plugins['{0}'].What = $('#what_{0}').val(); Plugins['{0}'].Where = $('#where_{0}').val(); Plugins['{0}'].BeginSearch(); return false;\">",a.GetId());k+=System.String.Format('<label for="what_{0}"><strong>What:</strong> Tag or keyword (optional)</label>',a.GetId());k+=System.String.Format('<input class="what" id="what_{0}" type="text" value="{1}" /><br />',a.GetId(),a.What);k+="<label><strong>Where:</strong> Address, city or place (optional)</label>";k+=System.String.Format('<input id="where_{0}" type="text" value="{1}" /><br />',a.GetId(),a.Where);k+='<button class="Button" type="submit">Search</button>';k+="</form>";k+="</div>";a.Panel.SetHeader(k);a.Panel.SetHeaderHeight(100);$.getJSON("http://search.twitter.com/trends.json?&callback=?",function(n){var l=new Array();for(var m=0;m<n.trends.length;m++){l.push(n.trends[m].name)}$("#what_"+a.GetId()).combobox({arrowURL:"/Images/combobox.png",autoShow:false,data:l})})};this.Search=function(){a.Update()};this.Update=function(){var k="/georss/feeds/twitter.ashx?";if(a.What){k+=System.String.Format("q={0}&",encodeURIComponent(a.What))}if(a.Where&&a.Where.Name&&a.Where.Name!=System.Configuration.Settings.Defaults.DefaultWhere){k+=System.String.Format("latitude={0}&longitude={1}&radius=25mi",a.Where.LatLong.Latitude,a.Where.LatLong.Longitude)}c=$.ajax({cache:false,complete:function(){h=window.setTimeout(a.Update,5000)},success:function(l,m){e(l)},url:k})};f()};FreshLogicStudios.Atlas.Experimental.Twitter.ParseQueryString=function(){var e=new System.Uri(window.location.href);var c=e.GetQueryParameters();var d=c.twitter||c.Twitter;if(d){var d=d!="undefined"?d:"";var a=c.where||c.Where;var b=new FreshLogicStudios.Atlas.Experimental.Twitter(d,a)}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Experimental.Twitter.ParseQueryString));RegisterNamespace("FreshLogicStudios.Atlas.Features");FreshLogicStudios.Atlas.Features.Blogs=function(a){FreshLogicStudios.Atlas.Plugin.call(this,a);var c=this;function b(){c.Panel.SetIcon("/Features/Blogs/Blogs.png");c.Panel.SetTitle("Blogs");try{pageTracker._trackEvent("Blogs","Open")}catch(f){}}function d(g){if(g.get_statusCode()==200){var j=g.get_xml().getElementsByTagName("blog");for(var f=0;f<j.length;f++){var h=j[f].getAttribute("name");var e=(j[f].getElementsByTagName("city")[0].firstChild)?j[f].getElementsByTagName("city")[0].firstChild.data:"";var l=(j[f].getElementsByTagName("div")[0].firstChild)?j[f].getElementsByTagName("div")[0].firstChild.data:"";var p=e+(e=="")?l:", "+l;var k=new VELatLong(j[f].getElementsByTagName("latitude")[0].firstChild.data,j[f].getElementsByTagName("longitude")[0].firstChild.data);var o=p+"<br />";o+=System.String.Format('<a href="{0}" style="color:#6A6967;" target="_blank">blog&nbsp;&raquo;</a>',j[f].getAttribute("url"));o+="<br />";o+=System.String.Format('<a href="{0}" style="color:#6A6967;" target="_blank">feed&nbsp;&raquo;</a>',j[f].getAttribute("xmlurl"));o+="<br />";var n=new FreshLogicStudios.Atlas.Item(h,o,o,k,c.Color,f+1);c.Items.Add(n)}}var m='<div class="PanelBodyHeader"><div class="Summary">Data provided by <a href="http://www.feedmap.net/" target="_blank">feedmap.net</a></div></div>';c.EndSearch();c.Panel.SetBody(System.String.Format("{0}{1}",m,FreshLogicStudios.Atlas.Items.GetSidebarHtml(c.Items)))}this.Search=function(){var e=new Sys.Net.WebRequest();e.set_url(System.String.Format("/Features/Blogs/Blogs.ashx?latitude={0}&longitude={1}",c.Where.LatLong.Latitude,c.Where.LatLong.Longitude));e.add_completed(d);e.invoke()};b()};RegisterNamespace("FreshLogicStudios.Atlas.Features");FreshLogicStudios.Atlas.Features.Events=function(a){FreshLogicStudios.Atlas.Plugin.call(this,a);var c=this;function b(){c.Panel.SetIcon("/Features/Events/Events.png");c.Panel.SetTitle("Events");try{pageTracker._trackEvent("Events","Open")}catch(f){}}function d(h){var f=h.split(" ")[0];var g=h.split(" ")[1];return new Date(f.split("-")[0],f.split("-")[1]-1,f.split("-")[2],g.split(":")[0],g.split(":")[1],g.split(":")[2],0)}function e(h){if(h.get_statusCode()==200){var q=h.get_xml().getElementsByTagName("event");for(var g=0;g<q.length;g++){if(q[g].getElementsByTagName("latitude")[0].firstChild&&q[g].getElementsByTagName("longitude")[0].firstChild){var o=q[g].getAttribute("id");var l="http://www.eventful.com/events/"+o;var j=q[g].getElementsByTagName("title")[0].firstChild.data;var f=(q[g].getElementsByTagName("venue_address")[0].firstChild?q[g].getElementsByTagName("venue_address")[0].firstChild.data+", ":"")+(q[g].getElementsByTagName("city_name")[0].firstChild?q[g].getElementsByTagName("city_name")[0].firstChild.data+", ":"")+(q[g].getElementsByTagName("region_name")[0].firstChild?q[g].getElementsByTagName("region_name")[0].firstChild.data:"")+" "+(q[g].getElementsByTagName("postal_code")[0].firstChild?q[g].getElementsByTagName("postal_code")[0].firstChild.data:"");var p=d(q[g].getElementsByTagName("start_time")[0].firstChild.data);p=new System.DateTime(p.getFullYear(),p.getMonth()+1,p.getDate(),p.getHours(),p.getMinutes(),p.getSeconds(),p.getMilliseconds());var m=new VELatLong(q[g].getElementsByTagName("latitude")[0].firstChild.data,q[g].getElementsByTagName("longitude")[0].firstChild.data);var r=System.String.Format("{0}<br /><br />{1}<br /><br />",p.ToString("g"),f);r+=System.String.Format('<a href="{0}" style="color:#6A6967;" target="_blank">event&nbsp;&raquo;</a><br />',l);var n=new FreshLogicStudios.Atlas.Item(j,r,r,m,c.Color,g+1);c.Items.Add(n)}}}var k='<div class="PanelBodyHeader"><div class="Summary">Data provided by <a href="http://eventful.com/" target="_blank">eventful.com</a></div></div>';c.EndSearch();c.Panel.SetBody(System.String.Format("{0}{1}",k,FreshLogicStudios.Atlas.Items.GetSidebarHtml(c.Items)))}this.Search=function(){var g=new Sys.Net.WebRequest();var f=System.String.Format("http://api.evdb.com/rest/events/search?app_key=L5xCmkhbGHVDvD6g&location={0}&page_size=50&within=10",encodeURIComponent(c.Where.LatLong.Latitude+", "+c.Where.LatLong.Longitude));g.set_url(System.String.Format("/Proxy.ashx?uri={0}",encodeURIComponent(f)));g.add_completed(e);g.invoke()};b()};RegisterNamespace("FreshLogicStudios.Atlas.Features");FreshLogicStudios.Atlas.Features.Xkcd=function(){FreshLogicStudios.Atlas.Plugin.call(this);var a=null;var c=this;function b(){c.Panel.SetIcon("/Features/Experiments/Xkcd/Xkcd.png");c.Panel.SetTitle("XKCD Geohashing");c.RenderPanelHeader();c.Panel.SetBody('<strong>What is this?</strong><br />XKCD comic #426 contains an algorithm that generates random coordinates across the country every day. These coordinates can be used as destinations for adventures, a la Geocaching. They can also be used for local meetups.<br /><a href="http://wiki.xkcd.com/geohashing/Main_Page" target="_blank">more...</a></p>');try{pageTracker._trackEvents("XKCD","Open")}catch(f){}}function d(p){if(p.get_statusCode()==200){var f=p.get_xml().getElementsByTagName("item");var o=new Array();for(var l=0;l<f.length;l++){var j=(l+1);var n=(f[l].getElementsByTagName("description")[0].firstChild)?f[l].getElementsByTagName("description")[0].firstChild.data:"";var m=(f[l].getElementsByTagName("title")[0].firstChild)?f[l].getElementsByTagName("title")[0].firstChild.data:"";var k=null;var g=null;if(k==null||g==null){if(f[l].getElementsByTagName("georss:point").length>0){try{var h=f[l].getElementsByTagName("georss:point")[0].firstChild.data;k=h.split(" ")[0];g=h.split(" ")[1]}catch(q){}}}if(k==null||g==null){if(f[l].getElementsByTagName("point").length>0){try{var h=f[l].getElementsByTagName("point")[0].firstChild.data;k=h.split(" ")[0];g=h.split(" ")[1]}catch(q){}}}var r=new VELatLong(parseFloat(k),parseFloat(g));var s=new FreshLogicStudios.Atlas.Item(m,n,n,r,c.Color,j);c.Items.Add(s);o.push(r)}c.EndSearch();c.Panel.SetBody(System.String.Format("{0}",FreshLogicStudios.Atlas.Items.GetSidebarHtml(c.Items)));var t=new Array();t.push(new VELatLong(Math.floor(c.Where.LatLong.Latitude),Math.floor(c.Where.LatLong.Longitude)));t.push(new VELatLong(Math.floor(c.Where.LatLong.Latitude)+1,Math.floor(c.Where.LatLong.Longitude)));t.push(new VELatLong(Math.floor(c.Where.LatLong.Latitude)+1,Math.floor(c.Where.LatLong.Longitude)+1));t.push(new VELatLong(Math.floor(c.Where.LatLong.Latitude),Math.floor(c.Where.LatLong.Longitude)+1));a=new VEShape(VEShapeType.Polygon,t);a.HideIcon();map.AddShape(a);map.SetMapView(t)}else{c.EndSearch()}}this.Clear=function(){c.HidePushpins();c.Items.Clear();if(a!=null){map.DeleteShape(a);a=null}};this.Search=function(){c.Clear();c.Panel.SetBody("Loading...");var e=new Sys.Net.WebRequest();e.set_url(System.String.Format("/Features/Experiments/Xkcd/Xkcd.ashx?Latitude={0}&Longitude={1}",c.Where.LatLong.Latitude,c.Where.LatLong.Longitude));e.add_completed(d);e.invoke()};b()};FreshLogicStudios.Atlas.Features.Xkcd.ParseQueryString=function(){var b=new System.Uri(window.location.href);var a=b.GetQueryParameters();if(a.Xkcd){var c=new FreshLogicStudios.Atlas.Features.Xkcd();c.Where=a.Xkcd!="undefined"?a.Xkcd:"";if(c.Where!=""){c.BeginSearch()}}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Features.Xkcd.ParseQueryString));RegisterNamespace("FreshLogicStudios.Atlas.Features");FreshLogicStudios.Atlas.Features.GasPrices=function(a){FreshLogicStudios.Atlas.Plugin.call(this,a);var d=this;function b(){d.Panel.SetIcon("/Features/GasPrices/GasPrices.png");d.Panel.SetTitle("Gas Prices");try{pageTracker._trackEvent("Gas Prices","Open")}catch(f){}}function c(g){var f=new Sys.Net.WebRequest();f.set_url(System.String.Format("/Features/GasPrices/GasPrices.ashx?zip={0}",g));f.add_completed(e);f.invoke()}function e(k){if(k.get_statusCode()==200){var p=k.get_xml().getElementsByTagName("GasStation");for(var g=0;g<p.length;g++){var l=p[g].getElementsByTagName("Name")[0].firstChild.data;var m=p[g].getElementsByTagName("Address1")[0].firstChild.data;var q=p[g].getElementsByTagName("Address2")[0].firstChild.data;var n=p[g].getElementsByTagName("Price");var o=new VELatLong(p[g].getElementsByTagName("Latitude")[0].firstChild.data,p[g].getElementsByTagName("Longitude")[0].firstChild.data);var f=System.String.Format('<div class="Logo"><img src="http://gadgets.freshlogicstudios.com/GasPrices/Images/GasStationLogo.ashx?name={0}" /></div>',l);f+=System.String.Format("{0}<br />{1}<br /><br />",m,q);for(var h=0;h<n.length;h++){f+=(n[h].getAttribute("type")+": "+n[h].getElementsByTagName("Amount")[0].firstChild.data+(h!=(n.length-1)?"<br />":""))}var r=new FreshLogicStudios.Atlas.Item(l,f,f,o,d.Color,g+1);d.Items.Add(r)}}d.EndSearch()}this.Search=function(){FreshLogicStudios.Atlas.Web.WebService.GetPostalCode(d.Where.LatLong.Latitude,d.Where.LatLong.Longitude,function(f){c(f)})};b()};RegisterNamespace("FreshLogicStudios.Atlas.Features");FreshLogicStudios.Atlas.Features.Movies=function(a){FreshLogicStudios.Atlas.Plugin.call(this,a);var d=this;function b(){d.Panel.SetIcon("/Features/Movies/Movies.png");d.Panel.SetTitle("Movies");try{pageTracker._trackEvent("Movies","Open")}catch(f){}}function c(g){var f=new Sys.Net.WebRequest();f.set_url(System.String.Format("/Features/Movies/Movies.ashx?zip={0}",g));f.add_completed(e);f.invoke()}function e(x){if(x.get_statusCode()==200){var p=x.get_xml().getElementsByTagName("Theatre");for(var r=0;r<p.length;r++){if(p[r].getElementsByTagName("Position").length>0){var u=p[r].getElementsByTagName("Name")[0].firstChild.data;var w=p[r].getElementsByTagName("Address1")[0].firstChild.data;var h=p[r].getElementsByTagName("Address2")[0].firstChild?p[r].getElementsByTagName("Address2")[0].firstChild.data:"";var s=p[r].getElementsByTagName("Phone")[0].firstChild.data;var A=p[r].getElementsByTagName("Uri")[0].firstChild.data;var B=new VELatLong(p[r].getElementsByTagName("Latitude")[0].firstChild.data,p[r].getElementsByTagName("Longitude")[0].firstChild.data);var z=System.String.Format("<div>{0}</div><div>{1}</div><div>{2}</div>",w,h,s);z+='<div style="position:relative;">';z+=System.String.Format('<a href="{0}" style="color:#6A6967;" target="_blank" title="View theatre details">details&nbsp;&raquo;</a><br />',A);var l=p[r].getElementsByTagName("Movie");var o="";if(l.length<=0){o+='<span style="color:#6A6967;">no showtimes available</span><br />'}else{o+='<a href="#" style="color:#6A6967;" title="View or hide the showtimes" onclick="System.Html.HtmlElement.Toggle(this.parentNode.getElementsByTagName(\'ul\')[0]); System.Html.HtmlElement.Toggle(this.parentNode.getElementsByTagName(\'img\')[0]); return false;">showtimes&nbsp;&raquo;</a><br />';o+='<img src="/Features/Movies/Showtimes.gif" class="ShowtimesDetailsImage" style="display:none;" alt="" />';o+='<ul class="MoviesByTheatreList" style="display:none;">';for(var m=0;m<l.length;m++){var y=l[m].getElementsByTagName("Name")[0].firstChild.data;var f=(l[m].getElementsByTagName("Rating")[0].firstChild)?l[m].getElementsByTagName("Rating")[0].firstChild.data:"";var q=(l[m].getElementsByTagName("Length")[0].firstChild)?l[m].getElementsByTagName("Length")[0].firstChild.data:"";o+="<li>";o+=System.String.Format('<div><a href="{0}" target="_blank">{1}</a></div>',l[m].getElementsByTagName("Uri")[0].firstChild.data,y);o+=System.String.Format('<div class="MovieDetails"><span class="MovieRating">{0}</span><span class="MovieLength">{1}</span></div>',f,q);o+='<ul class="ShowtimesList">';var t=l[m].getElementsByTagName("Showtime");if(t.length>0){o+=System.String.Format("<li>{0}</li>",t[0].firstChild.data)}else{o+="<li>no showtimes</li>"}for(var n=1;n<t.length;n++){o+=System.String.Format("<li> - {0}</li>",t[n].firstChild.data)}o+="</ul>";o+="</li>"}o+="</ul>"}var v=z+o+"</div></div>";var g=z+"</div></div>";var C=new FreshLogicStudios.Atlas.Item(u,v,g,B,d.Color,r+1);d.Items.Add(C)}}}d.EndSearch()}this.Search=function(){FreshLogicStudios.Atlas.Web.WebService.GetPostalCode(d.Where.LatLong.Latitude,d.Where.LatLong.Longitude,function(f){c(f)})};b()};RegisterNamespace("FreshLogicStudios.Atlas.Features");FreshLogicStudios.Atlas.Features.Packages=function(){FreshLogicStudios.Atlas.Plugin.call(this);var a=null;var c=this;this.What="";function b(){c.Panel.SetIcon("/Features/Packages/Packages.png");c.Panel.SetTitle("Packages");c.RenderPanelHeader();try{pageTracker._trackEvent("Packages","Open")}catch(f){}}function d(p){if(p.get_statusCode()==200){var f=p.get_xml().getElementsByTagName("item");var o=new Array();for(var l=0;l<f.length;l++){var j=(l+1);var n=(f[l].getElementsByTagName("description")[0].firstChild)?f[l].getElementsByTagName("description")[0].firstChild.data:"";var m=(f[l].getElementsByTagName("title")[0].firstChild)?f[l].getElementsByTagName("title")[0].firstChild.data:"";var k=null;var g=null;if(k==null||g==null){if(f[l].getElementsByTagName("georss:point").length>0){try{var h=f[l].getElementsByTagName("georss:point")[0].firstChild.data;k=h.split(" ")[0];g=h.split(" ")[1]}catch(q){}}}if(k==null||g==null){if(f[l].getElementsByTagName("point").length>0){try{var h=f[l].getElementsByTagName("point")[0].firstChild.data;k=h.split(" ")[0];g=h.split(" ")[1]}catch(q){}}}var r=new VELatLong(parseFloat(k),parseFloat(g));var s=new FreshLogicStudios.Atlas.Item(m,n,n,r,c.Color,j);c.Items.Add(s);o.push(r)}if(o.length>=2){a=new VEShape(VEShapeType.Polyline,o);a.HideIcon();map.AddShape(a)}c.EndSearch();c.Panel.SetBody(System.String.Format("{0}",FreshLogicStudios.Atlas.Items.GetSidebarHtml(c.Items)))}else{c.EndSearch()}}this.BeginSearch=function(){c.Search()};this.Clear=function(){c.HidePushpins();c.Items.Clear();if(a!=null){map.DeleteShape(a);a=null}};this.RenderPanelHeader=function(){var e='<div class="SearchForm">';e+=System.String.Format('<form name="SearchForm{0}" action="about:blank" method="get" target="hiddenframe" onsubmit="Plugins[\'{0}\'].What = this.What.value; Plugins[\'{0}\'].BeginSearch(); return false;">',c.GetId());e+='<label>Tracking number: <span class="Carriers">DHL, FedEx, UPS or USPS</span></label>';e+=System.String.Format('<input name="What" type="text" value="{0}" /><br />',c.What);e+='<button class="Button" type="submit" name="submit" value="Search">Search</button>';e+="</form>";e+="</div>";c.Panel.SetHeader(e);c.Panel.SetHeaderHeight(70)};this.Search=function(){c.Clear();c.Panel.SetBody("Loading...");var e=new Sys.Net.WebRequest();e.set_url(System.String.Format("/Features/Packages/Packages.ashx?TrackingNumber={0}",c.What));e.add_completed(d);e.invoke()};b()};FreshLogicStudios.Atlas.Features.Packages.ParseQueryString=function(){var d=new System.Uri(window.location.href);var b=d.GetQueryParameters();var c=b.packages||b.Packages;if(c){var a=new FreshLogicStudios.Atlas.Features.Packages();a.What=c!="undefined"?c:"";a.RenderPanelHeader();if(a.What!=""){a.BeginSearch()}}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Features.Packages.ParseQueryString));RegisterNamespace("FreshLogicStudios.Atlas.Features");FreshLogicStudios.Atlas.Features.People=function(c){FreshLogicStudios.Atlas.Plugin.call(this,c);var d=20;var a=this;this.Index=1;this.Who="";function f(){a.Panel.SetIcon("/Features/People/People.png");a.Panel.SetTitle("People");a.RenderPanelHeader();try{pageTracker._trackEvent("People","Open")}catch(g){}}function b(j){if(j.get_statusCode()==200){var n=j.get_xml().getElementsByTagName("Place");for(var h=0;h<n.length;h++){var q=(h+1)+((a.Index-1)*10);var g=(n[h].getElementsByTagName("Address")[0].firstChild)?n[h].getElementsByTagName("Address")[0].firstChild.data:"";var k=(n[h].getElementsByTagName("Name")[0].firstChild)?n[h].getElementsByTagName("Name")[0].firstChild.data:"";var l=(n[h].getElementsByTagName("Phone")[0].firstChild)?n[h].getElementsByTagName("Phone")[0].firstChild.data:"";var m=new VELatLong(n[h].getElementsByTagName("Latitude")[0].firstChild.data,n[h].getElementsByTagName("Longitude")[0].firstChild.data);var r=System.String.Format("{0}<br />{1}",g,l);var p=new FreshLogicStudios.Atlas.Item(k,r,r,m,a.Color,q);a.Items.Add(p)}var o='<div class="PanelBodyHeader">';o+='<div class="Summary">';o+=(a.Items.GetCount()>0)?System.String.Format("Results {0} - {1}",(a.Index-1)*d+1,(a.Index-1)*d+n.length):"";o+="</div>";o+='<div class="Commands">';o+=(a.Index==1)?"":"<a href=\"javascript:Plugins['"+a.GetId()+"'].Index--; Plugins['"+a.GetId()+"'].Refresh();\">Previous</a>";o+=((a.Index!=1)&&(n.length>=d))?" | ":"";o+=(n.length<d)?"":"<a href=\"javascript:Plugins['"+a.GetId()+"'].Index++; Plugins['"+a.GetId()+"'].Refresh();\">Next</a>";o+="</div>";o+="</div>";a.EndSearch();a.Panel.SetBody(System.String.Format("{0}{1}",o,FreshLogicStudios.Atlas.Items.GetSidebarHtml(a.Items)))}else{a.EndSearch()}}function e(h,j,i,l,g,m){var k=new Sys.Net.WebRequest();k.set_url(System.String.Format("/Features/People/People.ashx?who={0}&latitude1={1}&longitude1={2}&latitude2={3}&longitude2={4}&index={5}",h,j,i,l,g,m));k.add_completed(b);k.invoke()}this.RenderPanelHeader=function(){var g='<div class="SearchForm">';g+=System.String.Format('<form name="SearchForm{0}" action="about:blank" method="get" target="hiddenframe" onsubmit="Plugins[\'{0}\'].Who = this.Who.value; Plugins[\'{0}\'].Where = this.Where.value; Plugins[\'{0}\'].BeginSearch(); return false;">',a.GetId());g+="<label>Who: Name or phone number</label>";g+=System.String.Format('<input name="Who" type="text" value="{0}" /><br />',a.Who);g+="<label>Where: Address, city or landmark</label>";g+=System.String.Format('<input type="text" name="Where" value="{0}" onfocus="if(this.value == System.Configuration.Settings.Defaults[\'DefaultWhere\']){this.value=\'\';} else{this.select();}" onblur="if(this.value==\'\'){this.value=System.Configuration.Settings.Defaults[\'DefaultWhere\'];}" /><br />',System.Configuration.Settings.Defaults.DefaultWhere);g+='<button class="Button" type="submit" name="submit" value="Search">Search</button>';g+="</form>";g+="</div>";a.Panel.SetHeader(g);a.Panel.SetHeaderHeight(100)};this.Refresh=function(){a.Panel.SetBody("Loading...");FreshLogicStudios.Atlas.Items.Clear(a.Items);var g=map.GetMapView();e(a.Who,g.TopLeftLatLong.Latitude,g.TopLeftLatLong.Longitude,g.BottomRightLatLong.Latitude,g.BottomRightLatLong.Longitude,a.Index)};this.Search=function(){a.Index=1;if(a.Where.Name!=System.Configuration.Settings.Defaults.DefaultWhere){map.Find(null,a.Where.Name,null,null,null,null,false,false,false,true,a.Refresh)}else{a.Refresh()}};f()};RegisterNamespace("FreshLogicStudios.Atlas.Features");FreshLogicStudios.Atlas.Features.Photos=function(g,c){FreshLogicStudios.Atlas.Plugin.call(this,c);var d=10;var a=this;this.Index=1;this.What=g||"";function f(){a.Panel.SetIcon("/Features/Photos/Photos.png");a.Panel.SetTitle("Photos");a.RenderPanelHeader();try{pageTracker._trackEvent("Photos","Open")}catch(h){}}function b(s){if(s.get_statusCode()==200){var t=s.get_xml().getElementsByTagName("photo");for(var o=0;o<t.length;o++){var k=(o+1)+((a.Index-1)*10);var m=t[o].getAttribute("id");var u=new Date(parseInt(t[o].getAttribute("dateupload"))*1000);u=new System.DateTime(u.getFullYear(),u.getMonth()+1,u.getDate(),u.getHours(),u.getMinutes(),u.getSeconds(),u.getMilliseconds());var h=t[o].getAttribute("owner");var n=t[o].getAttribute("ownername");var v=t[o].getAttribute("secret");var r=t[o].getAttribute("server");var p=t[o].getAttribute("title");p=p==""?"Untitled":p;var w=new VELatLong(t[o].getAttribute("latitude"),t[o].getAttribute("longitude"));var q=System.String.Format('<div class="Photo"><a href="http://www.flickr.com/photos/{0}/{1}" target="_blank" title="{2}"><img alt="{2}" onload="AtlasContextMenu.SetSize(new System.Drawing.Size(276,\'auto\'));" src="http://static.flickr.com/{3}/{1}_{4}_m.jpg" /></a></div>',h,m,p,r,v);var j=System.String.Format('<div class="DetailContent">{0}<br /><a href="http://www.flickr.com/photos/{1}" target="_blank">{2}\'s photos</a></div>',u.ToString("g"),h,n);var x=new FreshLogicStudios.Atlas.Item(p,j,q,w,a.Color,k);a.Items.Add(x)}var l='<div class="PanelBodyHeader">';l+='<div class="Summary">';l+=(a.Items.GetCount()>0)?System.String.Format("Results {0} - {1}",(a.Index-1)*d+1,(a.Index-1)*d+t.length):"";l+="<br />";l+='Data provided by <a href="http://www.flickr.com/" target="_blank">flickr.com</a>';l+="</div>";l+='<div class="Commands">';l+=(a.Index==1)?"":"<a href=\"javascript:Plugins['"+a.GetId()+"'].Index--; Plugins['"+a.GetId()+"'].Refresh();\">Previous</a>";l+=((a.Index!=1)&&(t.length>=d))?" | ":"";l+=(t.length<d)?"":"<a href=\"javascript:Plugins['"+a.GetId()+"'].Index++; Plugins['"+a.GetId()+"'].Refresh();\">Next</a>";l+="</div>";l+="</div>";a.EndSearch();a.Panel.SetBody(System.String.Format("{0}{1}",l,FreshLogicStudios.Atlas.Items.GetSidebarHtml(a.Items)))}else{a.EndSearch()}}function e(o,l,j,n,h,k){var m=new Sys.Net.WebRequest();var i=System.String.Format("http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=c2e6e659a0a5b0f8abc8d81d2c46faca&tags={0}&min_upload_date=1136095200&max_upload_date={1}&bbox={2},{3},{4},{5}&extras=date_upload,owner_name,geo&per_page=10&page={6}",o,parseInt(new Date().getTime()/1000),Math.min(j,h),Math.min(l,n),Math.max(j,h),Math.max(l,n),k);m.set_url(System.String.Format("/Proxy.ashx?uri={0}",encodeURIComponent(i)));m.add_completed(b);m.invoke()}this.RenderPanelHeader=function(){var h='<div class="SearchForm">';h+=System.String.Format('<form name="SearchForm{0}" action="about:blank" method="get" target="hiddenframe" onsubmit="Plugins[\'{0}\'].What = this.What.value; Plugins[\'{0}\'].Where = this.Where.value; Plugins[\'{0}\'].BeginSearch(); return false;">',a.GetId());h+="<label>What: Tag or keyword (optional)</label>";h+=System.String.Format('<input name="What" type="text" value="{0}" /><br />',a.What);h+="<label>Where: Address, city or landmark</label>";h+=System.String.Format('<input id="Where_{0}" type="text" name="Where" value="{1}" onfocus="if(this.value == System.Configuration.Settings.Defaults[\'DefaultWhere\']){this.value=\'\';} else{this.select();}" onblur="if(this.value==\'\'){this.value=System.Configuration.Settings.Defaults[\'DefaultWhere\'];}" /><br />',a.GetId(),System.Configuration.Settings.Defaults.DefaultWhere);h+='<button class="Button" type="submit" name="submit" value="Search">Search</button>';h+="</form>";h+="</div>";a.Panel.SetHeader(h);a.Panel.SetHeaderHeight(100)};this.Refresh=function(){a.Clear();a.Panel.SetBody("Loading...");var h=map.GetMapView();e(a.What,h.TopLeftLatLong.Latitude,h.TopLeftLatLong.Longitude,h.BottomRightLatLong.Latitude,h.BottomRightLatLong.Longitude,a.Index)};this.Search=function(){a.Index=1;if(a.Where.Name!=System.Configuration.Settings.Defaults.DefaultWhere){map.Find(null,a.Where.Name,null,null,null,null,false,false,false,true,a.Refresh)}else{a.Refresh()}};f()};FreshLogicStudios.Atlas.Features.Photos.ParseQueryString=function(){var e=new System.Uri(window.location.href);var c=e.GetQueryParameters();var d=c.photos||c.Photos;if(d){var d=d!="undefined"?d:"";var a=c.where||c.Where;var b=new FreshLogicStudios.Atlas.Features.Photos(d,a);if(d||a){b.BeginSearch()}}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Features.Photos.ParseQueryString));RegisterNamespace("FreshLogicStudios.Atlas.Features");FreshLogicStudios.Atlas.Features.Traffic=function(a){FreshLogicStudios.Atlas.Plugin.call(this,a);var c=this;function b(){map.ShowTraffic();c.Panel.SetIcon("/Features/Traffic/Traffic.png");c.Panel.SetTitle("Traffic");c.Panel.Events.Add(new System.Event("Closed",map.HideTraffic));try{pageTracker._trackEvent("Traffic","Open")}catch(f){}}function d(g){if(g.get_statusCode()==200){var k=g.get_xml().getElementsByTagName("Result");for(var f=0;f<k.length;f++){var h=k[f].getElementsByTagName("Title")[0].firstChild.data;var e=k[f].getElementsByTagName("Description")[0].firstChild.data.split(";")[0];var j=new VELatLong(k[f].getElementsByTagName("Latitude")[0].firstChild.data,k[f].getElementsByTagName("Longitude")[0].firstChild.data);var m=new FreshLogicStudios.Atlas.Item(h,e,e,j,c.Color,f+1);c.Items.Add(m)}}var l='<div class="PanelBodyHeader"><div class="Summary">Data provided by <a href="http://www.yahoo.com/" target="_blank">yahoo.com</a></div></div>';c.EndSearch();c.Panel.SetBody(System.String.Format("{0}{1}",l,FreshLogicStudios.Atlas.Items.GetSidebarHtml(c.Items)))}this.Search=function(){var f=new Sys.Net.WebRequest();var e=System.String.Format("http://api.local.yahoo.com/MapsService/V1/trafficData?appid=freshlogicstudios&latitude={0}&longitude={1}",c.Where.LatLong.Latitude,c.Where.LatLong.Longitude);f.set_url(System.String.Format("/Proxy.ashx?uri={0}",encodeURIComponent(e)));f.add_completed(d);f.invoke()};b()};RegisterNamespace("FreshLogicStudios.Atlas.Features");FreshLogicStudios.Atlas.Features.Videos=function(a){FreshLogicStudios.Atlas.Plugin.call(this,a);var d=10;var c=this;this.Index=1;this.What="";function b(){c.Panel.SetIcon("/Features/Videos/Videos.png");c.Panel.SetTitle("Videos");c.RenderPanelHeader();try{pageTracker._trackEvent("Videos","Open")}catch(f){}}function e(h){if(h.get_statusCode()==200){var j=h.get_xml().getElementsByTagName("item");for(var f=0;f<j.length;f++){var g=FreshLogicStudios.Atlas.GeoRss.Item.FromDom(j[f]);if(g&&g.Shape&&g.Shape.GetPoints().length>0){var l=new FreshLogicStudios.Atlas.Item(g.Title,g.Description,g.Description,g.Shape.GetPoints()[0],c.Color,f+1);c.Items.Add(l)}}var k='<div class="PanelBodyHeader">';k+='<div class="Summary">';k+=(c.Items.GetCount()>0)?System.String.Format("Results {0} - {1}",(c.Index-1)*d+1,(c.Index-1)*d+j.length):"";k+="<br />";k+='Data provided by <a href="http://www.youtube.com/" target="_blank">youtube.com</a>';k+="</div>";k+='<div class="Commands">';k+=(c.Index==1)?"":"<a href=\"javascript:Plugins['"+c.GetId()+"'].Index--; Plugins['"+c.GetId()+"'].Refresh();\">Previous</a>";k+=((c.Index!=1)&&(j.length>=d))?" | ":"";k+=(j.length<d)?"":"<a href=\"javascript:Plugins['"+c.GetId()+"'].Index++; Plugins['"+c.GetId()+"'].Refresh();\">Next</a>";k+="</div>";k+="</div>";c.EndSearch();c.Panel.SetBody(System.String.Format("{0}{1}",k,FreshLogicStudios.Atlas.Items.GetSidebarHtml(c.Items)))}else{c.EndSearch()}}this.RenderPanelHeader=function(){var f='<div class="SearchForm">';f+=System.String.Format('<form name="SearchForm{0}" action="about:blank" method="get" target="hiddenframe" onsubmit="Plugins[\'{0}\'].What = this.What.value; Plugins[\'{0}\'].Where = this.Where.value; Plugins[\'{0}\'].BeginSearch(); return false;">',c.GetId());f+="<label>What: Tag or keyword (optional)</label>";f+=System.String.Format('<input name="What" type="text" value="{0}" /><br />',c.What);f+="<label>Where: Address, city or landmark</label>";f+=System.String.Format('<input type="text" name="Where" value="{0}" onfocus="if(this.value == System.Configuration.Settings.Defaults[\'DefaultWhere\']){this.value=\'\';} else{this.select();}" onblur="if(this.value==\'\'){this.value=System.Configuration.Settings.Defaults[\'DefaultWhere\'];}" /><br />',System.Configuration.Settings.Defaults.DefaultWhere);f+='<button class="Button" type="submit" name="submit" value="Search">Search</button>';f+="</form>";f+="</div>";c.Panel.SetHeader(f);c.Panel.SetHeaderHeight(100)};this.Refresh=function(){c.Clear();c.Panel.SetBody("Loading...");var f=(c.Index*d)-d+1;var g=new Sys.Net.WebRequest();var h=System.String.Format("/Features/Videos/Videos.ashx?q={0}&max-results={1}&start-index={2}&location={3},{4}!&location-radius=500km&alt=rss",c.What,d,f,c.Where.LatLong.Latitude,c.Where.LatLong.Longitude);g.set_url(h);g.add_completed(e);g.invoke()};this.Search=function(){c.Index=1;if(c.Where.Name!=System.Configuration.Settings.Defaults.DefaultWhere){map.Find(null,c.Where.Name,null,null,null,null,false,false,false,true,c.Refresh)}else{c.Refresh()}};b()};FreshLogicStudios.Atlas.Features.Videos.ParseQueryString=function(){var b=new System.Uri(window.location.href);var a=b.GetQueryParameters();if(a.Videos){var c=new FreshLogicStudios.Atlas.Features.Videos();c.What=a.Videos!="undefined"?a.Videos:"";c.RenderPanelHeader();if(c.What!=""){c.BeginSearch()}}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Features.Videos.ParseQueryString));RegisterNamespace("FreshLogicStudios.Atlas.Features");FreshLogicStudios.Atlas.Features.Weather=function(a){FreshLogicStudios.Atlas.Plugin.call(this,a);var c=this;this.Index=1;function b(){c.Panel.SetIcon("/Features/Weather/Weather.png");c.Panel.SetTitle("Weather");c.RenderPanelHeader();try{pageTracker._trackEvent("Weather","Open")}catch(f){}}function d(p){if(p.get_statusCode()==200){var f=p.get_xml().getElementsByTagName("item");var o=new Array();for(var l=0;l<f.length;l++){var j=(l+1);var n=(f[l].getElementsByTagName("description")[0].firstChild)?f[l].getElementsByTagName("description")[0].firstChild.data:"";var m=(f[l].getElementsByTagName("title")[0].firstChild)?f[l].getElementsByTagName("title")[0].firstChild.data:"";var k=null;var g=null;if(k==null||g==null){if(f[l].getElementsByTagName("georss:point").length>0){try{var h=f[l].getElementsByTagName("georss:point")[0].firstChild.data;k=h.split(" ")[0];g=h.split(" ")[1]}catch(q){}}}if(k==null||g==null){if(f[l].getElementsByTagName("point").length>0){try{var h=f[l].getElementsByTagName("point")[0].firstChild.data;k=h.split(" ")[0];g=h.split(" ")[1]}catch(q){}}}var r=new VELatLong(parseFloat(k),parseFloat(g));var s=new FreshLogicStudios.Atlas.Item(m,n,n,r,c.Color,j);c.Items.Add(s);o.push(r)}c.EndSearch();c.Panel.SetBody(FreshLogicStudios.Atlas.Items.GetSidebarHtml(c.Items))}else{c.EndSearch()}}function e(g,h,f,j){var i=new Sys.Net.WebRequest();i.set_url(System.String.Format("/Features/Weather/Weather.ashx?north={0}&south={1}&east={2}&west={3}",g,h,f,j));i.add_completed(d);i.invoke()}this.Refresh=function(){c.Panel.SetBody("Loading...");FreshLogicStudios.Atlas.Items.Clear(c.Items);var f=map.GetMapView();e(f.TopLeftLatLong.Latitude,f.BottomRightLatLong.Latitude,f.TopLeftLatLong.Longitude,f.BottomRightLatLong.Longitude)};this.Search=function(){c.Index=1;if(c.Where.Name!=System.Configuration.Settings.Defaults.DefaultWhere){map.Find(null,c.Where.Name,null,null,null,null,false,false,false,true,c.Refresh)}else{c.Refresh()}};b()};FreshLogicStudios.Atlas.Features.Weather.ParseQueryString=function(){var c=new System.Uri(window.location.href);var b=c.GetQueryParameters();if(b.Weather){var a=new FreshLogicStudios.Atlas.Features.Weather();a.Where=b.Weather!="undefined"?b.Weather:"";if(a.Where!=""){a.BeginSearch()}}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Features.Weather.ParseQueryString));RegisterNamespace("FreshLogicStudios.Atlas.Features");FreshLogicStudios.Atlas.Features.WiFi=function(a){FreshLogicStudios.Atlas.Plugin.call(this,a);var d=this;function b(){d.Panel.SetIcon("/Features/WiFi/WiFi.png");d.Panel.SetTitle("WiFi");d.Panel.SetFooterHeight(75);try{pageTracker._trackEvent("WiFi","Open")}catch(f){}}function c(g){var f=new Sys.Net.WebRequest();f.set_url(System.String.Format("/Features/WiFi/WiFi.ashx?zip={0}",g));f.add_completed(e);f.invoke()}function e(q){if(q.get_statusCode()==200){var l=q.get_xml().getElementsByTagName("Hotspot");for(var n=0;n<l.length;n++){if(l[n].getElementsByTagName("Position").length>0){var o=l[n].getElementsByTagName("Name")[0].firstChild.data;var g=l[n].getElementsByTagName("SSID")[0].firstChild.data;var m=l[n].getElementsByTagName("Provider")[0].firstChild.data;var p=l[n].getElementsByTagName("Address1")[0].firstChild.data;var f=l[n].getElementsByTagName("Address2")[0].firstChild.data;var t=new VELatLong(l[n].getElementsByTagName("Latitude")[0].firstChild.data,l[n].getElementsByTagName("Longitude")[0].firstChild.data);var r=System.String.Format("{0}<br />{1}<br />SSID: {2}<br />Provider: {3}",p,f,g,m);var v=new FreshLogicStudios.Atlas.Item(o,r,r,t,d.Color,n+1);d.Items.Add(v)}}var u=q.get_xml().getElementsByTagName("Ad");var h="";for(var n=0;n<u.length;n++){var o=u[n].getElementsByTagName("Title")[0].firstChild.data;var j=u[n].getElementsByTagName("Description")[0].firstChild.data;var s=u[n].getElementsByTagName("Uri")[0].firstChild.data;h+=System.String.Format('<div><a href="{0}" target="_blank">{1}</a></div>',s,o);h+=j}d.Panel.SetFooter(h)}var k='<div class="PanelBodyHeader"><div class="Summary">Data provided by <a href="http://www.hotspothaven.com/" target="_blank">hotspothaven.com</a></div></div>';d.EndSearch();d.Panel.SetBody(System.String.Format("{0}{1}",k,FreshLogicStudios.Atlas.Items.GetSidebarHtml(d.Items)))}this.Search=function(){FreshLogicStudios.Atlas.Web.WebService.GetPostalCode(d.Where.LatLong.Latitude,d.Where.LatLong.Longitude,function(f){c(f)})};b()};RegisterNamespace("FreshLogicStudios.Atlas.Features");FreshLogicStudios.Atlas.Features.Wikipedia=function(a){FreshLogicStudios.Atlas.Plugin.call(this,a);var c=this;function b(){c.Panel.SetIcon("/Features/Wikipedia/Wikipedia.png");c.Panel.SetTitle("Wikipedia");try{pageTracker._trackEvent("Wikipedia","Open")}catch(f){}}function d(p){if(p.get_statusCode()==200){var f=p.get_xml().getElementsByTagName("item");var o=new Array();for(var l=0;l<f.length;l++){var j=(l+1);var n=(f[l].getElementsByTagName("description")[0].firstChild)?f[l].getElementsByTagName("description")[0].firstChild.data:"";var m=(f[l].getElementsByTagName("title")[0].firstChild)?f[l].getElementsByTagName("title")[0].firstChild.data:"";var k=null;var g=null;if(k==null||g==null){if(f[l].getElementsByTagName("georss:point").length>0){try{var h=f[l].getElementsByTagName("georss:point")[0].firstChild.data;k=h.split(" ")[0];g=h.split(" ")[1]}catch(q){}}}if(k==null||g==null){if(f[l].getElementsByTagName("point").length>0){try{var h=f[l].getElementsByTagName("point")[0].firstChild.data;k=h.split(" ")[0];g=h.split(" ")[1]}catch(q){}}}var r=new VELatLong(parseFloat(k),parseFloat(g));var s=new FreshLogicStudios.Atlas.Item(m,n,n,r,c.Color,j);c.Items.Add(s);o.push(r)}c.EndSearch();c.Panel.SetBody(System.String.Format("{0}",FreshLogicStudios.Atlas.Items.GetSidebarHtml(c.Items)))}else{c.EndSearch()}}this.Search=function(){var e=new Sys.Net.WebRequest();e.set_url(System.String.Format("/Features/Wikipedia/Wikipedia.ashx?Latitude={0}&Longitude={1}",c.Where.LatLong.Latitude,c.Where.LatLong.Longitude));e.add_completed(d);e.invoke()};b()};FreshLogicStudios.Atlas.Features.Wikipedia.ParseQueryString=function(){var c=new System.Uri(window.location.href);var b=c.GetQueryParameters();if(b.Wikipedia){var a=new FreshLogicStudios.Atlas.Features.Wikipedia();a.Where=b.Wikipedia!="undefined"?b.Wikipedia:"";if(a.Where!=""){a.BeginSearch()}}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Features.Wikipedia.ParseQueryString));RegisterNamespace("FreshLogicStudios.Atlas.Feeds.AP");FreshLogicStudios.Atlas.Feeds.AP.Open=function(){var a=new GeoRss();a.Panel.SetIcon("/Feeds/AP/AP.png");a.Panel.SetTitle("Associated Press");a.UpdateInterval=60000;a.Uri="http://ws.geonames.org/rssToGeoRSS?feedUrl=http://hosted.ap.org/lineups/TOPHEADS-rss_2.0.xml?SITE=NYPLA&SECTION=HOME";a.Update();try{pageTracker._trackEvent("AP","Open")}catch(b){}};FreshLogicStudios.Atlas.Feeds.AP.ParseQueryString=function(){var a=new System.Uri(window.location.href);var b=a.GetQueryParameters();if(b.AP){FreshLogicStudios.Atlas.Feeds.AP.Open()}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Feeds.AP.ParseQueryString));RegisterNamespace("FreshLogicStudios.Atlas.Feeds.Election");FreshLogicStudios.Atlas.Feeds.Election.Open=function(){var a=new GeoRss();a.Panel.SetIcon("/Feeds/Election/Election.png");a.Panel.SetTitle("Election");a.UpdateInterval=2000;a.Uri="/Feeds/Election/Election.ashx";a.Update();try{pageTracker._trackEvent("Election","Open")}catch(b){}};FreshLogicStudios.Atlas.Feeds.Election.ParseQueryString=function(){var a=new System.Uri(window.location.href);var b=a.GetQueryParameters();if(b.Election){FreshLogicStudios.Atlas.Feeds.Election.Open()}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Feeds.Election.ParseQueryString));RegisterNamespace("FreshLogicStudios.Atlas.Feeds.Flickr");FreshLogicStudios.Atlas.Feeds.Flickr.Open=function(){var a=new GeoRss();a.Panel.SetIcon("/Feeds/Flickr/Flickr.png");a.Panel.SetTitle("Flickr");a.UpdateInterval=5000;a.Uri="http://api.flickr.com/services/feeds/photos_public.gne?format=rss2&tags=geotagged&georss=1";a.Update();try{pageTracker._trackEvent("Flickr","Open")}catch(b){}};FreshLogicStudios.Atlas.Feeds.Flickr.ParseQueryString=function(){var a=new System.Uri(window.location.href);var b=a.GetQueryParameters();if(b.Flickr){FreshLogicStudios.Atlas.Feeds.Flickr.Open()}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Feeds.Flickr.ParseQueryString));RegisterNamespace("FreshLogicStudios.Atlas.Feeds.Npr");FreshLogicStudios.Atlas.Feeds.Npr.Open=function(){var a=new GeoRss();a.Panel.SetIcon("/Feeds/Npr/Npr.png");a.Panel.SetTitle("National Public Radio");a.UpdateInterval=60000;a.Uri="http://ws.geonames.org/rssToGeoRSS?feedUrl=http://www.npr.org/rss/rss.php?id=1001";a.Update();try{pageTracker._trackEvent("NPR","Open")}catch(b){}};FreshLogicStudios.Atlas.Feeds.Npr.ParseQueryString=function(){var a=new System.Uri(window.location.href);var b=a.GetQueryParameters();if(b.NPR){FreshLogicStudios.Atlas.Feeds.Npr.Open()}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Feeds.Npr.ParseQueryString));RegisterNamespace("FreshLogicStudios.Atlas.Feeds.TheWeatherChannel");FreshLogicStudios.Atlas.Feeds.TheWeatherChannel.Open=function(){var a=new GeoRss();a.Panel.SetIcon("/Feeds/TheWeatherChannel/TheWeatherChannel.png");a.Panel.SetTitle("The Weather Channel");a.UpdateInterval=60000;a.Uri="/Feeds/TheWeatherChannel/TheWeatherChannel.ashx";a.Update();try{pageTracker._trackEvent("The Weather Channel","Open")}catch(b){}};FreshLogicStudios.Atlas.Feeds.TheWeatherChannel.ParseQueryString=function(){var a=new System.Uri(window.location.href);var b=a.GetQueryParameters();if(b.Weather){FreshLogicStudios.Atlas.Feeds.TheWeatherChannel.Open()}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Feeds.TheWeatherChannel.ParseQueryString));RegisterNamespace("FreshLogicStudios.Atlas.Feeds.YouTube");FreshLogicStudios.Atlas.Feeds.YouTube.Open=function(){var a=new GeoRss();a.Panel.SetIcon("/Feeds/YouTube/YouTube.png");a.Panel.SetTitle("YouTube");a.Uri="/Feeds/YouTube/YouTube.ashx";a.Update();try{pageTracker._trackEvent("YouTube","Open")}catch(b){}};FreshLogicStudios.Atlas.Feeds.YouTube.ParseQueryString=function(){var a=new System.Uri(window.location.href);var b=a.GetQueryParameters();if(b.YouTube){FreshLogicStudios.Atlas.Feeds.YouTube.Open()}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Feeds.YouTube.ParseQueryString));RegisterNamespace("FreshLogicStudios.Atlas.GeoRss");FreshLogicStudios.Atlas.GeoRss.Channel=function(){var a=this;this.Description="";this.Items=new System.Collections.ArrayList();this.Link="http://www.freshlogicstudios.com/Products/Atlas/GeoRss.aspx";this.TimeToLive=null;this.Title="";this.ContainsItem=function(b){for(var c=0;c<a.Items.GetCount();c++){if(a.Items.GetItem(c).Equals(b)){return true}}return false};this.GetUniqueItems=function(d){var c=new Array();for(var b=0;b<d.length;b++){if(!a.ContainsItem(d[b])){c.push(d[b])}}return c}};FreshLogicStudios.Atlas.GeoRss.Channel.FromDom=function(f){var d=new FreshLogicStudios.Atlas.GeoRss.Channel();try{d.Description=f.getElementsByTagName("description").length>0?f.getElementsByTagName("description")[0].firstChild.data:""}catch(c){}try{d.Link=f.getElementsByTagName("link").length>0?f.getElementsByTagName("link")[0].firstChild.data:""}catch(c){}try{d.TimeToLive=f.getElementsByTagName("ttl").length>0?f.getElementsByTagName("ttl")[0].firstChild.data:null}catch(c){}try{d.Title=f.getElementsByTagName("title").length>0?f.getElementsByTagName("title")[0].firstChild.data:""}catch(c){}var a=f.getElementsByTagName("item");for(var b=0;b<a.length;b++){d.Items.Add(FreshLogicStudios.Atlas.GeoRss.Item.FromDom(a[b]))}return d};function GeoRss(){var j=Pushpin.GetNextColor();var c=1;var e=System.Guid.NewGuid();var h=new System.Collections.ArrayList();var f=new VEShapeLayer();var i=100;var b=this;var g=null;this.Channel=new FreshLogicStudios.Atlas.GeoRss.Channel();this.Panel=new Panel(System.Guid.NewGuid());this.UpdateInterval=null;this.Uri="";function a(){b.Panel=new Panel("GeoRssPanel"+e);b.Panel.SetBody("Loading...");b.Panel.SetIcon("/GeoRss/GeoRss.png");b.Panel.SetTitle("GeoRSS");b.Panel.Events.Add(new System.Event("Closed",function(k){b.Clear()}));Sidebar.Add(b.Panel);map.AddShapeLayer(f)}function d(m){if(!b.Panel.IsVisible()){return}if(m.get_statusCode()==200){var p=FreshLogicStudios.Atlas.GeoRss.Channel.FromDom(m.get_xml());b.Channel.Link=p.Link;b.Channel.Description=p.Description;b.Channel.Title=p.Title;if(b.UpdateInterval==null&&p.TimeToLive!=null){b.UpdateInterval=p.TimeToLive*60*1000}var o=b.Channel.GetUniqueItems(p.Items.ToArray());b.Channel.Items.AddRange(o);if(b.Channel.Items.GetCount()>i){b.Channel.Items.RemoveRange(0,b.Channel.Items.GetCount()-i)}var n='<div class="PanelBodyHeader">';n+='<div class="Summary">';n+=System.String.Format('<a href="{0}" target="_blank">{1}</a><br />{2}',b.Channel.Link,b.Channel.Title,b.Channel.Description);n+="</div>";n+="</div>";n+="<ul>";for(var k=o.length-1;k>=0;k--){var r=o[k];if(r.Shape&&r.Shape.GetType()==VEShapeType.Pushpin){var q=r.Description;if(r.Link){q+=System.String.Format('<div><a href="{0}" target="_blank">more...</a></div>',r.Link)}var u=new FreshLogicStudios.Atlas.Item(r.Title,q,q,r.Shape.GetPoints()[0],j,c++);h.Add(u);u.ShowPushpin()}if(r.Shape&&(r.Shape.GetType()==VEShapeType.Polyline||r.Shape.GetType()==VEShapeType.Polygon)){r.Shape.HideIcon();f.AddShape(r.Shape);var q=r.Description;if(r.Link){q+=System.String.Format('<div><a href="{0}" target="_blank">more...</a></div>',r.Link)}var u=new FreshLogicStudios.Atlas.Item(r.Title,q,q,r.Shape.GetIconAnchor(),j,c++);h.Add(u);u.ShowPushpin()}if(h.GetCount()>i){h.GetItem(0).HidePushpin();h.RemoveAt(0)}if(c>=1000){c=1}}if(o.length>0){try{var t=h.GetItem(h.GetCount()-1);t.Center();t.ShowContextMenu()}catch(s){}}if(b.UpdateInterval){for(var k=h.GetCount()-1;k>=0;k--){n+=h.GetItem(k).GetSidebarHtml()}}else{for(var k=0;k<h.GetCount();k++){n+=h.GetItem(k).GetSidebarHtml()}}n+="</ul>";b.Panel.SetBody(n)}else{map.ShowMessage(System.String.Format("An error occured while loading data.  {0}: {1}",m.get_statusCode(),m.get_statusText()))}if(!g){var l=new System.Uri(window.location.href).GetQueryParameters();if(!l.lvl||l.lvl!=map.GetZoomLevel()){FreshLogicStudios.Atlas.Items.ZoomToFit(h)}}if(b.UpdateInterval){g=window.setTimeout(b.Update,b.UpdateInterval)}}this.Clear=function(){if(g){window.clearTimeout(g)}map.DeleteShapeLayer(f);FreshLogicStudios.Atlas.Items.Clear(h);b.Panel.Hide();Sidebar.Remove(b.Panel)};this.GetId=function(){return e};this.Update=function(){var l=new Sys.Net.WebRequest();var k=System.String.Format("/Proxy.ashx?uri={0}",encodeURIComponent(b.Uri));l.set_url(k);l.add_completed(d);l.invoke()};a()}GeoRss.Initialize=function(){var c=new System.Uri(window.location.href);var b=c.GetQueryParameters();var d=null;var a=null;if(b.georss){d=b.georss}if(b.rss){d=System.String.Format("http://ws.geonames.org/rssToGeoRSS?feedUrl={0}",encodeURIComponent(b.rss))}if(b.GeoRssUri){d=b.GeoRssUri}if(b.RssUri){d=System.String.Format("http://ws.geonames.org/rssToGeoRSS?feedUrl={0}",encodeURIComponent(b.RssUri))}if(b.GeoRssUpdateInterval){a=parseInt(b.GeoRssUpdateInterval)*1000}if(d){GeoRss.Populate(d,a)}};GeoRss.Populate=function(c,a){var b=new GeoRss();b.UpdateInterval=a;b.Uri=c;b.Update()};Events.Add(new System.Event("MapLoaded",GeoRss.Initialize));RegisterNamespace("FreshLogicStudios.Atlas.GeoRss");FreshLogicStudios.Atlas.GeoRss.Item=function(){var a=this;this.Description="";this.Link=null;this.Shape=null;this.Title="Untitled";this.Equals=function(b){if(a.Description!=b.Description){return false}else{if(a.Title!=b.Title){return false}}return true}};FreshLogicStudios.Atlas.GeoRss.Item.FromDom=function(d){var h=new FreshLogicStudios.Atlas.GeoRss.Item();try{h.Description=d.getElementsByTagName("description").length>0?d.getElementsByTagName("description")[0].firstChild.data:""}catch(f){}try{h.Link=d.getElementsByTagName("link").length>0?d.getElementsByTagName("link")[0].firstChild.data:""}catch(f){}try{h.Title=d.getElementsByTagName("title").length>0?d.getElementsByTagName("title")[0].firstChild.data:""}catch(f){}var c=FreshLogicStudios.Atlas.GeoRss.Item.TryParsePushpin(d);if(c){h.Shape=c;return h}var b=FreshLogicStudios.Atlas.GeoRss.Item.TryParsePolyline(d);if(b){h.Shape=b;return h}var g=FreshLogicStudios.Atlas.GeoRss.Item.TryParsePolygon(d);if(g){h.Shape=g;return h}var a=FreshLogicStudios.Atlas.GeoRss.Item.TryParseBox(d);if(a){h.Shape=a;return h}return h};FreshLogicStudios.Atlas.GeoRss.Item.TryParseBox=function(c){var b=null;var a=new Array();if(a.length==0){try{a=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(c.getElementsByTagName("georss:box")[0].firstChild.data)}catch(g){}}if(a.length==0){try{a=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(c.getElementsByTagName("box")[0].firstChild.data)}catch(g){}}if(a.length==0){try{var d=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(c.getElementsByTagName("gml:Envelope")[0].getElementsByTagName("gml:lowerCorner")[0].firstChild.data);var h=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(c.getElementsByTagName("gml:Envelope")[0].getElementsByTagName("gml:upperCorner")[0].firstChild.data);a.push(d);a.push(h)}catch(g){}}if(a.length==0){try{var d=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(c.getElementsByTagName("Envelope")[0].getElementsByTagName("lowerCorner")[0].firstChild.data);var h=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(c.getElementsByTagName("Envelope")[0].getElementsByTagName("upperCorner")[0].firstChild.data);a.push(d);a.push(h)}catch(g){}}if(a.length&&a.length==2){try{var f=new Array();f.push(a[0]);f.push(new VELatLong(a[0].Latitude,a[1].Longitude));f.push(a[1]);f.push(new VELatLong(a[1].Latitude,a[0].Longitude));b=new VEShape(VEShapeType.Polygon,f)}catch(g){}}return b};FreshLogicStudios.Atlas.GeoRss.Item.TryParsePushpin=function(d){var c=null;var f=null;var b=null;if(f==null||b==null){try{f=d.getElementsByTagName("geo:lat").length>0?d.getElementsByTagName("geo:lat")[0].firstChild.data:null;b=d.getElementsByTagName("geo:long").length>0?d.getElementsByTagName("geo:long")[0].firstChild.data:null}catch(g){}}if(f==null||b==null){try{f=d.getElementsByTagName("lat").length>0?d.getElementsByTagName("lat")[0].firstChild.data:null;b=d.getElementsByTagName("long").length>0?d.getElementsByTagName("long")[0].firstChild.data:null}catch(g){}}if(f==null||b==null){if(d.getElementsByTagName("georss:point").length>0){try{var a=d.getElementsByTagName("georss:point")[0].firstChild.data;f=a.split(" ")[0];b=a.split(" ")[1]}catch(g){}}}if(f==null||b==null){if(d.getElementsByTagName("point").length>0){try{var a=d.getElementsByTagName("point")[0].firstChild.data;f=a.split(" ")[0];b=a.split(" ")[1]}catch(g){}}}if(f==null||b==null){if(d.getElementsByTagName("gml:pos").length>0){try{var a=d.getElementsByTagName("gml:pos")[0].firstChild.data;f=a.split(" ")[0];b=a.split(" ")[1]}catch(g){}}}if(f==null||b==null){if(d.getElementsByTagName("pos").length>0){try{var a=d.getElementsByTagName("pos")[0].firstChild.data;f=a.split(" ")[0];b=a.split(" ")[1]}catch(g){}}}if(f&&b){try{c=new VEShape(VEShapeType.Pushpin,new VELatLong(parseFloat(f),parseFloat(b)))}catch(g){}}return c};FreshLogicStudios.Atlas.GeoRss.Item.TryParsePolygon=function(d){var a=null;var b=new Array();if(b.length==0){try{b=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(d.getElementsByTagName("georss:polygon")[0].firstChild.data)}catch(c){}}if(b.length==0){try{b=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(d.getElementsByTagName("polygon")[0].firstChild.data)}catch(c){}}if(b.length==0){try{b=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(d.getElementsByTagName("gml:Polygon")[0].getElementsByTagName("gml:posList")[0].firstChild.data)}catch(c){}}if(b.length==0){try{b=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(d.getElementsByTagName("Polygon")[0].getElementsByTagName("posList")[0].firstChild.data)}catch(c){}}if(b.length&&b.length>=3){try{a=new VEShape(VEShapeType.Polygon,b)}catch(c){}}return a};FreshLogicStudios.Atlas.GeoRss.Item.TryParsePolyline=function(d){var b=null;var a=new Array();if(a.length==0){try{a=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(d.getElementsByTagName("georss:line")[0].firstChild.data)}catch(c){}}if(a.length==0){try{a=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(d.getElementsByTagName("line")[0].firstChild.data)}catch(c){}}if(a.length==0){try{a=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(d.getElementsByTagName("gml:LineString")[0].getElementsByTagName("gml:posList")[0].firstChild.data)}catch(c){}}if(a.length==0){try{a=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(d.getElementsByTagName("LineString")[0].getElementsByTagName("posList")[0].firstChild.data)}catch(c){}}if(a.length&&a.length>=2){try{b=new VEShape(VEShapeType.Polyline,a)}catch(c){}}return b};FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints=function(a){var c=new Array();var d=a.split(" ");for(var b=0;b<d.length;b=b+2){c.push(new VELatLong(parseFloat(d[b]),parseFloat(d[b+1])))}return c};function Menu(){var e=this;var c=new System.Drawing.Point(0,0);this.Menus=new Array();this.Events=new System.EventCollection();function d(g){for(var f=0;f<e.Menus.length;f++){if(e.Menus[f]!=g){e.Menus[f].Minimize(false)}}}function a(g){for(var f=0;f<e.Menus.length;f++){if(e.Menus[f]!=g.GetId()&&(e.Menus[f].IsMinimizing()||e.Menus[f].IsMaximizing())){return}}e.Events.Fire("MenuResized")}function b(g){for(var f=0;f<e.Menus.length;f++){if(e.Menus[f]!=g.GetId()&&(e.Menus[f].IsMinimizing()||e.Menus[f].IsMaximizing())){return}}e.Events.Fire("MenuResized")}this.Add=function(g){var h=0;for(var f=0;f<this.Menus.length;f++){h+=this.Menus[f].GetTabWidth()}this.Menus.push(g);g.SetTabOffset(h);g.Minimize();g.Events.Add(new System.Event("Minimized",function(i){a(i)}));g.Events.Add(new System.Event("Maximizing",function(i){d(i)}));g.Events.Add(new System.Event("Maximized",function(i){b(i)}));e.MinimizeAll();g.Maximize()};this.GetHeight=function(){var h=0;for(var f=0;f<this.Menus.length;f++){var g=this.Menus[f].GetCurrentSize().Height;if(g>h){h=g}}return h};this.MinimizeAll=function(){for(var f=0;f<this.Menus.length;f++){this.Menus[f].Minimize()}};this.Remove=function(f){for(var g=this.Menus.length-1;g>=0;g--){if(this.Menus[g].GetId()==f.GetId()){this.Menus.splice(g,1)}}}}function MenuItem(v){var k=this;var d="";var o=v;var y=null;var l=false;var s=null;var f=null;var x=false;var z=false;var h=0;var r=false;var a=false;var p=null;var g=null;var c=null;var n=null;var i=null;var j=null;var m=null;var e=null;var q=null;this.Events=new System.EventCollection();function b(){return parseInt(c.style.top.substring(0,c.style.top.indexOf("px")))}function u(){c=document.getElementById(o);var B=c.innerHTML;var A='<a class="Logo" href="http://www.freshlogicstudios.com"><img alt="Fresh Logic Studios" src="/Menu/Images/Logo.gif" /></a>';n=document.createElement("div");i=document.createElement("div");j=document.createElement("div");m=document.createElement("div");e=document.createElement("div");q=document.createElement("a");n.className="Content";i.className="Tab";j.className="Left";m.className="Center";e.className="Right";n.style.height=c.offsetHeight+"px";q.innerHTML=c.title;q.href="#";q.onclick=function(){return false};m.appendChild(q);i.appendChild(j);i.appendChild(m);i.appendChild(e);c.innerHTML="";c.oncontextmenu=function(){return false};c.appendChild(n);c.appendChild(i);n.innerHTML=A+B;c.style.top=(-1*n.offsetHeight)+"px";c.style.visibility="visible"}function t(){if(z){var E=100;var C=400;var A=((new Date()).getTime()-f)/1000;var B=(E*A)+(0.5*C*(Math.pow(A,2)));var D=b()+B;D=D-(D%1);if(D>=0){z=false;x=false;c.style.top="0px";k.Events.Fire("Maximized",k)}else{c.style.top=D+"px";window.setTimeout(function(){t()},20)}}}function w(){if(x){var E=100;var C=400;var A=((new Date()).getTime()-f)/1000;var B=(E*A)+(0.5*C*(Math.pow(A,2)));var D=b()-B;D=D-(D%1);if(D<=(-1*k.GetSize().Height)){z=false;x=false;c.style.top=(-1*k.GetSize().Height)+"px";k.Events.Fire("Minimized",k)}else{c.style.top=D+"px";window.setTimeout(function(){w()},20)}}}this.GetElement=function(){return c};this.GetId=function(){return o};this.GetSize=function(){return new System.Drawing.Size(n.offsetWidth,n.offsetHeight)};this.GetCurrentSize=function(){var A=n.offsetHeight+i.offsetHeight;var B=parseInt(c.style.top.substring(0,c.style.top.indexOf("px")));return new System.Drawing.Size(parseInt(c.style.width.substring(0,c.style.width.indexOf("px"))),A+B)};this.GetTabWidth=function(){return i.offsetWidth};this.IsMinimized=function(){return l};this.IsMinimizing=function(){return x};this.IsMaximizing=function(){return z};this.Maximize=function(){if(l){s=window.clearTimeout(s);z=true;x=false;l=false;k.Events.Fire("Maximizing",k);c.style.zIndex="10000";i.onclick=function(){k.Minimize(true);return false};q.style.backgroundImage="url(/Menu/Images/Tab/Minimize.gif)";f=(new Date()).getTime();window.setTimeout(function(){t()},10)}};this.Minimize=function(){if(!l){k.Events.Fire("Minimizing",k);c.style.zIndex="11000";i.onclick=function(){k.Maximize(true);return false};q.style.backgroundImage="url(/Menu/Images/Tab/Maximize.gif)";s=window.clearTimeout(s);z=false;x=true;l=true;f=(new Date()).getTime();window.setTimeout(function(){w()},10)}};this.SetTabOffset=function(A){i.style.right=A+"px"};u()}Panel.DefaultSize=new System.Drawing.Size(240,"auto");Panel.MinimumSize=new System.Drawing.Size(44,49);function Panel(p){var u=this;var K="";var l=p;var e=null;var H=false;var b=Panel.DefaultSize.Clone();var o=null;var f=null;var E=false;var v=false;var G=0;var L=null;var y=null;var q=null;var M=null;var B=null;var i=null;var c=null;var O=null;var C=null;var j=null;var I=null;var t=null;var N=null;var d=null;var F=null;var w=null;var k=null;var J=null;var n=null;var r=null;var h=null;var m=null;var s=null;var A=null;this.Events=new System.EventCollection();function x(){var W=M.style.display;var T=M.style.height;var U=s.style.display;var V=m.style.display;var S=A.style.display;var R=s.style.height;M.style.display="block";s.style.display="block";m.style.display="block";A.style.display="block";M.style.height="auto";s.style.height="auto";var Q=Math.max(s.offsetHeight,s.scrollHeight);if(s.innerHTML==""){Q=0}M.style.display=W;s.style.display=U;m.style.display=V;A.style.display=S;M.style.height=T;s.style.height=R;return Panel.MinimumSize.Height+(L.Height>0?L.Height+15:5)+(Q>0?Q+10:0)+(y.Height>0?y.Height+5:0)}function z(){q=document.createElement("div");M=document.createElement("div");B=document.createElement("div");i=document.createElement("div");c=document.createElement("div");O=document.createElement("div");C=document.createElement("div");j=document.createElement("div");I=document.createElement("div");t=document.createElement("div");N=document.createElement("div");d=document.createElement("div");F=document.createElement("div");w=document.createElement("div");k=document.createElement("div");J=document.createElement("div");n=document.createElement("div");r=document.createElement("a");h=document.createElement("img");m=document.createElement("div");s=document.createElement("div");A=document.createElement("div");q.id=l;q.oncontextmenu=function(){return false};q.className="Panel";O.className="Header";j.className="Left";I.className="Right";t.className="Center";M.className="Body";B.className="Left";i.className="Right";c.className="Center";C.className="Footer";N.className="Left";d.className="Right";F.className="Center";w.className="EventLayer";m.className="ContentHeader";s.className="ContentBody";A.className="ContentFooter";O.appendChild(j);O.appendChild(I);O.appendChild(t);M.appendChild(B);M.appendChild(i);M.appendChild(c);C.appendChild(N);C.appendChild(d);C.appendChild(F);c.appendChild(m);c.appendChild(s);c.appendChild(A);q.appendChild(w);q.appendChild(O);q.appendChild(M);q.appendChild(C);k.className="TitleBar";J.className="Icon";n.className="Title";r.className="CloseButton";h.className="MinMaxButton";r.innerHTML="x";r.href="#";r.title="Close";r.onclick=function(){u.Close();return false};h.src="/Panel/Images/Minimize.gif";h.alt="Minimize";h.onclick=function(){u.Minimize(true);return false};k.appendChild(J);k.appendChild(n);k.appendChild(r);k.appendChild(h);O.appendChild(k);var Q=document.getElementById("Panels");if(!Q){Q=document.createElement("div");Q.id="Panels";document.body.appendChild(Q)}Q.appendChild(q);L=new System.Drawing.Size(b.Width-Panel.MinimumSize.Width,0);y=new System.Drawing.Size(b.Width-Panel.MinimumSize.Width,0);u.SetLocation(e);u.SetSize(b)}function a(W){var S=W-Panel.MinimumSize.Height;var Q=S-10;var R=(L.Height>0)?L.Height+10:0;var T=(y.Height>0)?y.Height+5:0;if(W<Panel.MinimumSize.Height){W=Panel.MinimumSize.Height}if(R+T>S){A.style.display="none";if(R>S){m.style.display="none"}else{if(L.Height>0){m.style.display="block";Q-=R}else{m.style.display="none"}}}else{if(L.Height>0){m.style.display="block";Q-=R}else{m.style.display="none"}if(y.Height>0){A.style.display="block";Q-=T}else{A.style.display="none"}}Q=Math.max(0,Q);s.style.display=(Q>0)?"block":"none";m.style.height=L.Height+"px";A.style.height=y.Height+"px";s.style.height=Q+"px";var V=10;if(m.style.display=="block"){m.style.top="10px";s.style.top=(10+L.Height+10)+"px";V+=L.Height;V+=10}else{s.style.top="10px"}if(s.style.display=="block"){V+=Q;V+=10}A.style.top=V+"px";q.style.height=W+"px";w.style.height=W+"px";var U="2px";if(S>2){U=S+"px"}M.style.height=U;B.style.height=U;i.style.height=U;c.style.height=U}function P(Q){Q+=18;if(Q<Panel.MinimumSize.Width){Q=Panel.MinimumSize.Width}L.Width=Q-Panel.MinimumSize.Width;y.Width=Q-Panel.MinimumSize.Width;q.style.width=Q+"px";O.style.width=Q+"px";t.style.width=Q-Panel.MinimumSize.Width+"px";C.style.width=Q+"px";F.style.width=Q-Panel.MinimumSize.Width+"px";M.style.width=Q+"px";c.style.width=Q-Panel.MinimumSize.Width+"px";m.style.width=Q-Panel.MinimumSize.Width+"px";s.style.width=Q-Panel.MinimumSize.Width+"px";A.style.width=Q-Panel.MinimumSize.Width+"px";w.style.width=Q+"px";k.style.width=Q-30+"px";n.style.width=(Q-30)-25-((K==""||K==null)?0:37)}function g(T){if(v){var V=200;var S=400;var U=((new Date()).getTime()-f)/1000;var Q=(V*U)+(0.5*S*(Math.pow(U,2)));var R=u.GetCurrentSize().Height+Q;R=R-(R%1);if(R>=T){v=false;E=false;a(T);s.style.overflow="auto";u.Events.Fire("Maximized",u)}else{a(R);window.setTimeout(function(){g(T)},20)}}}function D(T){if(E){var V=200;var S=400;var U=((new Date()).getTime()-f)/1000;var Q=(V*U)+(0.5*S*(Math.pow(U,2)));var R=u.GetCurrentSize().Height-Q;R=R-(R%1);if(R<=T){v=false;E=false;a(T);s.style.overflow="auto";u.Events.Fire("Minimized",u)}else{a(R);window.setTimeout(function(){D(T)},20)}}}this.Close=function(){u.SetBody("");u.Hide();u.Events.Fire("Closed",u)};this.GetBody=function(){return s.innerHTML};this.GetCurrentSize=function(){return new System.Drawing.Size(parseInt(q.style.width.substring(0,q.style.width.indexOf("px"))),parseInt(q.style.height.substring(0,q.style.height.indexOf("px"))))};this.GetElement=function(){return q};this.GetFooter=function(){return A.innerHTML};this.GetHeader=function(){return m.innerHTML};this.GetIcon=function(){return K};this.GetId=function(){return l};this.GetLocation=function(){return e};this.GetSize=function(){return b};this.GetTitle=function(){return n.innerHTML};this.Hide=function(){q.style.visibility="hidden"};this.IsHeightDynamic=function(){return(b.Height=="auto")};this.IsVisible=function(){return(q.style.visibility=="visible")};this.IsMinimized=function(){return H};this.Maximize=function(Q){if(H){o=window.clearTimeout(o);v=true;E=false;H=false;u.Events.Fire("Maximizing",u);h.onclick=function(){u.Minimize(true);return false};h.src="/Panel/Images/Minimize.gif";h.alt="Minimize";if(Q){var R=b.Height;if(R=="auto"){R=x()}f=(new Date()).getTime();s.style.overflow="hidden";window.setTimeout(function(){g(R)},10)}else{var R=b.Height;if(R=="auto"){R=x()}v=false;a(R);u.Events.Fire("Maximized",u)}}};this.Minimize=function(Q){if(!H){u.Events.Fire("Minimizing",u);h.onclick=function(){u.Maximize(true);return false};h.src="/Panel/Images/Maximize.gif";h.alt="Maximize";o=window.clearTimeout(o);v=false;E=true;H=true;if(Q){f=(new Date()).getTime();s.style.overflow="hidden";window.setTimeout(function(){D(Panel.MinimumSize.Height)},10)}else{E=false;a(Panel.MinimumSize.Height);u.Events.Fire("Minimized",u)}}};this.SetBody=function(Q){s.innerHTML=Q||"";if(b.Height=="auto"){u.SetSize(b)}};this.SetFooter=function(Q){A.innerHTML=Q||"";if(b.Height=="auto"){u.SetSize(b)}};this.SetFooterHeight=function(Q){y.Height=Q||"auto";u.SetSize(b)};this.SetHeader=function(Q){m.innerHTML=Q||"";if(b.Height=="auto"){u.SetSize(b)}};this.SetHeaderHeight=function(Q){L.Height=Q||"auto";u.SetSize(b)};this.SetIcon=function(Q){K=Q;System.Html.HtmlElement.SetBackgroundImage(J,(Q||""));n.style.left=(K==null||K=="")?"5px":"37px"};this.SetLocation=function(Q){e=Q||new System.Drawing.Point(0,0);q.style.top=e.Y-3+"px";q.style.left=e.X-8+"px"};this.SetSize=function(R){b=R.Clone()||Panel.DefaultSize;b.Width=b.Width||Panel.DefaultSize.Width;b.Height=b.Height||Panel.DefaultSize.Height;b.Width=b.Width>Panel.MinimumSize.Width?b.Width:Panel.MinimumSize.Width;if(b.Height!="auto"){b.Height=b.Height>Panel.MinimumSize.Height?b.Height:Panel.MinimumSize.Height;b.Height+=16}if(!H&&!v&&!E){var Q=b.Height;if(Q=="auto"){Q=x()}a(Q);P(b.Width)}u.Events.Fire("Resized",u)};this.SetTitle=function(Q){n.innerHTML=Q||""};this.Show=function(Q){Q=(Q==null?true:Q);if(!u.IsVisible()){u.Minimize(false);q.style.visibility="visible";u.Maximize(Q)}else{q.style.visibility="visible"}};z()}PanelCollection.PanelSpacing=10;PanelCollection.PanelDropShadowHeight=14;function PanelCollection(){var b=this;var c=new System.Drawing.Point(0,0);var a=Panel.DefaultSize.Clone();this.Panels=new Array();function f(){var j=b.Panels.length;return new System.Drawing.Size(a.Width,a.Height-(Panel.MinimumSize.Height*(j-1)+(j-1)*PanelCollection.PanelSpacing-(j-1)*PanelCollection.PanelDropShadowHeight))}function e(j){b.Remove(j);i()}function g(j){i()}function h(k){for(var j=0;j<b.Panels.length;j++){if(b.Panels[j]!=k){b.Panels[j].Minimize(false)}}i()}function d(j){i()}function i(){var k=c.Clone();var m=f();for(var l=0;l<b.Panels.length;l++){b.Panels[l].SetLocation(k.Clone());b.Panels[l].SetSize(m.Clone());var j=(b.Panels[l].IsMinimized()?b.Panels[l].GetCurrentSize().Height-PanelCollection.PanelDropShadowHeight:m.Height);k.Offset(0,j+PanelCollection.PanelSpacing)}}this.Add=function(j){this.Panels.push(j);j.Hide();j.SetSize(f());j.Events.Add(new System.Event("Minimized",function(k){d(k)}));j.Events.Add(new System.Event("Maximizing",function(k){h(k)}));j.Events.Add(new System.Event("Maximized",function(k){g(k)}));j.Events.Add(new System.Event("Closed",function(k){e(k)}));this.MinimizeAll();j.Show();j.Maximize(true)};this.Contains=function(j){for(var k=0;k<this.Panels.length;k++){if(this.Panels[k].GetId()==j){return true}}return false};this.MinimizeAll=function(){for(var j=0;j<this.Panels.length;j++){this.Panels[j].Minimize(false)}};this.Remove=function(j){for(var k=this.Panels.length-1;k>=0;k--){if(this.Panels[k].GetId()==j.GetId()){this.Panels.splice(k,1)}}};this.SetLocation=function(j){c=j;i()};this.SetSize=function(j){a=j;i()}}Pushpin.Colors=new Array("Red","Orange","LightBlue","Purple","Yellow","Gray","Black");function Pushpin(){}Pushpin.Center=function(a){map.SetAnimationEnabled(false);map.SetCenter(Pushpin.FromId(a).LatLong);map.SetAnimationEnabled(true)};Pushpin.FromId=function(a){for(var b=0;b<map.pushpins.length;b++){if(map.pushpins[b].ID==a){return map.pushpins[b]}}return null};Pushpin.GetNextColor=function(){var a=Pushpin.Colors.shift();Pushpin.Colors.push(a);return a};Pushpin.OnClick=function(b){var a=Pushpin.FromId(b.srcElement.id.split("_")[0]);if(a!=null){Pushpin.ShowContextMenu(a.ID)}};Pushpin.ShowContextMenu=function(b){var a=Pushpin.FromId(b);if(a!=null){AtlasContextMenu.SetSize(Panel.DefaultSize);AtlasContextMenu.SetLocation(a.LatLong);AtlasContextMenu.SetTitle(a.Title);AtlasContextMenu.SetBody(a.Details);AtlasContextMenu.Show(true);CurrentPushpin=a}};VEPushpin.ShowDetailOnMouseOver=false;var map=null;var Sidebar=null;var AtlasContextMenu=null;var CurrentPushpin=null;var MainMenu=null;var Plugins=[];function DecodeLatLong(a){if(a._reserved&&(!a.Latitude||!a.Longitude)){var b=new _xz1().Decode(a._reserved);a.Latitude=b[0];a.Longitude=b[1];b=null}}function InitializeQueryString(){var a=new System.Uri(window.location.href);var b=a.GetQueryParameters();if(b.cp){System.Configuration.Settings.Latitude=b.cp.split("~")[0];System.Configuration.Settings.Longitude=b.cp.split("~")[1]}System.Configuration.Settings.MapStyle=b.style||System.Configuration.Settings.MapStyle;System.Configuration.Settings.MapZoomLevel=b.lvl||System.Configuration.Settings.MapZoomLevel}function InitializeMenu(){MainMenu=new Menu();var a=document.getElementById("Menu").getElementsByTagName("div");for(var b=0;b<a.length;b++){if(a[b].className=="MenuItem"){MainMenu.Add(new MenuItem(a[b].id))}}MainMenu.Events.Add(new System.Event("MenuResized",OnMenuResized))}function Resize(){if(map){map.Resize(GetWindowWidth(),GetWindowHeight())}Sidebar.SetSize(new System.Drawing.Size(250,GetWindowHeight()-MainMenu.GetHeight()-40));Sidebar.SetLocation(new System.Drawing.Point(20,MainMenu.GetHeight()+20))}function map_OnChangeView(a){System.Configuration.Settings.Latitude=map.GetCenter().Latitude;System.Configuration.Settings.Longitude=map.GetCenter().Longitude;System.Configuration.Settings.MapStyle=map.GetMapStyle();System.Configuration.Settings.MapZoomLevel=map.GetZoomLevel()}function map_OnClick(a){if(a.rightMouseButton||a.ctrlKey){map_OnRightClick(a)}if(CurrentPushpin==null&&window.event.button!=""&&window.event.button!=2){AtlasContextMenu.Hide()}}function map_OnRightClick(b){var a=b.latLong||map.PixelToLatLong(new VEPixel(b.mapX,b.mapY));AtlasContextMenu.SetTitle("Options");AtlasContextMenu.SetBody("");AtlasContextMenu.SetLocation(a);AtlasContextMenu.SetSize(Panel.DefaultSize);AtlasContextMenu.Show();CurrentPushpin=null}function map_Loaded(a){map.HideDashboard();Events.Fire("MapLoaded")}function OnMenuResized(){Sidebar.SetSize(new System.Drawing.Size(250,GetWindowHeight()-MainMenu.GetHeight()-40));Sidebar.SetLocation(new System.Drawing.Point(20,MainMenu.GetHeight()+20))}$(function(){Sidebar=new PanelCollection();System.Configuration.Settings.Load();InitializeQueryString();InitializeMenu();document.getElementById("Map").style.height=GetWindowHeight()-1+"px";document.getElementById("Map").style.width=GetWindowWidth()-1+"px";map=new VEMap("Map");map.onLoadMap=map_Loaded;map.GetCenter=function(){return new VELatLong(this.vemapcontrol.GetCenterLatitude(),this.vemapcontrol.GetCenterLongitude())};map.PixelToLatLong=function(b){var d=this.vemapcontrol.PixelToLatLong(b);var c=new VELatLongFactory(new VELatLongFactoryAlwaysEncodeSpec()).CreateVELatLong(d.latitude,d.longitude);var e=new VELatLong(d.latitude,d.longitude);e._reserved=c._reserved;return e};try{map.LoadMap(new VELatLong(System.Configuration.Settings.Latitude,System.Configuration.Settings.Longitude),System.Configuration.Settings.MapZoomLevel,System.Configuration.Settings.MapStyle,false)}catch(a){map.LoadMap()}AtlasContextMenu=new ContextMenu("AtlasContextMenu","Options",null,"",new VELatLong(0,0));map.AttachEvent("onchangeview",map_OnChangeView);map.AttachEvent("onclick",map_OnClick);System.Drawing.Image.FixBackgroundImages()});AddEvent(window,"resize",Resize);AddEvent(window,"unload",System.Configuration.Settings.Save);var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS"},searchString:function(d){for(var a=0;a<d.length;a++){var b=d[a].string;var c=d[a].prop;this.versionSearchString=d[a].versionSearch||d[a].identity;if(b){if(b.indexOf(d[a].subString)!=-1){return d[a].identity}}else{if(c){return d[a].identity}}}},searchVersion:function(b){var a=b.indexOf(this.versionSearchString);if(a==-1){return}return parseFloat(b.substring(a+this.versionSearchString.length+1))},dataBrowser:[{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};BrowserDetect.init();document.getElementPosition=function(c){var d=0;var e=0;var a=0;var b=0;if(BrowserDetect.browser=="Safari"){do{e+=c.offsetTop||0;d+=c.offsetLeft||0;if(c.offsetParent&&c.offsetParent==document.body){if(document.getElementStyle(c,"position")=="absolute"){break}}c=c.offsetParent}while(c);return new System.Drawing.Point(d,e)}else{if(c.offsetParent){d=c.offsetLeft;e=c.offsetTop;while(c=c.offsetParent){d+=c.offsetLeft;e+=c.offsetTop}}return new System.Drawing.Point(d-b,e)}};document.getElementStyle=function(c,b){var a="";if(document.defaultView&&document.defaultView.getComputedStyle){a=document.defaultView.getComputedStyle(c,"").getPropertyValue(b)}else{if(c.currentStyle){b=b.replace(/-(w)/g,function(e,d){return d.toUpperCase()});a=c.currentStyle[b]}}return a};document.getEventLocation=function(c){var b=0;var a=0;try{if(c.pageX||c.pageY){b=c.pageX;a=c.pageY}else{if(c.clientX||c.clientY){b=c.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;a=c.clientY+document.body.scrollTop+document.documentElement.scrollTop}}}catch(c){return null}return new System.Drawing.Point(b,a)};RegisterNamespace("FreshLogicStudios.Atlas");FreshLogicStudios.Atlas.Item=function(d,b,h,f,j,i){var e=System.Guid.NewGuid();var g=null;var c=this;this.Color=j||"Red";this.ContextMenuDetails=h||"";this.Number=i||1;this.Position=f||null;this.SidebarDetails=b||"";this.Title=d||"";function a(){return System.String.Format("/Pushpin/Image.ashx?Color={0}&Text={1}",j,i)}this.Center=function(){Pushpin.Center(e)};this.GetPushpin=function(){if(g==null&&c.Position!=null){g=new VEPushpin(e,c.Position,a(),c.Title,c.ContextMenuDetails,"AtlasPushpin")}return g};this.GetSidebarHtml=function(){var k='<li class="PanelItem">';k+=System.String.Format('<a href="javascript:Pushpin.ShowContextMenu(\'{1}\'); Pushpin.Center(\'{1}\');"><img class="PanelPushpin" src="{0}" /></a>',a(),e);k+='<div class="PanelItemDetail">';k+=System.String.Format("<a class=\"DetailTitle\" href=\"javascript:Pushpin.ShowContextMenu('{0}'); Pushpin.Center('{0}');\">{1}</a>",e,c.Title);k+=System.String.Format('<div class="DetailContent">{0}</div>',c.SidebarDetails);k+="</div>";k+="</li>";return k};this.HidePushpin=function(){if(g){map.RemoveAtlasPushpin(g)}g=null};this.ShowContextMenu=function(){Pushpin.ShowContextMenu(e)};this.ShowPushpin=function(){map.AddAtlasPushpin(c.GetPushpin())}};RegisterNamespace("FreshLogicStudios.Atlas.Items");FreshLogicStudios.Atlas.Items.Clear=function(b){for(var a=0;a<b.GetCount();a++){b.GetItem(a).HidePushpin()}b.Clear()};FreshLogicStudios.Atlas.Items.GetSidebarHtml=function(b){var a="No results found.";if(b.GetCount()>0){a="<ul>";for(var c=0;c<b.GetCount();c++){a+=b.GetItem(c).GetSidebarHtml()}a+="</ul>"}return a};FreshLogicStudios.Atlas.Items.ZoomToFit=function(c){if(c.GetCount()>0){var b=new Array();for(var a=0;a<c.GetCount();a++){b.push(c.GetItem(a).Position)}map.SetMapView(b)}};RegisterNamespace("FreshLogicStudios.Atlas");FreshLogicStudios.Atlas.Plugin=function(a){var b=System.Guid.NewGuid();var d=this;this.Color=Pushpin.GetNextColor();this.Items=new System.Collections.ArrayList();this.Panel=null;this.Places=null;this.Where=a||System.Configuration.Settings.Defaults.DefaultWhere;function c(){Plugins[b]=d;d.Panel=new Panel(b);d.Panel.Events.Add(new System.Event("Closed",d.Close));Sidebar.Add(d.Panel);d.RenderPanelHeader()}function e(f,l,h,k){d.Places=h;if(d.Places==null){d.Panel.SetBody("No results found.");return}else{if(d.Places.length==1){DecodeLatLong(d.Places[0].LatLong);d.Where=d.Places[0];d.Search()}else{if(d.Places.length>1){var j='<div class="PanelBodyHeader"><div class="Summary">Did you mean?</div></div>';j+='<ol class="AmbiguousPlaces">';for(var g=0;g<d.Places.length;g++){DecodeLatLong(d.Places[g].LatLong);j+=System.String.Format("<li><a href=\"javascript:Plugins['{0}'].Panel.SetBody('Loading...'); Plugins['{0}'].Where = Plugins['{0}'].Places[{1}]; Plugins['{0}'].Search();\">{2}</a></li>",b,g,d.Places[g].Name)}j+="</ol>";d.Panel.SetBody(j)}}}}this.BeginSearch=function(){d.Clear();d.Panel.SetBody("Loading...");if(System.String.IsNullOrEmpty(d.Where)||d.Where==System.Configuration.Settings.Defaults.DefaultWhere){d.Where=new VEPlace(System.Configuration.Settings.Defaults.DefaultWhere,map.GetCenter());DecodeLatLong(d.Where.LatLong);d.Search()}else{map.Find(null,d.Where,null,null,null,null,false,false,false,false,e);return}};this.Clear=function(){d.HidePushpins();d.Items.Clear()};this.Close=function(){d.Clear();d.Panel.Hide();Sidebar.Remove(d.Panel)};this.EndSearch=function(){var f=document.getElementById(System.String.Format("Where_{0}",d.GetId()));if(f!=null){f.value=d.Where.Name}d.Panel.SetBody(FreshLogicStudios.Atlas.Items.GetSidebarHtml(d.Items));d.ShowPushpins();d.ZoomToFit()};this.GetId=function(){return b};this.HidePushpins=function(){for(var f=0;f<d.Items.GetCount();f++){d.Items.GetItem(f).HidePushpin()}};this.RenderPanelHeader=function(){var f="<div>";f+=System.String.Format('<form action="about:blank" method="get" target="hiddenframe" onsubmit="Plugins[\'{0}\'].Where = this.Where.value; Plugins[\'{0}\'].BeginSearch(); return false;">',b);f+="<label>Where: Address, city or landmark</label>";f+=System.String.Format('<input id="Where_{0}" name="Where" type="text" value="{1}" onfocus="if(this.value == System.Configuration.Settings.Defaults[\'DefaultWhere\']){this.value=\'\';} else{this.select();}" onblur="if(this.value==\'\'){this.value=System.Configuration.Settings.Defaults[\'DefaultWhere\'];}" /><br />',d.GetId(),System.Configuration.Settings.Defaults.DefaultWhere);f+='<button class="Button" type="submit" name="submit" value="Search">Search</button>';f+="</form>";f+="</div>";d.Panel.SetHeader(f);d.Panel.SetHeaderHeight(60)};this.Search=function(){};this.ShowPushpins=function(){for(var f=0;f<d.Items.GetCount();f++){d.Items.GetItem(f).ShowPushpin()}};this.ZoomToFit=function(){if(d.Items.GetCount()>0){var g=new Array();for(var f=0;f<d.Items.GetCount();f++){g.push(d.Items.GetItem(f).Position)}map.SetMapView(g)}};c()};System.Configuration.Settings.LoadDefaults=function(){System.Configuration.Settings.Defaults.BirdsEyeOrientation=VEOrientation.North;System.Configuration.Settings.Defaults.Latitude=39.5;System.Configuration.Settings.Defaults.Longitude=-98.35;System.Configuration.Settings.Defaults.MapStyle=VEMapStyle.Shaded;System.Configuration.Settings.Defaults.MapZoomLevel=4;System.Configuration.Settings.Defaults.RegionZoomLevel=6;System.Configuration.Settings.Defaults.CityZoomLevel=11;System.Configuration.Settings.Defaults.StreetZoomLevel=16;System.Configuration.Settings.Defaults.DefaultWhere="Use current view"};VEMap.prototype.AddAtlasPushpin=function(a){this.AddPushpin(a);$("#"+a.ID).click(Pushpin.OnClick)};VEMap.prototype.HideTraffic=function(){if(this.TrafficCount&&--this.TrafficCount==0){map.ClearTraffic()}};VEMap.prototype.RemoveAtlasPushpin=function(a){if(CurrentPushpin==a){AtlasContextMenu.SetBody("");AtlasContextMenu.Hide()}this.DeletePushpin(a.ID)};VEMap.prototype.RemovePushpins=function(a){for(var b=a.length-1;b>=0;b--){var c=a.pop();this.RemoveAtlasPushpin(c)}};VEMap.prototype.RestoreDefaults=function(){this.SetMapStyle(System.Configuration.Settings.Defaults.MapStyle);this.SetCenterAndZoom(new VELatLong(System.Configuration.Settings.Defaults.Latitude,System.Configuration.Settings.Defaults.Longitude),System.Configuration.Settings.Defaults.MapZoomLevel)};VEMap.prototype.RotateClockwise=function(){if(this.GetMapStyle()==VEMapStyle.Birdseye||this.GetMapStyle()==VEMapStyle.BirdseyeHybrid){switch(this.GetBirdseyeScene().GetOrientation()){case VEOrientation.North:this.SetBirdseyeOrientation(VEOrientation.East);break;case VEOrientation.South:this.SetBirdseyeOrientation(VEOrientation.West);break;case VEOrientation.East:this.SetBirdseyeOrientation(VEOrientation.South);break;default:this.SetBirdseyeOrientation(VEOrientation.North);break}}};VEMap.prototype.RotateCounterClockwise=function(){if(this.GetMapStyle()==VEMapStyle.Birdseye||this.GetMapStyle()==VEMapStyle.BirdseyeHybrid){var a=this.GetBirdseyeScene().GetOrientation();switch(a){case VEOrientation.North:this.SetBirdseyeOrientation(VEOrientation.West);break;case VEOrientation.South:this.SetBirdseyeOrientation(VEOrientation.East);break;case VEOrientation.East:this.SetBirdseyeOrientation(VEOrientation.North);break;default:this.SetBirdseyeOrientation(VEOrientation.South);break}}};VEMap.prototype.ShowMessage=function(b){var a=new Panel("Message");a.SetSize(new System.Drawing.Size(300,0));a.SetLocation(new System.Drawing.Point((GetWindowWidth()/2)-(a.GetSize().Width/2),GetWindowHeight()/2));a.SetTitle("Message");a.SetIcon("/Images/Message.png");a.SetBody(b);a.Show();window.setTimeout(function(){a.Close()},5000)};VEMap.prototype.ShowTraffic=function(){if(!this.TrafficCount){this.TrafficCount=0}this.TrafficCount++;this.LoadTraffic(true)};(function(e){var c=38,g=40,f=13,h=27,j=115;e.widget("ui.combobox",{init:function(){var k=this;var o=this.options;var l=e('<input type = "text" />');if(this.element[0].tagName.toLowerCase()=="select"){d(o,this.element)}function n(){k.hideList();e(document).unbind("click",n)}this.arrowElem=e(this.options.arrowHTML.call(this)).click(function(p){if(k.isListVisible()){k.hideList()}else{k.showList();e(document).click(n)}return false});function m(r,q){var p=k.element.attr(r);if(p){if(r=="class"){q.addClass(p)}else{q.attr(r,p)}}}m("class",l);m("name",l);m("title",l);m("dir",l);m("lang",l);m("xml:lang",l);m("size",l);m("value",l);if(this.element.attr("maxlength")!=-1){l.attr("maxlength",this.element.attr("maxlength"))}this.oldElem=this.element.unbind("getData.combobox").unbind("setData.combobox").unbind("remove").after(this.arrowElem).after(l).remove();this.listElem=this.buildList().insertAfter(this.arrowElem).hide();m("id",l);m("class",this.listElem);m("class",this.arrowElem);this.element=l.keyup(function(p){if(p.which==j){k.showList(p)}}).change(a(this,"fireEvent","select"));if(o.autoShow){this.element.focus(a(this,"showList")).blur(function(p){k.finishSelection(k.selectedIndex,p);k.hideList()})}},_init:function(){this.init.apply(this,arguments)},cleanup:function(){if(this.boundKeyHandler){e(document).unbind("keyup",this.boundKeyHandler)}this.arrowElem.remove();this.listElem.remove()},destroy:function(){var k=this.element;this.element=this.oldElem.insertBefore(this.arrowElem);k.remove()},setData:function(m,k){this.options[m]=k;if(m=="disabled"&&this.isListVisible()){this.hideList()}if(m=="data"||m=="listContainerTag"||m=="listHTML"){var l=this.isListVisible();this.listElem=this.buildList().replaceAll(this.listElem);this[l?"showList":"hideList"]()}},buildList:function(){var l=this;var n=this.options;var k=n.listContainerTag;var m=e("<"+k+' class = "ui-combobox-list"></'+k+">");e.each(n.data,function(p,o){e(n.listHTML(o,p)).appendTo(m).click(a(l,"finishSelection",p)).mouseover(a(l,"changeSelection",p))});return m},isListVisible:function(){return this.listElem.is(":visible")},showList:function(k){if(this.options.disabled){return}var l=this.element.position();l.top+=this.element.height()+5;l.width=this.element.width();l.position="absolute";this.boundKeyHandler=a(this,"keyHandler");e(document).keyup(this.boundKeyHandler);e(".ui-combobox-list").hide();this.listElem.css(l).show();this.changeSelection(this.findSelection(),k)},hideList:function(){this.listElem.hide();e(document).unbind("keyup",this.boundKeyHandler)},keyHandler:function(m){if(this.options.disabled){return}var l=this.options.data.length;switch(m.which){case h:this.hideList();break;case c:var k=this.selectedIndex-1;if(k<0){k=l-1}this.changeSelection(k,m);break;case g:this.changeSelection((this.selectedIndex+1)%l,m);break;case f:this.finishSelection(this.selectedIndex,m);break;default:this.fireEvent("key",m);this.changeSelection(this.findSelection());break}},prepareCallbackObj:function(k){k=k||this.element.val();var l=e.inArray(k,this.options.data);return{value:k,index:l,isCustom:l==-1,inputElement:this.element,listElement:this.listElement}},fireEvent:function(k,m,l){this.element.triggerHandler("combobox"+k,[m,this.prepareCallbackObj(l)],this.options[k])},findSelection:function(){var o=this.options.data;var l=this.element.val().toLowerCase();for(var n=0,m=o.length;n<m;++n){var k=o[n].toLowerCase().indexOf(l);if(k==0){return n}}if(this.options.matchMiddle){for(var n=0,m=o.length;n<m;++n){var k=o[n].toLowerCase().indexOf(l);if(k!=-1){return n}}}return 0},changeSelection:function(l,k){this.selectedIndex=l;this.listElem.children(".selected").removeClass("selected");this.listElem.children(":eq("+l+")").addClass("selected");if(k){this.fireEvent("change",k,this.options.data[l])}},finishSelection:function(l,k){this.element.val(this.options.data[l]);this.hideList();this.fireEvent("select",k)}});e.extend(e.ui.combobox,{getter:"getData",version:"1.0.6",defaults:{data:[],autoShow:true,matchMiddle:true,change:function(l,k){},select:function(l,k){},key:function(l,k){},arrowURL:"drop_down.png",arrowHTML:function(){return e('<img class = "ui-combobox-arrow" border = "0" src = "'+this.options.arrowURL+'" width = "18" height = "22" />')},listContainerTag:"span",listHTML:b}});var i=e.fn.combobox;e.fn.combobox=function(){var l=i.apply(this,arguments);if(!(l instanceof e)){return l}var m=false;var k=e(e.map(l,function(p){var o=e.data(p,"combobox");if(o&&o.element[0]!=p){m=true;var n=o.element[0];e.data(n,"combobox",o);return n}else{return p}}));return !m?l:k.bind("setData.combobox",function(p,o,n){return e.data(this,"combobox").setData(o,n)}).bind("getData.combobox",function(o,n){return e.data(this,"combobox").getData(n)}).bind("remove",function(){return e.data(this,"combobox").cleanup()})};function b(m,l){var k=l%2?"odd":"even";return'<span class = "ui-combobox-item '+k+'">'+m+"</span>"}function a(k,m){var l=[].slice.call(arguments,2);return function(){k[m].apply(k,l.concat([].slice.call(arguments)))}}function d(n,m){var l={},k=[];m.children().each(function(o){if(this.tagName.toLowerCase()=="option"){var q=e(this).text(),p=this.getAttribute("value")||q;l[p]=q;k.push(p)}});if(!n.data.length){n.data=k}if(n.listHTML==b){n.listHTML=function(o,p){return b(l[o]||o)}}}})(jQuery);RegisterNamespace("FreshLogicStudios.Atlas.Services");FreshLogicStudios.Atlas.Services.Friend=function(l,g,b,d,f){var k=d;var i=l;var j=0;var a=f;var c=g;var m=b;var e=this;function h(){var o=System.String.Format('<div class="Logo"><img src="http://account.freshlogicstudios.com/Image.ashx?Email={0}" /></div>',i);o+=System.String.Format("{0}<p>Updated {1} {2} {3}",k,a.split(" ")[0],a.split(" ")[1],a.split(" ")[2]);return o}function n(){var o=h();o+='<div class="GpsDeviceOptions">';if(i!=FreshLogicStudios.Atlas.Services.Friends.FriendToFollow){o+="<a href=\"#\" onclick=\"this.innerHTML = 'stop following'; FreshLogicStudios.Atlas.Services.Friends.FriendToFollow = '"+i+"'; return false;\">follow</a>"}else{o+='<a href="#" onclick="this.innerHTML = \'start following\'; FreshLogicStudios.Atlas.Services.Friends.FriendToFollow = null; return false;">stop following</a>'}o+="</div>";return o}this.AddPushpin=function(){var q=System.String.Format("/Pushpin/Image.ashx?Color={0}&Text={1}",FreshLogicStudios.Atlas.Services.Friends.Color,j);var o=new VEPushpin(i,new VELatLong(m.Latitude,m.Longitude),q,c,h(),"AtlasPushpin");var p=this.IsContextMenuVisible();this.RemovePushpin();map.AddAtlasPushpin(o);if(p){Pushpin.ShowContextMenu(o.ID)}};this.GetAddress=function(){return k};this.GetEmail=function(){return i};this.GetIndex=function(){return j};this.GetModified=function(){return a};this.GetName=function(){return c};this.GetPosition=function(){return m};this.GetSidebarPanelHtml=function(){var o=System.String.Format("/Pushpin/Image.ashx?Color={0}&Text={1}",FreshLogicStudios.Atlas.Services.Friends.Color,j);var p='<li class="PanelItem">';p+=System.String.Format('<a href="javascript:Pushpin.ShowContextMenu(\'{1}\'); Pushpin.Center(\'{1}\');"><img class="PanelPushpin" src="{0}" /></a>',o,i);p+='<div class="PanelItemDetail">';p+=System.String.Format("<a class=\"DetailTitle\" href=\"javascript:Pushpin.ShowContextMenu('{0}'); Pushpin.Center('{0}');\">{1}</a>",i,c);p+=System.String.Format('<div class="DetailContent">{0}</div>',n());p+="</div>";p+="</li>";return p};this.IsContextMenuVisible=function(){return(CurrentPushpin!=null&&CurrentPushpin.ID==i&&AtlasContextMenu.IsVisible())};this.RemovePushpin=function(){try{map.DeletePushpin(i)}catch(o){}};this.SetAddress=function(o){k=o};this.SetEmail=function(o){i=o};this.SetIndex=function(o){j=o};this.SetModified=function(o){a=o};this.SetName=function(o){c=o};this.SetPosition=function(o){m=o};this.UpdatePushpin=function(){e.AddPushpin()}};RegisterNamespace("FreshLogicStudios.Atlas.Services");FreshLogicStudios.Atlas.Services.FriendList=function(){};FreshLogicStudios.Atlas.Services.FriendList.Friends=[];FreshLogicStudios.Atlas.Services.FriendList.FriendToFollow=null;FreshLogicStudios.Atlas.Services.FriendList.Add=function(a){FreshLogicStudios.Atlas.Services.FriendList.Friends.push(a)};FreshLogicStudios.Atlas.Services.FriendList.Contains=function(b){for(var a=0;a<FreshLogicStudios.Atlas.Services.FriendList.Friends.length;a++){if(FreshLogicStudios.Atlas.Services.FriendList.Friends[a].GetEmail()===b){return true}}return false};FreshLogicStudios.Atlas.Services.FriendList.IndexOf=function(b){for(var a=0;a<FreshLogicStudios.Atlas.Services.FriendList.Friends.length;a++){if(FreshLogicStudios.Atlas.Services.FriendList.Friends[a].GetEmail()===b){return a}}return -1};FreshLogicStudios.Atlas.Services.FriendList.Remove=function(a){for(var b=FreshLogicStudios.Atlas.Services.FriendList.Friends.length-1;b>=0;b--){if(FreshLogicStudios.Atlas.Services.FriendList.Friends[b].GetEmail()==a.GetEmail()){FreshLogicStudios.Atlas.Services.FriendList.Friends.splice(b,1)}}};FreshLogicStudios.Atlas.Services.FriendList.Synchronize=function(c){for(var b=0;b<c.length;b++){if(FreshLogicStudios.Atlas.Services.FriendList.Contains(c[b].GetEmail())){FreshLogicStudios.Atlas.Services.FriendList.Friends[FreshLogicStudios.Atlas.Services.FriendList.IndexOf(c[b].GetEmail())]=c[b]}else{FreshLogicStudios.Atlas.Services.FriendList.Add(c[b])}c[b].UpdatePushpin()}for(var b=0;b<FreshLogicStudios.Atlas.Services.FriendList.Friends.length;b++){var d=false;for(var a=0;a<c.length;a++){if(FreshLogicStudios.Atlas.Services.FriendList.Friends[b].GetEmail()==c[a].GetEmail()){d=true;break}}if(!d){FreshLogicStudios.Atlas.Services.FriendList.Friends[b].RemovePushpin();FreshLogicStudios.Atlas.Services.FriendList.Remove(FreshLogicStudios.Atlas.Services.FriendList.Friends[b])}}};FreshLogicStudios.Atlas.Services.FriendList.GetSidebarPanelHtml=function(){if(FreshLogicStudios.Atlas.Services.FriendList.Friends.length==0){return""}var b="<ul>";for(var a=0;a<FreshLogicStudios.Atlas.Services.FriendList.Friends.length;a++){b+=FreshLogicStudios.Atlas.Services.FriendList.Friends[a].GetSidebarPanelHtml()}b+="</ul>";return b};RegisterNamespace("FreshLogicStudios.Atlas.Services");FreshLogicStudios.Atlas.Services.Friends=function(){};FreshLogicStudios.Atlas.Services.Friends.Panel=null;FreshLogicStudios.Atlas.Services.Friends.Color=null;FreshLogicStudios.Atlas.Services.Friends.FriendToFollow=null;FreshLogicStudios.Atlas.Services.Friends.CenterOnFriendToFollow=function(){if(FreshLogicStudios.Atlas.Services.Friends.FriendToFollow){var a=FreshLogicStudios.Atlas.Services.FriendList.Friends[FreshLogicStudios.Atlas.Services.FriendList.IndexOf(FreshLogicStudios.Atlas.Services.Friends.FriendToFollow)];map.SetAnimationEnabled(false);map.SetCenter(a.GetPosition());map.SetAnimationEnabled(true)}};FreshLogicStudios.Atlas.Services.Friends.Clear=function(){for(var a=0;a<FreshLogicStudios.Atlas.Services.FriendList.Friends.length;a++){if(FreshLogicStudios.Atlas.Services.FriendList.Friends[a].IsContextMenuVisible()){AtlasContextMenu.Hide()}FreshLogicStudios.Atlas.Services.FriendList.Friends[a].RemovePushpin()}};FreshLogicStudios.Atlas.Services.Friends.Initialize=function(){FreshLogicStudios.Atlas.Services.Friends.Color=Pushpin.GetNextColor();var b='<a href="http://account.freshlogicstudios.com">Add or remove friends</a>';FreshLogicStudios.Atlas.Services.Friends.Panel=new Panel("_Friends");FreshLogicStudios.Atlas.Services.Friends.Panel.SetIcon("/Services/Friends/Friends.png");FreshLogicStudios.Atlas.Services.Friends.Panel.SetTitle("Friends");FreshLogicStudios.Atlas.Services.Friends.Panel.SetFooter(b);FreshLogicStudios.Atlas.Services.Friends.Panel.SetFooterHeight(15);FreshLogicStudios.Atlas.Services.Friends.Panel.Events.Add(new System.Event("Closed",FreshLogicStudios.Atlas.Services.Friends.Clear));try{pageTracker._trackEvent("Friends","Open")}catch(a){}};FreshLogicStudios.Atlas.Services.Friends.OnWebRequestComplete=function(l){if(Sidebar.Contains("_Friends")){if(l.get_statusCode()==200){var k=l.get_xml().getElementsByTagName("Friend");var d=new Array();var e=new Array();for(var h=0;h<k.length;h++){var j=k[h].getAttribute("Email");var b=k[h].getAttribute("Name");var m=k[h].getAttribute("Address");var a=k[h].getAttribute("Modified");var n=k[h].getElementsByTagName("Location")[0];var g=n.getAttribute("Latitude");var c=n.getAttribute("Longitude");var o=new VELatLong(g,c);e.push(o);var f=FreshLogicStudios.Atlas.Services.FriendList.Contains(j)?FreshLogicStudios.Atlas.Services.FriendList.Friends[FreshLogicStudios.Atlas.Services.FriendList.IndexOf(j)]:new FreshLogicStudios.Atlas.Services.Friend(j);f.SetAddress(m);f.SetName(b);f.SetPosition(o);f.SetModified(a);f.SetIndex(h+1);d.push(f)}FreshLogicStudios.Atlas.Services.FriendList.Synchronize(d);FreshLogicStudios.Atlas.Services.Friends.CenterOnFriendToFollow();if(FreshLogicStudios.Atlas.Services.Friends.Panel.GetBody()=="Loading..."){if(e.length==1){map.SetAnimationEnabled(false);map.SetCenter(new VELatLong(e[0].Latitude,e[0].Longitude));map.SetAnimationEnabled(true)}else{if(e.length>1){map.SetMapView(e)}}}FreshLogicStudios.Atlas.Services.Friends.Panel.SetBody(FreshLogicStudios.Atlas.Services.FriendList.GetSidebarPanelHtml())}else{FreshLogicStudios.Atlas.Services.Friends.Panel.SetBody("");map.ShowMessage(System.String.Format("An error occured while loading data.  {0}: {1}",l.get_statusCode(),l.get_statusText()))}window.setTimeout(FreshLogicStudios.Atlas.Services.Friends.Populate,1000)}else{FreshLogicStudios.Atlas.Services.FriendList.Synchronize(new Array())}};FreshLogicStudios.Atlas.Services.Friends.Populate=function(){var a=new Sys.Net.WebRequest();a.set_url("/Services/Friends/Friends2.ashx");a.add_completed(FreshLogicStudios.Atlas.Services.Friends.OnWebRequestComplete);a.invoke()};FreshLogicStudios.Atlas.Services.Friends.ShowPanel=function(){if(Sidebar.Contains("_Friends")){FreshLogicStudios.Atlas.Services.Friends.Panel.Maximize(true)}else{if(FreshLogicStudios.Atlas.Services.Friends.Panel==null){FreshLogicStudios.Atlas.Services.Friends.Initialize()}Sidebar.Add(FreshLogicStudios.Atlas.Services.Friends.Panel);FreshLogicStudios.Atlas.Services.Friends.Panel.SetBody("Loading...");window.setTimeout(FreshLogicStudios.Atlas.Services.Friends.Populate,1000)}};FreshLogicStudios.Atlas.Services.Friends.ParseQueryString=function(){var a=new System.Uri(window.location.href);var b=a.GetQueryParameters();if(b.Friends){FreshLogicStudios.Atlas.Services.Friends.ShowPanel()}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Services.Friends.ParseQueryString));function Gps(){}Gps.Panel=null;Gps.Color=null;Gps.GpsDeviceIdToFollow=null;Gps.CenterOnDeviceToFollow=function(){if(Gps.GpsDeviceIdToFollow){var a=GpsDeviceCollection.GpsDevices[GpsDeviceCollection.IndexOf(Gps.GpsDeviceIdToFollow)];map.SetAnimationEnabled(false);map.SetCenter(a.GetPosition());map.SetAnimationEnabled(true)}};Gps.Clear=function(){for(var a=0;a<GpsDeviceCollection.GpsDevices.length;a++){if(GpsDeviceCollection.GpsDevices[a].IsContextMenuVisible()){AtlasContextMenu.Hide()}GpsDeviceCollection.GpsDevices[a].RemovePushpin()}};Gps.Initialize=function(){Gps.Color=Pushpin.GetNextColor();var a='<a href="/MyAccount/GpsDevices/">Manage GPS Devices</a>';Gps.Panel=new Panel("_Gps");Gps.Panel.SetIcon("/Services/Gps/Gps.png");Gps.Panel.SetTitle("GPS");Gps.Panel.SetHeader(a);Gps.Panel.SetHeaderHeight(15);Gps.Panel.Events.Add(new System.Event("Closed",Gps.Clear));try{pageTracker._trackEvent("GPS","Open")}catch(b){}};Gps.OnWebRequestComplete=function(q){if(Sidebar.Contains("_Gps")){if(q.get_statusCode()==200){var v=q.get_xml().getElementsByTagName("GpsDevice");var g=new Array();var f=new Array();for(var l=0;l<v.length;l++){var o=v[l].getAttribute("Id");var c=v[l].getAttribute("Name");var a=v[l].getAttribute("Owner");var p="";try{p=v[l].getElementsByTagName("Notes")[0].firstChild.data}catch(r){}var t=v[l].getElementsByTagName("Location")[0];var k=t.getAttribute("Latitude");var d=t.getAttribute("Longitude");var n=t.getAttribute("Altitude");var u=t.getAttribute("Heading");var h=t.getAttribute("Speed");var b=t.getAttribute("Modified");var j="";try{j=t.getElementsByTagName("Notes")[0].firstChild.data}catch(r){}var m=new VELatLong(k,d);g.push(m);var s=GpsDeviceCollection.Contains(o)?GpsDeviceCollection.GpsDevices[GpsDeviceCollection.IndexOf(o)]:new GpsDevice(o);s.SetName(c);s.SetOwner(a);s.SetPosition(m);s.SetAltitude(n);s.SetHeading(u);s.SetSpeed(h);s.SetModified(b);s.SetIndex(l+1);s.SetNotes(p+j);f.push(s)}GpsDeviceCollection.Synchronize(f);Gps.CenterOnDeviceToFollow();if(Gps.Panel.GetBody()=="Loading..."){if(g.length==1){map.SetAnimationEnabled(false);map.SetCenter(new VELatLong(g[0].Latitude,g[0].Longitude));map.SetAnimationEnabled(true)}else{if(g.length>1){map.SetMapView(g)}}}Gps.Panel.SetBody(GpsDeviceCollection.GetSidebarPanelHtml())}else{Gps.Panel.SetBody("");map.ShowMessage(System.String.Format("An error occured while loading data.  {0}: {1}",q.get_statusCode(),q.get_statusText()))}window.setTimeout(Gps.Populate,1000)}else{GpsDeviceCollection.Synchronize(new Array())}};Gps.Populate=function(){var a=new Sys.Net.WebRequest();a.set_url("/Services/Gps/Gps.ashx");a.add_completed(Gps.OnWebRequestComplete);a.invoke()};Gps.ShowPanel=function(){if(Sidebar.Contains("_Gps")){Gps.Panel.Maximize(true)}else{if(Gps.Panel==null){Gps.Initialize()}Sidebar.Add(Gps.Panel);Gps.Panel.SetBody("Loading...");window.setTimeout(Gps.Populate,1000)}};Gps.ParseQueryString=function(){var a=new System.Uri(window.location.href);var b=a.GetQueryParameters();if(b.Gps){Gps.ShowPanel()}};Events.Add(new System.Event("MapLoaded",Gps.ParseQueryString));function GpsDevice(s,l,o,c,r,f,k,i,u){var e=r;var w=f;var p=s;var h=0;var b=i;var d=l;var t=u;var a=o;var v=c;var j=this;var g=k;var q=false;function m(){return System.String.Format('<table><tr><td class="GpsDeviceDetailsLabel">Altitude:</td><td>{0} feet</td></tr><tr><td class="GpsDeviceDetailsLabel">Heading:</td><td>{1} degrees</td></tr><tr><td class="GpsDeviceDetailsLabel">Speed:</td><td>{2} mph</td></tr><tr><td class="GpsDeviceDetailsLabel">Updated:</td><td>{3}<br />{4} {5}</td></tr></table>',e,w,g,b.split(" ")[0],b.split(" ")[1],b.split(" ")[2])}function x(){var z=n();var y=System.String.Format('<div class="Logo"><img src="http://account.freshlogicstudios.com/Image.ashx?Email={0}" /></div>',a);y='<div class="GpsDeviceOptions">';if(z!=""){y+=System.String.Format('<a href="javascript:GpsDeviceCollection.GpsDevices[GpsDeviceCollection.IndexOf(\'{0}\')].ToggleNotes();" id="{0}_ToggleNotesLink">{1}</a> | ',p,q?"hide notes":"notes")}if(p!=Gps.GpsDeviceIdToFollow){y+="<a href=\"#\" onclick=\"this.innerHTML = 'stop following'; Gps.GpsDeviceIdToFollow = '"+p+"'; return false;\">start following</a>"}else{y+='<a href="#" onclick="this.innerHTML = \'start following\'; Gps.GpsDeviceIdToFollow = null; return false;">stop following</a>'}y+="</div>";return y+'<table id="'+(p+"_Location")+'" style="display:'+(q?"none":"block")+';"><tr><td class="GpsDeviceDetailsLabel">Altitude:</td><td>'+e+' feet</td></tr><tr><td class="GpsDeviceDetailsLabel">Heading:</td><td>'+w+' degrees</td></tr><tr><td class="GpsDeviceDetailsLabel">Speed:</td><td>'+g+' mph</td></tr><tr><td class="GpsDeviceDetailsLabel">Updated:</td><td>'+b.split(" ")[0]+"<br />"+b.split(" ")[1]+" "+b.split(" ")[2]+"</td></tr></table>"+z}function n(){if(t&&t!=""){return'<div id="'+(p+"_Notes")+'" style="display:'+(q?"block":"none")+';">'+t+"</div>"}return""}this.AddPushpin=function(){var A=System.String.Format("/Pushpin/Image.ashx?Color={0}&Text={1}",Gps.Color,h);var y=new VEPushpin(p,new VELatLong(v.Latitude,v.Longitude),A,d,m(),"AtlasPushpin");var z=this.IsContextMenuVisible();this.RemovePushpin();map.AddAtlasPushpin(y);if(z){Pushpin.ShowContextMenu(y.ID)}};this.GetAltitude=function(){return e};this.GetHeading=function(){return w};this.GetId=function(){return p};this.GetIndex=function(){return h};this.GetName=function(){return d};this.GetNotes=function(){return t};this.GetOwner=function(){return a};this.GetPosition=function(){return v};this.GetSidebarPanelHtml=function(){var y=System.String.Format("/Pushpin/Image.ashx?Color={0}&Text={1}",Gps.Color,h);var z='<li class="PanelItem">';z+=System.String.Format('<a href="javascript:Pushpin.ShowContextMenu(\'{1}\'); Pushpin.Center(\'{1}\');"><img class="PanelPushpin" src="{0}" /></a>',y,p);z+='<div class="PanelItemDetail">';z+=System.String.Format("<a class=\"DetailTitle\" href=\"javascript:Pushpin.ShowContextMenu('{0}'); Pushpin.Center('{0}');\">{1}</a>",p,d);z+=System.String.Format('<div class="DetailContent">{0}</div>',x());z+="</div>";z+="</li>";return z};this.GetSpeed=function(){return g};this.GetModified=function(){return b};this.IsContextMenuVisible=function(){return(CurrentPushpin!=null&&CurrentPushpin.ID==p&&AtlasContextMenu.IsVisible())};this.RemovePushpin=function(){try{map.DeletePushpin(p)}catch(y){}};this.SetAltitude=function(y){e=y};this.SetHeading=function(y){w=y};this.SetIndex=function(y){h=y};this.SetModified=function(y){b=y};this.SetName=function(y){d=y};this.SetNotes=function(y){t=y};this.SetOwner=function(y){a=y};this.SetPosition=function(y){v=y};this.SetSpeed=function(y){g=y};this.ToggleNotes=function(){if(!q){document.getElementById(p+"_ToggleNotesLink").innerHTML="hide notes";document.getElementById(p+"_Location").style.display="none";document.getElementById(p+"_Notes").style.display="block"}else{document.getElementById(p+"_ToggleNotesLink").innerHTML="notes";document.getElementById(p+"_Notes").style.display="none";document.getElementById(p+"_Location").style.display="block"}q=!q};this.UpdatePushpin=function(){j.AddPushpin()}}function GpsDeviceCollection(){}GpsDeviceCollection.GpsDevices=new Array();GpsDeviceCollection.GpsDeviceIdToFollow=null;GpsDeviceCollection.Add=function(a){GpsDeviceCollection.GpsDevices.push(a)};GpsDeviceCollection.Contains=function(a){for(var b=0;b<GpsDeviceCollection.GpsDevices.length;b++){if(GpsDeviceCollection.GpsDevices[b].GetId()==a){return true}}return false};GpsDeviceCollection.IndexOf=function(a){for(var b=0;b<GpsDeviceCollection.GpsDevices.length;b++){if(GpsDeviceCollection.GpsDevices[b].GetId()==a){return b}}return -1};GpsDeviceCollection.Remove=function(a){for(var b=GpsDeviceCollection.GpsDevices.length-1;b>=0;b--){if(GpsDeviceCollection.GpsDevices[b].GetId()==a.GetId()){GpsDeviceCollection.GpsDevices.splice(b,1)}}};GpsDeviceCollection.Synchronize=function(c){for(var a=0;a<c.length;a++){if(GpsDeviceCollection.Contains(c[a].GetId())){GpsDeviceCollection.GpsDevices[GpsDeviceCollection.IndexOf(c[a].GetId())]=c[a]}else{GpsDeviceCollection.Add(c[a])}c[a].UpdatePushpin()}for(var a=0;a<GpsDeviceCollection.GpsDevices.length;a++){var d=false;for(var b=0;b<c.length;b++){if(GpsDeviceCollection.GpsDevices[a].GetId()==c[b].GetId()){d=true;break}}if(!d){GpsDeviceCollection.GpsDevices[a].RemovePushpin();GpsDeviceCollection.Remove(GpsDeviceCollection.GpsDevices[a])}}};GpsDeviceCollection.GetSidebarPanelHtml=function(){if(GpsDeviceCollection.GpsDevices.length==0){return"You currently have no GPS devices added to your account or your GPS devices haven't reported any locations yet."}var b="<ul>";for(var a=0;a<GpsDeviceCollection.GpsDevices.length;a++){b+=GpsDeviceCollection.GpsDevices[a].GetSidebarPanelHtml()}b+="</ul>";return b};
