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 b='<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(b);Gps.Panel.SetHeaderHeight(15);Gps.Panel.Events.Add(new System.Event("Closed",Gps.Clear));try{pageTracker._trackEvent("GPS","Open")}catch(a){}};Gps.OnWebRequestComplete=function(q){if(Sidebar.Contains("_Gps")){if(q.get_statusCode()==200){var t=q.get_xml().getElementsByTagName("GpsDevice");var f=new Array();var c=new Array();for(var k=0;k<t.length;k++){var o=t[k].getAttribute("Id");var g=t[k].getAttribute("Name");var d=t[k].getAttribute("Owner");var b="";try{b=t[k].getElementsByTagName("Notes")[0].firstChild.data}catch(n){}var u=t[k].getElementsByTagName("Location")[0];var h=u.getAttribute("Latitude");var r=u.getAttribute("Longitude");var p=u.getAttribute("Altitude");var v=u.getAttribute("Heading");var l=u.getAttribute("Speed");var j=u.getAttribute("Modified");var a="";try{a=u.getElementsByTagName("Notes")[0].firstChild.data}catch(n){}var m=new VELatLong(h,r);f.push(m);var s=GpsDeviceCollection.Contains(o)?GpsDeviceCollection.GpsDevices[GpsDeviceCollection.IndexOf(o)]:new GpsDevice(o);s.SetName(g);s.SetOwner(d);s.SetPosition(m);s.SetAltitude(p);s.SetHeading(v);s.SetSpeed(l);s.SetModified(j);s.SetIndex(k+1);s.SetNotes(b+a);c.push(s)}GpsDeviceCollection.Synchronize(c);Gps.CenterOnDeviceToFollow();if(Gps.Panel.GetBody()=="Loading..."){if(f.length==1){map.SetAnimationEnabled(false);map.SetCenter(new VELatLong(f[0].Latitude,f[0].Longitude));map.SetAnimationEnabled(true)}else{if(f.length>1){map.SetMapView(f)}}}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 b=new System.Uri(window.location.href);var a=b.GetQueryParameters();if(a.Gps){Gps.ShowPanel()}};Events.Add(new System.Event("MapLoaded",Gps.ParseQueryString));function GpsDevice(e,t,q,n,h,a,l,g,i){var f=h;var x=a;var s=e;var c=0;var k=g;var j=t;var r=i;var v=q;var u=n;var w=this;var p=l;var o=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>',f,x,p,k.split(" ")[0],k.split(" ")[1],k.split(" ")[2])}function b(){var y=d();var z=System.String.Format('<div class="Logo"><img src="http://account.freshlogicstudios.com/Image.ashx?Email={0}" /></div>',v);z='<div class="GpsDeviceOptions">';if(y!=""){z+=System.String.Format('<a href="javascript:GpsDeviceCollection.GpsDevices[GpsDeviceCollection.IndexOf(\'{0}\')].ToggleNotes();" id="{0}_ToggleNotesLink">{1}</a> | ',s,o?"hide notes":"notes")}if(s!=Gps.GpsDeviceIdToFollow){z+="<a href=\"#\" onclick=\"this.innerHTML = 'stop following'; Gps.GpsDeviceIdToFollow = '"+s+"'; return false;\">start following</a>"}else{z+='<a href="#" onclick="this.innerHTML = \'start following\'; Gps.GpsDeviceIdToFollow = null; return false;">stop following</a>'}z+="</div>";return z+'<table id="'+(s+"_Location")+'" style="display:'+(o?"none":"block")+';"><tr><td class="GpsDeviceDetailsLabel">Altitude:</td><td>'+f+' feet</td></tr><tr><td class="GpsDeviceDetailsLabel">Heading:</td><td>'+x+' degrees</td></tr><tr><td class="GpsDeviceDetailsLabel">Speed:</td><td>'+p+' mph</td></tr><tr><td class="GpsDeviceDetailsLabel">Updated:</td><td>'+k.split(" ")[0]+"<br />"+k.split(" ")[1]+" "+k.split(" ")[2]+"</td></tr></table>"+y}function d(){if(r&&r!=""){return'<div id="'+(s+"_Notes")+'" style="display:'+(o?"block":"none")+';">'+r+"</div>"}return""}this.AddPushpin=function(){var y=System.String.Format("/Pushpin/Image.ashx?Color={0}&Text={1}",Gps.Color,c);var z=new VEPushpin(s,new VELatLong(u.Latitude,u.Longitude),y,j,m(),"AtlasPushpin");var A=this.IsContextMenuVisible();this.RemovePushpin();map.AddAtlasPushpin(z);if(A){Pushpin.ShowContextMenu(z.ID)}};this.GetAltitude=function(){return f};this.GetHeading=function(){return x};this.GetId=function(){return s};this.GetIndex=function(){return c};this.GetName=function(){return j};this.GetNotes=function(){return r};this.GetOwner=function(){return v};this.GetPosition=function(){return u};this.GetSidebarPanelHtml=function(){var y=System.String.Format("/Pushpin/Image.ashx?Color={0}&Text={1}",Gps.Color,c);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,s);z+='<div class="PanelItemDetail">';z+=System.String.Format("<a class=\"DetailTitle\" href=\"javascript:Pushpin.ShowContextMenu('{0}'); Pushpin.Center('{0}');\">{1}</a>",s,j);z+=System.String.Format('<div class="DetailContent">{0}</div>',b());z+="</div>";z+="</li>";return z};this.GetSpeed=function(){return p};this.GetModified=function(){return k};this.IsContextMenuVisible=function(){return(CurrentPushpin!=null&&CurrentPushpin.ID==s&&AtlasContextMenu.IsVisible())};this.RemovePushpin=function(){try{map.DeletePushpin(s)}catch(y){}};this.SetAltitude=function(y){f=y};this.SetHeading=function(y){x=y};this.SetIndex=function(y){c=y};this.SetModified=function(y){k=y};this.SetName=function(y){j=y};this.SetNotes=function(y){r=y};this.SetOwner=function(y){v=y};this.SetPosition=function(y){u=y};this.SetSpeed=function(y){p=y};this.ToggleNotes=function(){if(!o){document.getElementById(s+"_ToggleNotesLink").innerHTML="hide notes";document.getElementById(s+"_Location").style.display="none";document.getElementById(s+"_Notes").style.display="block"}else{document.getElementById(s+"_ToggleNotesLink").innerHTML="notes";document.getElementById(s+"_Notes").style.display="none";document.getElementById(s+"_Location").style.display="block"}o=!o};this.UpdatePushpin=function(){w.AddPushpin()}}function GpsDeviceCollection(){}GpsDeviceCollection.GpsDevices=new Array();GpsDeviceCollection.GpsDeviceIdToFollow=null;GpsDeviceCollection.Add=function(a){GpsDeviceCollection.GpsDevices.push(a)};GpsDeviceCollection.Contains=function(b){for(var a=0;a<GpsDeviceCollection.GpsDevices.length;a++){if(GpsDeviceCollection.GpsDevices[a].GetId()==b){return true}}return false};GpsDeviceCollection.IndexOf=function(b){for(var a=0;a<GpsDeviceCollection.GpsDevices.length;a++){if(GpsDeviceCollection.GpsDevices[a].GetId()==b){return a}}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(b){for(var c=0;c<b.length;c++){if(GpsDeviceCollection.Contains(b[c].GetId())){GpsDeviceCollection.GpsDevices[GpsDeviceCollection.IndexOf(b[c].GetId())]=b[c]}else{GpsDeviceCollection.Add(b[c])}b[c].UpdatePushpin()}for(var c=0;c<GpsDeviceCollection.GpsDevices.length;c++){var a=false;for(var d=0;d<b.length;d++){if(GpsDeviceCollection.GpsDevices[c].GetId()==b[d].GetId()){a=true;break}}if(!a){GpsDeviceCollection.GpsDevices[c].RemovePushpin();GpsDeviceCollection.Remove(GpsDeviceCollection.GpsDevices[c])}}};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 a="<ul>";for(var b=0;b<GpsDeviceCollection.GpsDevices.length;b++){a+=GpsDeviceCollection.GpsDevices[b].GetSidebarPanelHtml()}a+="</ul>";return a};RegisterNamespace("FreshLogicStudios.Atlas.Services");FreshLogicStudios.Atlas.Services.Friend=function(l,a,d,m,i){var k=m;var f=l;var e=0;var c=i;var g=a;var b=d;var n=this;function h(){var o=System.String.Format('<div class="Logo"><img src="http://account.freshlogicstudios.com/Image.ashx?Email={0}" /></div>',f);o+=System.String.Format("{0}<p>Updated {1} {2} {3}",k,c.split(" ")[0],c.split(" ")[1],c.split(" ")[2]);return o}function j(){var o=h();o+='<div class="GpsDeviceOptions">';if(f!=FreshLogicStudios.Atlas.Services.Friends.FriendToFollow){o+="<a href=\"#\" onclick=\"this.innerHTML = 'stop following'; FreshLogicStudios.Atlas.Services.Friends.FriendToFollow = '"+f+"'; 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 o=System.String.Format("/Pushpin/Image.ashx?Color={0}&Text={1}",FreshLogicStudios.Atlas.Services.Friends.Color,e);var p=new VEPushpin(f,new VELatLong(b.Latitude,b.Longitude),o,g,h(),"AtlasPushpin");var q=this.IsContextMenuVisible();this.RemovePushpin();map.AddAtlasPushpin(p);if(q){Pushpin.ShowContextMenu(p.ID)}};this.GetAddress=function(){return k};this.GetEmail=function(){return f};this.GetIndex=function(){return e};this.GetModified=function(){return c};this.GetName=function(){return g};this.GetPosition=function(){return b};this.GetSidebarPanelHtml=function(){var o=System.String.Format("/Pushpin/Image.ashx?Color={0}&Text={1}",FreshLogicStudios.Atlas.Services.Friends.Color,e);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,f);p+='<div class="PanelItemDetail">';p+=System.String.Format("<a class=\"DetailTitle\" href=\"javascript:Pushpin.ShowContextMenu('{0}'); Pushpin.Center('{0}');\">{1}</a>",f,g);p+=System.String.Format('<div class="DetailContent">{0}</div>',j());p+="</div>";p+="</li>";return p};this.IsContextMenuVisible=function(){return(CurrentPushpin!=null&&CurrentPushpin.ID==f&&AtlasContextMenu.IsVisible())};this.RemovePushpin=function(){try{map.DeletePushpin(f)}catch(o){}};this.SetAddress=function(o){k=o};this.SetEmail=function(o){f=o};this.SetIndex=function(o){e=o};this.SetModified=function(o){c=o};this.SetName=function(o){g=o};this.SetPosition=function(o){b=o};this.UpdatePushpin=function(){n.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(b){for(var a=FreshLogicStudios.Atlas.Services.FriendList.Friends.length-1;a>=0;a--){if(FreshLogicStudios.Atlas.Services.FriendList.Friends[a].GetEmail()==b.GetEmail()){FreshLogicStudios.Atlas.Services.FriendList.Friends.splice(a,1)}}};FreshLogicStudios.Atlas.Services.FriendList.Synchronize=function(b){for(var c=0;c<b.length;c++){if(FreshLogicStudios.Atlas.Services.FriendList.Contains(b[c].GetEmail())){FreshLogicStudios.Atlas.Services.FriendList.Friends[FreshLogicStudios.Atlas.Services.FriendList.IndexOf(b[c].GetEmail())]=b[c]}else{FreshLogicStudios.Atlas.Services.FriendList.Add(b[c])}b[c].UpdatePushpin()}for(var c=0;c<FreshLogicStudios.Atlas.Services.FriendList.Friends.length;c++){var a=false;for(var d=0;d<b.length;d++){if(FreshLogicStudios.Atlas.Services.FriendList.Friends[c].GetEmail()==b[d].GetEmail()){a=true;break}}if(!a){FreshLogicStudios.Atlas.Services.FriendList.Friends[c].RemovePushpin();FreshLogicStudios.Atlas.Services.FriendList.Remove(FreshLogicStudios.Atlas.Services.FriendList.Friends[c])}}};FreshLogicStudios.Atlas.Services.FriendList.GetSidebarPanelHtml=function(){if(FreshLogicStudios.Atlas.Services.FriendList.Friends.length==0){return""}var a="<ul>";for(var b=0;b<FreshLogicStudios.Atlas.Services.FriendList.Friends.length;b++){a+=FreshLogicStudios.Atlas.Services.FriendList.Friends[b].GetSidebarPanelHtml()}a+="</ul>";return a};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 a='<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(a);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(b){}};FreshLogicStudios.Atlas.Services.Friends.OnWebRequestComplete=function(c){if(Sidebar.Contains("_Friends")){if(c.get_statusCode()==200){var n=c.get_xml().getElementsByTagName("Friend");var g=new Array();var j=new Array();for(var a=0;a<n.length;a++){var m=n[a].getAttribute("Email");var h=n[a].getAttribute("Name");var l=n[a].getAttribute("Address");var d=n[a].getAttribute("Modified");var f=n[a].getElementsByTagName("Location")[0];var k=f.getAttribute("Latitude");var o=f.getAttribute("Longitude");var b=new VELatLong(k,o);j.push(b);var e=FreshLogicStudios.Atlas.Services.FriendList.Contains(m)?FreshLogicStudios.Atlas.Services.FriendList.Friends[FreshLogicStudios.Atlas.Services.FriendList.IndexOf(m)]:new FreshLogicStudios.Atlas.Services.Friend(m);e.SetAddress(l);e.SetName(h);e.SetPosition(b);e.SetModified(d);e.SetIndex(a+1);g.push(e)}FreshLogicStudios.Atlas.Services.FriendList.Synchronize(g);FreshLogicStudios.Atlas.Services.Friends.CenterOnFriendToFollow();if(FreshLogicStudios.Atlas.Services.Friends.Panel.GetBody()=="Loading..."){if(j.length==1){map.SetAnimationEnabled(false);map.SetCenter(new VELatLong(j[0].Latitude,j[0].Longitude));map.SetAnimationEnabled(true)}else{if(j.length>1){map.SetMapView(j)}}}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}",c.get_statusCode(),c.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 b=new System.Uri(window.location.href);var a=b.GetQueryParameters();if(a.Friends){FreshLogicStudios.Atlas.Services.Friends.ShowPanel()}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Services.Friends.ParseQueryString));RegisterNamespace("FreshLogicStudios.Atlas.Advertisements");FreshLogicStudios.Atlas.Advertisements=function(){};FreshLogicStudios.Atlas.Advertisements.Element=null;FreshLogicStudios.Atlas.Advertisements.Keywords=new Array();FreshLogicStudios.Atlas.Advertisements.Pushpins=new Array();FreshLogicStudios.Atlas.Advertisements.HidePushpins=function(a){for(var b=0;b<FreshLogicStudios.Atlas.Advertisements.Pushpins.length;b++){map.RemoveAtlasPushpin(FreshLogicStudios.Atlas.Advertisements.Pushpins[b])}FreshLogicStudios.Atlas.Advertisements.Pushpins=new Array();FreshLogicStudios.Atlas.Advertisements.PerformLayout()};FreshLogicStudios.Atlas.Advertisements.Initialize=function(){try{Lat49.initAds("4");Lat49.Keywords.enable();FreshLogicStudios.Atlas.Advertisements.Update();map.AttachEvent("onchangeview",FreshLogicStudios.Atlas.Advertisements.Update);map.AttachEvent("onchangemapstyle",FreshLogicStudios.Atlas.Advertisements.Update);map.AttachEvent("onendzoom",FreshLogicStudios.Atlas.Advertisements.Update);map.AttachEvent("onresize",FreshLogicStudios.Atlas.Advertisements.Update)}catch(a){}FreshLogicStudios.Atlas.Advertisements.Element=document.getElementById("Advertisements")};FreshLogicStudios.Atlas.Advertisements.PerformLayout=function(){if(FreshLogicStudios.Atlas.Advertisements.Element){var a=MainMenu.GetHeight()+20;if(Toolbox.Panel.IsVisible()){a+=Toolbox.Panel.GetCurrentSize().Height}FreshLogicStudios.Atlas.Advertisements.Element.style.top=a+"px"}};FreshLogicStudios.Atlas.Advertisements.ShowPushpins=function(c){var e=new Array();for(var d=0;d<c.length;d++){var b=new VELatLong(c[d].lat,c[d].lon);var a=new VEPushpin(System.Guid.NewGuid(),b,c[d].pinurl,c[d].title,c[d].address,"AdvertisementPushpin");e.push(b);FreshLogicStudios.Atlas.Advertisements.Pushpins.push(a);map.AddAtlasPushpin(a)}FreshLogicStudios.Atlas.Advertisements.PerformLayout()};FreshLogicStudios.Atlas.Advertisements.Update=function(a){try{var b=(a&&a.zoomLevel)?a.zoomLevel:map.GetZoomLevel();var d=(a&&a.mapX&&a.mapY)?map.PixelToLatLong(new VEPixel(a.mapX,a.mapY)):map.GetCenter();var f=map.GetMapView();if(FreshLogicStudios.Atlas.Advertisements.Keywords.length>0){Lat49.Keywords.setUserKeywords(FreshLogicStudios.Atlas.Advertisements.Keywords.join())}Lat49.updateAdByLatLonWithExtents("Advertisements",d.Latitude,d.Longitude,Lat49.Tile.convertLiveZoom(b),f.BottomRightLatLong.Latitude,f.TopLeftLatLong.Longitude,f.TopLeftLatLong.Latitude,f.BottomRightLatLong.Longitude)}catch(c){}};FreshLogicStudios.Atlas.Advertisements.Updated=function(a){};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Advertisements.Initialize));var map=null;var Sidebar=null;var AtlasContextMenu=null;var CurrentPushpin=null;var MainMenu=null;var Plugins=[];function DecodeLatLong(b){if(b._reserved&&(!b.Latitude||!b.Longitude)){var a=new _xz1().Decode(b._reserved);b.Latitude=a[0];b.Longitude=a[1];a=null}}function InitializeQueryString(){var b=new System.Uri(window.location.href);var a=b.GetQueryParameters();if(a.cp){System.Configuration.Settings.Latitude=a.cp.split("~")[0];System.Configuration.Settings.Longitude=a.cp.split("~")[1]}System.Configuration.Settings.MapStyle=a.style||System.Configuration.Settings.MapStyle;System.Configuration.Settings.MapZoomLevel=a.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(a){var b=a.latLong||map.PixelToLatLong(new VEPixel(a.mapX,a.mapY));AtlasContextMenu.SetTitle("Options");AtlasContextMenu.SetBody("");AtlasContextMenu.SetLocation(b);AtlasContextMenu.SetSize(Panel.DefaultSize);AtlasContextMenu.Show();CurrentPushpin=null}function map_Loaded(a){map.HideDashboard();Events.Fire("MapLoaded");MainMenu.Events.Add(new System.Event("MenuResized",FreshLogicStudios.Atlas.Advertisements.PerformLayout));Toolbox.Panel.Events.Add(new System.Event("Closed",FreshLogicStudios.Atlas.Advertisements.PerformLayout));Toolbox.Panel.Events.Add(new System.Event("Maximized",FreshLogicStudios.Atlas.Advertisements.PerformLayout));Toolbox.Panel.Events.Add(new System.Event("Minimized",FreshLogicStudios.Atlas.Advertisements.PerformLayout));Toolbox.Panel.Events.Add(new System.Event("Resized",FreshLogicStudios.Atlas.Advertisements.PerformLayout))}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 e=this.vemapcontrol.PixelToLatLong(b);var c=new VELatLongFactory(new VELatLongFactoryAlwaysEncodeSpec()).CreateVELatLong(e.latitude,e.longitude);var d=new VELatLong(e.latitude,e.longitude);d._reserved=c._reserved;return d};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 c=0;c<d.length;c++){var a=d[c].string;var b=d[c].prop;this.versionSearchString=d[c].versionSearch||d[c].identity;if(a){if(a.indexOf(d[c].subString)!=-1){return d[c].identity}}else{if(b){return d[c].identity}}}},searchVersion:function(a){var b=a.indexOf(this.versionSearchString);if(b==-1){return}return parseFloat(a.substring(b+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(e){var b=0;var c=0;var a=0;var d=0;if(BrowserDetect.browser=="Safari"){do{c+=e.offsetTop||0;b+=e.offsetLeft||0;if(e.offsetParent&&e.offsetParent==document.body){if(document.getElementStyle(e,"position")=="absolute"){break}}e=e.offsetParent}while(e);return new System.Drawing.Point(b,c)}else{if(e.offsetParent){b=e.offsetLeft;c=e.offsetTop;while(e=e.offsetParent){b+=e.offsetLeft;c+=e.offsetTop}}return new System.Drawing.Point(b-d,c)}};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(d,e){return e.toUpperCase()});a=c.currentStyle[b]}}return a};document.getEventLocation=function(c){var a=0;var b=0;try{if(c.pageX||c.pageY){a=c.pageX;b=c.pageY}else{if(c.clientX||c.clientY){a=c.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;b=c.clientY+document.body.scrollTop+document.documentElement.scrollTop}}}catch(c){return null}return new System.Drawing.Point(a,b)};RegisterNamespace("FreshLogicStudios.Atlas");FreshLogicStudios.Atlas.Item=function(f,a,e,c,d,g){var b=System.Guid.NewGuid();var i=null;var j=this;this.Color=d||"Red";this.ContextMenuDetails=e||"";this.Number=g||1;this.Position=c||null;this.SidebarDetails=a||"";this.Title=f||"";function h(){return System.String.Format("/Pushpin/Image.ashx?Color={0}&Text={1}",d,g)}this.Center=function(){Pushpin.Center(b)};this.GetPushpin=function(){if(i==null&&j.Position!=null){i=new VEPushpin(b,j.Position,h(),j.Title,j.ContextMenuDetails,"AtlasPushpin")}return i};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>',h(),b);k+='<div class="PanelItemDetail">';k+=System.String.Format("<a class=\"DetailTitle\" href=\"javascript:Pushpin.ShowContextMenu('{0}'); Pushpin.Center('{0}');\">{1}</a>",b,j.Title);k+=System.String.Format('<div class="DetailContent">{0}</div>',j.SidebarDetails);k+="</div>";k+="</li>";return k};this.HidePushpin=function(){if(i){map.RemoveAtlasPushpin(i)}i=null};this.ShowContextMenu=function(){Pushpin.ShowContextMenu(b)};this.ShowPushpin=function(){map.AddAtlasPushpin(j.GetPushpin())}};RegisterNamespace("FreshLogicStudios.Atlas.Items");FreshLogicStudios.Atlas.Items.Clear=function(a){for(var b=0;b<a.GetCount();b++){a.GetItem(b).HidePushpin()}a.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(a){if(a.GetCount()>0){var c=new Array();for(var b=0;b<a.GetCount();b++){c.push(a.GetItem(b).Position)}map.SetMapView(c)}};RegisterNamespace("FreshLogicStudios.Atlas");FreshLogicStudios.Atlas.Plugin=function(a){var e=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[e]=d;d.Panel=new Panel(e);d.Panel.Events.Add(new System.Event("Closed",d.Close));Sidebar.Add(d.Panel);d.RenderPanelHeader()}function b(j,f,k,g){d.Places=k;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 h='<div class="PanelBodyHeader"><div class="Summary">Did you mean?</div></div>';h+='<ol class="AmbiguousPlaces">';for(var l=0;l<d.Places.length;l++){DecodeLatLong(d.Places[l].LatLong);h+=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>",e,l,d.Places[l].Name)}h+="</ol>";d.Panel.SetBody(h)}}}}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,b);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();FreshLogicStudios.Atlas.Advertisements.Update()};this.GetId=function(){return e};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;">',e);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 c=a.length-1;c>=0;c--){var b=a.pop();this.RemoveAtlasPushpin(b)}};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(a){var b=new Panel("Message");b.SetSize(new System.Drawing.Size(300,0));b.SetLocation(new System.Drawing.Point((GetWindowWidth()/2)-(b.GetSize().Width/2),GetWindowHeight()/2));b.SetTitle("Message");b.SetIcon("/Images/Message.png");b.SetBody(a);b.Show();window.setTimeout(function(){b.Close()},5000)};VEMap.prototype.ShowTraffic=function(){if(!this.TrafficCount){this.TrafficCount=0}this.TrafficCount++;this.LoadTraffic(true)};(function(e){var d=38,g=40,c=13,j=27,a=115;e.widget("ui.combobox",{init:function(){var k=this;var n=this.options;var o=e('<input type = "text" />');if(this.element[0].tagName.toLowerCase()=="select"){b(n,this.element)}function l(){k.hideList();e(document).unbind("click",l)}this.arrowElem=e(this.options.arrowHTML.call(this)).click(function(p){if(k.isListVisible()){k.hideList()}else{k.showList();e(document).click(l)}return false});function m(p,q){var r=k.element.attr(p);if(r){if(p=="class"){q.addClass(r)}else{q.attr(p,r)}}}m("class",o);m("name",o);m("title",o);m("dir",o);m("lang",o);m("xml:lang",o);m("size",o);m("value",o);if(this.element.attr("maxlength")!=-1){o.attr("maxlength",this.element.attr("maxlength"))}this.oldElem=this.element.unbind("getData.combobox").unbind("setData.combobox").unbind("remove").after(this.arrowElem).after(o).remove();this.listElem=this.buildList().insertAfter(this.arrowElem).hide();m("id",o);m("class",this.listElem);m("class",this.arrowElem);this.element=o.keyup(function(p){if(p.which==a){k.showList(p)}}).change(f(this,"fireEvent","select"));if(n.autoShow){this.element.focus(f(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,l){this.options[m]=l;if(m=="disabled"&&this.isListVisible()){this.hideList()}if(m=="data"||m=="listContainerTag"||m=="listHTML"){var k=this.isListVisible();this.listElem=this.buildList().replaceAll(this.listElem);this[k?"showList":"hideList"]()}},buildList:function(){var k=this;var n=this.options;var l=n.listContainerTag;var m=e("<"+l+' class = "ui-combobox-list"></'+l+">");e.each(n.data,function(o,p){e(n.listHTML(p,o)).appendTo(m).click(f(k,"finishSelection",o)).mouseover(f(k,"changeSelection",o))});return m},isListVisible:function(){return this.listElem.is(":visible")},showList:function(l){if(this.options.disabled){return}var k=this.element.position();k.top+=this.element.height()+5;k.width=this.element.width();k.position="absolute";this.boundKeyHandler=f(this,"keyHandler");e(document).keyup(this.boundKeyHandler);e(".ui-combobox-list").hide();this.listElem.css(k).show();this.changeSelection(this.findSelection(),l)},hideList:function(){this.listElem.hide();e(document).unbind("keyup",this.boundKeyHandler)},keyHandler:function(l){if(this.options.disabled){return}var m=this.options.data.length;switch(l.which){case j:this.hideList();break;case d:var k=this.selectedIndex-1;if(k<0){k=m-1}this.changeSelection(k,l);break;case g:this.changeSelection((this.selectedIndex+1)%m,l);break;case c:this.finishSelection(this.selectedIndex,l);break;default:this.fireEvent("key",l);this.changeSelection(this.findSelection());break}},prepareCallbackObj:function(l){l=l||this.element.val();var k=e.inArray(l,this.options.data);return{value:l,index:k,isCustom:k==-1,inputElement:this.element,listElement:this.listElement}},fireEvent:function(l,k,m){this.element.triggerHandler("combobox"+l,[k,this.prepareCallbackObj(m)],this.options[l])},findSelection:function(){var o=this.options.data;var m=this.element.val().toLowerCase();for(var l=0,k=o.length;l<k;++l){var n=o[l].toLowerCase().indexOf(m);if(n==0){return l}}if(this.options.matchMiddle){for(var l=0,k=o.length;l<k;++l){var n=o[l].toLowerCase().indexOf(m);if(n!=-1){return l}}}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:i}});var h=e.fn.combobox;e.fn.combobox=function(){var k=h.apply(this,arguments);if(!(k instanceof e)){return k}var l=false;var m=e(e.map(k,function(p){var o=e.data(p,"combobox");if(o&&o.element[0]!=p){l=true;var n=o.element[0];e.data(n,"combobox",o);return n}else{return p}}));return !l?k:m.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 i(m,k){var l=k%2?"odd":"even";return'<span class = "ui-combobox-item '+l+'">'+m+"</span>"}function f(k,l){var m=[].slice.call(arguments,2);return function(){k[l].apply(k,m.concat([].slice.call(arguments)))}}function b(l,m){var n={},k=[];m.children().each(function(o){if(this.tagName.toLowerCase()=="option"){var q=e(this).text(),p=this.getAttribute("value")||q;n[p]=q;k.push(p)}});if(!l.data.length){l.data=k}if(l.listHTML==i){l.listHTML=function(p,o){return i(n[p]||p)}}}})(jQuery);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(b){for(var a=0;a<map.pushpins.length;a++){if(map.pushpins[a].ID==b){return map.pushpins[a]}}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(a){var b=Pushpin.FromId(a);if(b!=null){AtlasContextMenu.SetSize(Panel.DefaultSize);AtlasContextMenu.SetLocation(b.LatLong);AtlasContextMenu.SetTitle(b.Title);AtlasContextMenu.SetBody(b.Details);AtlasContextMenu.Show(true);CurrentPushpin=b}};VEPushpin.ShowDetailOnMouseOver=false;Panel.DefaultSize=new System.Drawing.Size(240,"auto");Panel.MinimumSize=new System.Drawing.Size(44,49);function Panel(o){var C=this;var F="";var d=o;var H=null;var M=false;var k=Panel.DefaultSize.Clone();var G=null;var e=null;var t=false;var z=false;var E=0;var p=null;var c=null;var r=null;var u=null;var I=null;var b=null;var g=null;var v=null;var B=null;var q=null;var n=null;var x=null;var m=null;var a=null;var f=null;var i=null;var j=null;var w=null;var l=null;var P=null;var D=null;var A=null;var O=null;var N=null;this.Events=new System.EventCollection();function J(){var U=u.style.display;var T=u.style.height;var Q=O.style.display;var R=A.style.display;var V=N.style.display;var W=O.style.height;u.style.display="block";O.style.display="block";A.style.display="block";N.style.display="block";u.style.height="auto";O.style.height="auto";var S=Math.max(O.offsetHeight,O.scrollHeight);if(O.innerHTML==""){S=0}u.style.display=U;O.style.display=Q;A.style.display=R;N.style.display=V;u.style.height=T;O.style.height=W;return Panel.MinimumSize.Height+(p.Height>0?p.Height+15:5)+(S>0?S+10:0)+(c.Height>0?c.Height+5:0)}function L(){r=document.createElement("div");u=document.createElement("div");I=document.createElement("div");b=document.createElement("div");g=document.createElement("div");v=document.createElement("div");B=document.createElement("div");q=document.createElement("div");n=document.createElement("div");x=document.createElement("div");m=document.createElement("div");a=document.createElement("div");f=document.createElement("div");i=document.createElement("div");j=document.createElement("div");w=document.createElement("div");l=document.createElement("div");P=document.createElement("a");D=document.createElement("img");A=document.createElement("div");O=document.createElement("div");N=document.createElement("div");r.id=d;r.oncontextmenu=function(){return false};r.className="Panel";v.className="Header";q.className="Left";n.className="Right";x.className="Center";u.className="Body";I.className="Left";b.className="Right";g.className="Center";B.className="Footer";m.className="Left";a.className="Right";f.className="Center";i.className="EventLayer";A.className="ContentHeader";O.className="ContentBody";N.className="ContentFooter";v.appendChild(q);v.appendChild(n);v.appendChild(x);u.appendChild(I);u.appendChild(b);u.appendChild(g);B.appendChild(m);B.appendChild(a);B.appendChild(f);g.appendChild(A);g.appendChild(O);g.appendChild(N);r.appendChild(i);r.appendChild(v);r.appendChild(u);r.appendChild(B);j.className="TitleBar";w.className="Icon";l.className="Title";P.className="CloseButton";D.className="MinMaxButton";P.innerHTML="x";P.href="#";P.title="Close";P.onclick=function(){C.Close();return false};D.src="/Panel/Images/Minimize.gif";D.alt="Minimize";D.onclick=function(){C.Minimize(true);return false};j.appendChild(w);j.appendChild(l);j.appendChild(P);j.appendChild(D);v.appendChild(j);var Q=document.getElementById("Panels");if(!Q){Q=document.createElement("div");Q.id="Panels";document.body.appendChild(Q)}Q.appendChild(r);p=new System.Drawing.Size(k.Width-Panel.MinimumSize.Width,0);c=new System.Drawing.Size(k.Width-Panel.MinimumSize.Width,0);C.SetLocation(H);C.SetSize(k)}function K(R){var V=R-Panel.MinimumSize.Height;var U=V-10;var S=(p.Height>0)?p.Height+10:0;var Q=(c.Height>0)?c.Height+5:0;if(R<Panel.MinimumSize.Height){R=Panel.MinimumSize.Height}if(S+Q>V){N.style.display="none";if(S>V){A.style.display="none"}else{if(p.Height>0){A.style.display="block";U-=S}else{A.style.display="none"}}}else{if(p.Height>0){A.style.display="block";U-=S}else{A.style.display="none"}if(c.Height>0){N.style.display="block";U-=Q}else{N.style.display="none"}}U=Math.max(0,U);O.style.display=(U>0)?"block":"none";A.style.height=p.Height+"px";N.style.height=c.Height+"px";O.style.height=U+"px";var T=10;if(A.style.display=="block"){A.style.top="10px";O.style.top=(10+p.Height+10)+"px";T+=p.Height;T+=10}else{O.style.top="10px"}if(O.style.display=="block"){T+=U;T+=10}N.style.top=T+"px";r.style.height=R+"px";i.style.height=R+"px";var W="2px";if(V>2){W=V+"px"}u.style.height=W;I.style.height=W;b.style.height=W;g.style.height=W}function s(Q){Q+=18;if(Q<Panel.MinimumSize.Width){Q=Panel.MinimumSize.Width}p.Width=Q-Panel.MinimumSize.Width;c.Width=Q-Panel.MinimumSize.Width;r.style.width=Q+"px";v.style.width=Q+"px";x.style.width=Q-Panel.MinimumSize.Width+"px";B.style.width=Q+"px";f.style.width=Q-Panel.MinimumSize.Width+"px";u.style.width=Q+"px";g.style.width=Q-Panel.MinimumSize.Width+"px";A.style.width=Q-Panel.MinimumSize.Width+"px";O.style.width=Q-Panel.MinimumSize.Width+"px";N.style.width=Q-Panel.MinimumSize.Width+"px";i.style.width=Q+"px";j.style.width=Q-30+"px";l.style.width=(Q-30)-25-((F==""||F==null)?0:37)}function y(V){if(z){var T=200;var Q=400;var U=((new Date()).getTime()-e)/1000;var R=(T*U)+(0.5*Q*(Math.pow(U,2)));var S=C.GetCurrentSize().Height+R;S=S-(S%1);if(S>=V){z=false;t=false;K(V);O.style.overflow="auto";C.Events.Fire("Maximized",C)}else{K(S);window.setTimeout(function(){y(V)},20)}}}function h(V){if(t){var T=200;var Q=400;var U=((new Date()).getTime()-e)/1000;var R=(T*U)+(0.5*Q*(Math.pow(U,2)));var S=C.GetCurrentSize().Height-R;S=S-(S%1);if(S<=V){z=false;t=false;K(V);O.style.overflow="auto";C.Events.Fire("Minimized",C)}else{K(S);window.setTimeout(function(){h(V)},20)}}}this.Close=function(){C.SetBody("");C.Hide();C.Events.Fire("Closed",C)};this.GetBody=function(){return O.innerHTML};this.GetCurrentSize=function(){return new System.Drawing.Size(parseInt(r.style.width.substring(0,r.style.width.indexOf("px"))),parseInt(r.style.height.substring(0,r.style.height.indexOf("px"))))};this.GetElement=function(){return r};this.GetFooter=function(){return N.innerHTML};this.GetHeader=function(){return A.innerHTML};this.GetIcon=function(){return F};this.GetId=function(){return d};this.GetLocation=function(){return H};this.GetSize=function(){return k};this.GetTitle=function(){return l.innerHTML};this.Hide=function(){r.style.visibility="hidden"};this.IsHeightDynamic=function(){return(k.Height=="auto")};this.IsVisible=function(){return(r.style.visibility=="visible")};this.IsMinimized=function(){return M};this.Maximize=function(Q){if(M){G=window.clearTimeout(G);z=true;t=false;M=false;C.Events.Fire("Maximizing",C);D.onclick=function(){C.Minimize(true);return false};D.src="/Panel/Images/Minimize.gif";D.alt="Minimize";if(Q){var R=k.Height;if(R=="auto"){R=J()}e=(new Date()).getTime();O.style.overflow="hidden";window.setTimeout(function(){y(R)},10)}else{var R=k.Height;if(R=="auto"){R=J()}z=false;K(R);C.Events.Fire("Maximized",C)}}};this.Minimize=function(Q){if(!M){C.Events.Fire("Minimizing",C);D.onclick=function(){C.Maximize(true);return false};D.src="/Panel/Images/Maximize.gif";D.alt="Maximize";G=window.clearTimeout(G);z=false;t=true;M=true;if(Q){e=(new Date()).getTime();O.style.overflow="hidden";window.setTimeout(function(){h(Panel.MinimumSize.Height)},10)}else{t=false;K(Panel.MinimumSize.Height);C.Events.Fire("Minimized",C)}}};this.SetBody=function(Q){O.innerHTML=Q||"";if(k.Height=="auto"){C.SetSize(k)}};this.SetFooter=function(Q){N.innerHTML=Q||"";if(k.Height=="auto"){C.SetSize(k)}};this.SetFooterHeight=function(Q){c.Height=Q||"auto";C.SetSize(k)};this.SetHeader=function(Q){A.innerHTML=Q||"";if(k.Height=="auto"){C.SetSize(k)}};this.SetHeaderHeight=function(Q){p.Height=Q||"auto";C.SetSize(k)};this.SetIcon=function(Q){F=Q;System.Html.HtmlElement.SetBackgroundImage(w,(Q||""));l.style.left=(F==null||F=="")?"5px":"37px"};this.SetLocation=function(Q){H=Q||new System.Drawing.Point(0,0);r.style.top=H.Y-3+"px";r.style.left=H.X-8+"px"};this.SetSize=function(Q){k=Q.Clone()||Panel.DefaultSize;k.Width=k.Width||Panel.DefaultSize.Width;k.Height=k.Height||Panel.DefaultSize.Height;k.Width=k.Width>Panel.MinimumSize.Width?k.Width:Panel.MinimumSize.Width;if(k.Height!="auto"){k.Height=k.Height>Panel.MinimumSize.Height?k.Height:Panel.MinimumSize.Height;k.Height+=16}if(!M&&!z&&!t){var R=k.Height;if(R=="auto"){R=J()}K(R);s(k.Width)}C.Events.Fire("Resized",C)};this.SetTitle=function(Q){l.innerHTML=Q||""};this.Show=function(Q){Q=(Q==null?true:Q);if(!C.IsVisible()){C.Minimize(false);r.style.visibility="visible";C.Maximize(Q)}else{r.style.visibility="visible"}};L()}PanelCollection.PanelSpacing=10;PanelCollection.PanelDropShadowHeight=14;function PanelCollection(){var i=this;var b=new System.Drawing.Point(0,0);var g=Panel.DefaultSize.Clone();this.Panels=new Array();function a(){var j=i.Panels.length;return new System.Drawing.Size(g.Width,g.Height-(Panel.MinimumSize.Height*(j-1)+(j-1)*PanelCollection.PanelSpacing-(j-1)*PanelCollection.PanelDropShadowHeight))}function h(j){i.Remove(j);f()}function d(j){f()}function e(j){for(var k=0;k<i.Panels.length;k++){if(i.Panels[k]!=j){i.Panels[k].Minimize(false)}}f()}function c(j){f()}function f(){var k=b.Clone();var l=a();for(var m=0;m<i.Panels.length;m++){i.Panels[m].SetLocation(k.Clone());i.Panels[m].SetSize(l.Clone());var j=(i.Panels[m].IsMinimized()?i.Panels[m].GetCurrentSize().Height-PanelCollection.PanelDropShadowHeight:l.Height);k.Offset(0,j+PanelCollection.PanelSpacing)}}this.Add=function(j){this.Panels.push(j);j.Hide();j.SetSize(a());j.Events.Add(new System.Event("Minimized",function(k){c(k)}));j.Events.Add(new System.Event("Maximizing",function(k){e(k)}));j.Events.Add(new System.Event("Maximized",function(k){d(k)}));j.Events.Add(new System.Event("Closed",function(k){h(k)}));this.MinimizeAll();j.Show();j.Maximize(true)};this.Contains=function(k){for(var j=0;j<this.Panels.length;j++){if(this.Panels[j].GetId()==k){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){b=j;f()};this.SetSize=function(j){g=j;f()}}function Menu(){var d=this;var b=new System.Drawing.Point(0,0);this.Menus=new Array();this.Events=new System.EventCollection();function e(f){for(var g=0;g<d.Menus.length;g++){if(d.Menus[g]!=f){d.Menus[g].Minimize(false)}}}function a(f){for(var g=0;g<d.Menus.length;g++){if(d.Menus[g]!=f.GetId()&&(d.Menus[g].IsMinimizing()||d.Menus[g].IsMaximizing())){return}}d.Events.Fire("MenuResized")}function c(f){for(var g=0;g<d.Menus.length;g++){if(d.Menus[g]!=f.GetId()&&(d.Menus[g].IsMinimizing()||d.Menus[g].IsMaximizing())){return}}d.Events.Fire("MenuResized")}this.Add=function(f){var h=0;for(var g=0;g<this.Menus.length;g++){h+=this.Menus[g].GetTabWidth()}this.Menus.push(f);f.SetTabOffset(h);f.Minimize();f.Events.Add(new System.Event("Minimized",function(i){a(i)}));f.Events.Add(new System.Event("Maximizing",function(i){e(i)}));f.Events.Add(new System.Event("Maximized",function(i){c(i)}));d.MinimizeAll();f.Maximize()};this.GetHeight=function(){var f=0;for(var g=0;g<this.Menus.length;g++){var h=this.Menus[g].GetCurrentSize().Height;if(h>f){f=h}}return f};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(e){var u=this;var i="";var n=e;var s=null;var z=false;var l=null;var p=null;var y=false;var t=false;var a=0;var h=false;var x=false;var r=null;var q=null;var k=null;var c=null;var m=null;var d=null;var j=null;var f=null;var w=null;this.Events=new System.EventCollection();function b(){return parseInt(k.style.top.substring(0,k.style.top.indexOf("px")))}function g(){k=document.getElementById(n);var A=k.innerHTML;var B='<a class="Logo" href="http://www.freshlogicstudios.com"><img alt="Fresh Logic Studios" src="/Menu/Images/Logo.gif" /></a>';c=document.createElement("div");m=document.createElement("div");d=document.createElement("div");j=document.createElement("div");f=document.createElement("div");w=document.createElement("a");c.className="Content";m.className="Tab";d.className="Left";j.className="Center";f.className="Right";c.style.height=k.offsetHeight+"px";w.innerHTML=k.title;w.href="#";w.onclick=function(){return false};j.appendChild(w);m.appendChild(d);m.appendChild(j);m.appendChild(f);k.innerHTML="";k.oncontextmenu=function(){return false};k.appendChild(c);k.appendChild(m);c.innerHTML=B+A;k.style.top=(-1*c.offsetHeight)+"px";k.style.visibility="visible"}function o(){if(t){var C=100;var A=400;var E=((new Date()).getTime()-p)/1000;var B=(C*E)+(0.5*A*(Math.pow(E,2)));var D=b()+B;D=D-(D%1);if(D>=0){t=false;y=false;k.style.top="0px";u.Events.Fire("Maximized",u)}else{k.style.top=D+"px";window.setTimeout(function(){o()},20)}}}function v(){if(y){var C=100;var A=400;var E=((new Date()).getTime()-p)/1000;var B=(C*E)+(0.5*A*(Math.pow(E,2)));var D=b()-B;D=D-(D%1);if(D<=(-1*u.GetSize().Height)){t=false;y=false;k.style.top=(-1*u.GetSize().Height)+"px";u.Events.Fire("Minimized",u)}else{k.style.top=D+"px";window.setTimeout(function(){v()},20)}}}this.GetElement=function(){return k};this.GetId=function(){return n};this.GetSize=function(){return new System.Drawing.Size(c.offsetWidth,c.offsetHeight)};this.GetCurrentSize=function(){var A=c.offsetHeight+m.offsetHeight;var B=parseInt(k.style.top.substring(0,k.style.top.indexOf("px")));return new System.Drawing.Size(parseInt(k.style.width.substring(0,k.style.width.indexOf("px"))),A+B)};this.GetTabWidth=function(){return m.offsetWidth};this.IsMinimized=function(){return z};this.IsMinimizing=function(){return y};this.IsMaximizing=function(){return t};this.Maximize=function(){if(z){l=window.clearTimeout(l);t=true;y=false;z=false;u.Events.Fire("Maximizing",u);k.style.zIndex="10000";m.onclick=function(){u.Minimize(true);return false};w.style.backgroundImage="url(/Menu/Images/Tab/Minimize.gif)";p=(new Date()).getTime();window.setTimeout(function(){o()},10)}};this.Minimize=function(){if(!z){u.Events.Fire("Minimizing",u);k.style.zIndex="11000";m.onclick=function(){u.Maximize(true);return false};w.style.backgroundImage="url(/Menu/Images/Tab/Maximize.gif)";l=window.clearTimeout(l);t=false;y=true;z=true;p=(new Date()).getTime();window.setTimeout(function(){v()},10)}};this.SetTabOffset=function(A){m.style.right=A+"px"};g()}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(c){for(var b=0;b<a.Items.GetCount();b++){if(a.Items.GetItem(b).Equals(c)){return true}}return false};this.GetUniqueItems=function(c){var b=new Array();for(var d=0;d<c.length;d++){if(!a.ContainsItem(c[d])){b.push(c[d])}}return b}};FreshLogicStudios.Atlas.GeoRss.Channel.FromDom=function(a){var f=new FreshLogicStudios.Atlas.GeoRss.Channel();try{f.Description=a.getElementsByTagName("description").length>0?a.getElementsByTagName("description")[0].firstChild.data:""}catch(b){}try{f.Link=a.getElementsByTagName("link").length>0?a.getElementsByTagName("link")[0].firstChild.data:""}catch(b){}try{f.TimeToLive=a.getElementsByTagName("ttl").length>0?a.getElementsByTagName("ttl")[0].firstChild.data:null}catch(b){}try{f.Title=a.getElementsByTagName("title").length>0?a.getElementsByTagName("title")[0].firstChild.data:""}catch(b){}var c=a.getElementsByTagName("item");for(var d=0;d<c.length;d++){f.Items.Add(FreshLogicStudios.Atlas.GeoRss.Item.FromDom(c[d]))}return f};function GeoRss(){var d=Pushpin.GetNextColor();var g=1;var a=System.Guid.NewGuid();var c=new System.Collections.ArrayList();var b=new VEShapeLayer();var j=100;var h=this;var e=null;this.Channel=new FreshLogicStudios.Atlas.GeoRss.Channel();this.Panel=new Panel(System.Guid.NewGuid());this.UpdateInterval=null;this.Uri="";function f(){h.Panel=new Panel("GeoRssPanel"+a);h.Panel.SetBody("Loading...");h.Panel.SetIcon("/GeoRss/GeoRss.png");h.Panel.SetTitle("GeoRSS");h.Panel.Events.Add(new System.Event("Closed",function(k){h.Clear()}));Sidebar.Add(h.Panel);map.AddShapeLayer(b)}function i(m){if(!h.Panel.IsVisible()){return}if(m.get_statusCode()==200){var o=FreshLogicStudios.Atlas.GeoRss.Channel.FromDom(m.get_xml());h.Channel.Link=o.Link;h.Channel.Description=o.Description;h.Channel.Title=o.Title;if(h.UpdateInterval==null&&o.TimeToLive!=null){h.UpdateInterval=o.TimeToLive*60*1000}var p=h.Channel.GetUniqueItems(o.Items.ToArray());h.Channel.Items.AddRange(p);if(h.Channel.Items.GetCount()>j){h.Channel.Items.RemoveRange(0,h.Channel.Items.GetCount()-j)}var r='<div class="PanelBodyHeader">';r+='<div class="Summary">';r+=System.String.Format('<a href="{0}" target="_blank">{1}</a><br />{2}',h.Channel.Link,h.Channel.Title,h.Channel.Description);r+="</div>";r+="</div>";r+="<ul>";for(var k=p.length-1;k>=0;k--){var q=p[k];if(q.Shape&&q.Shape.GetType()==VEShapeType.Pushpin){var t=q.Description;if(q.Link){t+=System.String.Format('<div><a href="{0}" target="_blank">more...</a></div>',q.Link)}var l=new FreshLogicStudios.Atlas.Item(q.Title,t,t,q.Shape.GetPoints()[0],d,g++);c.Add(l);l.ShowPushpin()}if(q.Shape&&(q.Shape.GetType()==VEShapeType.Polyline||q.Shape.GetType()==VEShapeType.Polygon)){q.Shape.HideIcon();b.AddShape(q.Shape);var t=q.Description;if(q.Link){t+=System.String.Format('<div><a href="{0}" target="_blank">more...</a></div>',q.Link)}var l=new FreshLogicStudios.Atlas.Item(q.Title,t,t,q.Shape.GetIconAnchor(),d,g++);c.Add(l);l.ShowPushpin()}if(c.GetCount()>j){c.GetItem(0).HidePushpin();c.RemoveAt(0)}if(g>=1000){g=1}}if(p.length>0){try{var s=c.GetItem(c.GetCount()-1);s.Center();s.ShowContextMenu()}catch(u){}}if(h.UpdateInterval){for(var k=c.GetCount()-1;k>=0;k--){r+=c.GetItem(k).GetSidebarHtml()}}else{for(var k=0;k<c.GetCount();k++){r+=c.GetItem(k).GetSidebarHtml()}}r+="</ul>";h.Panel.SetBody(r)}else{map.ShowMessage(System.String.Format("An error occured while loading data.  {0}: {1}",m.get_statusCode(),m.get_statusText()))}if(!e){var n=new System.Uri(window.location.href).GetQueryParameters();if(!n.lvl||n.lvl!=map.GetZoomLevel()){FreshLogicStudios.Atlas.Items.ZoomToFit(c)}}if(h.UpdateInterval){e=window.setTimeout(h.Update,h.UpdateInterval)}}this.Clear=function(){if(e){window.clearTimeout(e)}map.DeleteShapeLayer(b);FreshLogicStudios.Atlas.Items.Clear(c);h.Panel.Hide();Sidebar.Remove(h.Panel)};this.GetId=function(){return a};this.Update=function(){var l=new Sys.Net.WebRequest();var k=System.String.Format("/Proxy.ashx?uri={0}",encodeURIComponent(h.Uri));l.set_url(k);l.add_completed(i);l.invoke()};f()}GeoRss.Initialize=function(){var c=new System.Uri(window.location.href);var a=c.GetQueryParameters();var d=null;var b=null;if(a.georss){d=a.georss}if(a.rss){d=System.String.Format("http://ws.geonames.org/rssToGeoRSS?feedUrl={0}",encodeURIComponent(a.rss))}if(a.GeoRssUri){d=a.GeoRssUri}if(a.RssUri){d=System.String.Format("http://ws.geonames.org/rssToGeoRSS?feedUrl={0}",encodeURIComponent(a.RssUri))}if(a.GeoRssUpdateInterval){b=parseInt(a.GeoRssUpdateInterval)*1000}if(d){GeoRss.Populate(d,b)}};GeoRss.Populate=function(c,b){var a=new GeoRss();a.UpdateInterval=b;a.Uri=c;a.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(b){var g=new FreshLogicStudios.Atlas.GeoRss.Item();try{g.Description=b.getElementsByTagName("description").length>0?b.getElementsByTagName("description")[0].firstChild.data:""}catch(d){}try{g.Link=b.getElementsByTagName("link").length>0?b.getElementsByTagName("link")[0].firstChild.data:""}catch(d){}try{g.Title=b.getElementsByTagName("title").length>0?b.getElementsByTagName("title")[0].firstChild.data:""}catch(d){}var a=FreshLogicStudios.Atlas.GeoRss.Item.TryParsePushpin(b);if(a){g.Shape=a;return g}var h=FreshLogicStudios.Atlas.GeoRss.Item.TryParsePolyline(b);if(h){g.Shape=h;return g}var c=FreshLogicStudios.Atlas.GeoRss.Item.TryParsePolygon(b);if(c){g.Shape=c;return g}var f=FreshLogicStudios.Atlas.GeoRss.Item.TryParseBox(b);if(f){g.Shape=f;return g}return g};FreshLogicStudios.Atlas.GeoRss.Item.TryParseBox=function(a){var c=null;var d=new Array();if(d.length==0){try{d=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(a.getElementsByTagName("georss:box")[0].firstChild.data)}catch(f){}}if(d.length==0){try{d=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(a.getElementsByTagName("box")[0].firstChild.data)}catch(f){}}if(d.length==0){try{var b=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(a.getElementsByTagName("gml:Envelope")[0].getElementsByTagName("gml:lowerCorner")[0].firstChild.data);var g=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(a.getElementsByTagName("gml:Envelope")[0].getElementsByTagName("gml:upperCorner")[0].firstChild.data);d.push(b);d.push(g)}catch(f){}}if(d.length==0){try{var b=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(a.getElementsByTagName("Envelope")[0].getElementsByTagName("lowerCorner")[0].firstChild.data);var g=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(a.getElementsByTagName("Envelope")[0].getElementsByTagName("upperCorner")[0].firstChild.data);d.push(b);d.push(g)}catch(f){}}if(d.length&&d.length==2){try{var h=new Array();h.push(d[0]);h.push(new VELatLong(d[0].Latitude,d[1].Longitude));h.push(d[1]);h.push(new VELatLong(d[1].Latitude,d[0].Longitude));c=new VEShape(VEShapeType.Polygon,h)}catch(f){}}return c};FreshLogicStudios.Atlas.GeoRss.Item.TryParsePushpin=function(b){var d=null;var g=null;var c=null;if(g==null||c==null){try{g=b.getElementsByTagName("geo:lat").length>0?b.getElementsByTagName("geo:lat")[0].firstChild.data:null;c=b.getElementsByTagName("geo:long").length>0?b.getElementsByTagName("geo:long")[0].firstChild.data:null}catch(f){}}if(g==null||c==null){try{g=b.getElementsByTagName("lat").length>0?b.getElementsByTagName("lat")[0].firstChild.data:null;c=b.getElementsByTagName("long").length>0?b.getElementsByTagName("long")[0].firstChild.data:null}catch(f){}}if(g==null||c==null){if(b.getElementsByTagName("georss:point").length>0){try{var a=b.getElementsByTagName("georss:point")[0].firstChild.data;g=a.split(" ")[0];c=a.split(" ")[1]}catch(f){}}}if(g==null||c==null){if(b.getElementsByTagName("point").length>0){try{var a=b.getElementsByTagName("point")[0].firstChild.data;g=a.split(" ")[0];c=a.split(" ")[1]}catch(f){}}}if(g==null||c==null){if(b.getElementsByTagName("gml:pos").length>0){try{var a=b.getElementsByTagName("gml:pos")[0].firstChild.data;g=a.split(" ")[0];c=a.split(" ")[1]}catch(f){}}}if(g==null||c==null){if(b.getElementsByTagName("pos").length>0){try{var a=b.getElementsByTagName("pos")[0].firstChild.data;g=a.split(" ")[0];c=a.split(" ")[1]}catch(f){}}}if(g&&c){try{d=new VEShape(VEShapeType.Pushpin,new VELatLong(parseFloat(g),parseFloat(c)))}catch(f){}}return d};FreshLogicStudios.Atlas.GeoRss.Item.TryParsePolygon=function(a){var d=null;var c=new Array();if(c.length==0){try{c=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(a.getElementsByTagName("georss:polygon")[0].firstChild.data)}catch(b){}}if(c.length==0){try{c=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(a.getElementsByTagName("polygon")[0].firstChild.data)}catch(b){}}if(c.length==0){try{c=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(a.getElementsByTagName("gml:Polygon")[0].getElementsByTagName("gml:posList")[0].firstChild.data)}catch(b){}}if(c.length==0){try{c=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(a.getElementsByTagName("Polygon")[0].getElementsByTagName("posList")[0].firstChild.data)}catch(b){}}if(c.length&&c.length>=3){try{d=new VEShape(VEShapeType.Polygon,c)}catch(b){}}return d};FreshLogicStudios.Atlas.GeoRss.Item.TryParsePolyline=function(a){var d=null;var b=new Array();if(b.length==0){try{b=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(a.getElementsByTagName("georss:line")[0].firstChild.data)}catch(c){}}if(b.length==0){try{b=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(a.getElementsByTagName("line")[0].firstChild.data)}catch(c){}}if(b.length==0){try{b=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(a.getElementsByTagName("gml:LineString")[0].getElementsByTagName("gml:posList")[0].firstChild.data)}catch(c){}}if(b.length==0){try{b=FreshLogicStudios.Atlas.GeoRss.Item.ParsePoints(a.getElementsByTagName("LineString")[0].getElementsByTagName("posList")[0].firstChild.data)}catch(c){}}if(b.length&&b.length>=2){try{d=new VEShape(VEShapeType.Polyline,b)}catch(c){}}return d};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};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 b=new System.Uri(window.location.href);var a=b.GetQueryParameters();if(a.YouTube){FreshLogicStudios.Atlas.Feeds.YouTube.Open()}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Feeds.YouTube.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 b=new System.Uri(window.location.href);var a=b.GetQueryParameters();if(a.Weather){FreshLogicStudios.Atlas.Feeds.TheWeatherChannel.Open()}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Feeds.TheWeatherChannel.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 b=new System.Uri(window.location.href);var a=b.GetQueryParameters();if(a.NPR){FreshLogicStudios.Atlas.Feeds.Npr.Open()}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Feeds.Npr.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 b=new System.Uri(window.location.href);var a=b.GetQueryParameters();if(a.Flickr){FreshLogicStudios.Atlas.Feeds.Flickr.Open()}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Feeds.Flickr.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 b=new System.Uri(window.location.href);var a=b.GetQueryParameters();if(a.Election){FreshLogicStudios.Atlas.Feeds.Election.Open()}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Feeds.Election.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 b=new System.Uri(window.location.href);var a=b.GetQueryParameters();if(a.AP){FreshLogicStudios.Atlas.Feeds.AP.Open()}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Feeds.AP.ParseQueryString));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(j){if(j.get_statusCode()==200){var h=j.get_xml().getElementsByTagName("item");var m=new Array();for(var f=0;f<h.length;f++){var q=(f+1);var r=(h[f].getElementsByTagName("description")[0].firstChild)?h[f].getElementsByTagName("description")[0].firstChild.data:"";var l=(h[f].getElementsByTagName("title")[0].firstChild)?h[f].getElementsByTagName("title")[0].firstChild.data:"";var n=null;var k=null;if(n==null||k==null){if(h[f].getElementsByTagName("georss:point").length>0){try{var o=h[f].getElementsByTagName("georss:point")[0].firstChild.data;n=o.split(" ")[0];k=o.split(" ")[1]}catch(g){}}}if(n==null||k==null){if(h[f].getElementsByTagName("point").length>0){try{var o=h[f].getElementsByTagName("point")[0].firstChild.data;n=o.split(" ")[0];k=o.split(" ")[1]}catch(g){}}}var p=new VELatLong(parseFloat(n),parseFloat(k));var s=new FreshLogicStudios.Atlas.Item(l,r,r,p,c.Color,q);c.Items.Add(s);m.push(p)}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 b=new System.Uri(window.location.href);var a=b.GetQueryParameters();if(a.Wikipedia){var c=new FreshLogicStudios.Atlas.Features.Wikipedia();c.Where=a.Wikipedia!="undefined"?a.Wikipedia:"";if(c.Where!=""){c.BeginSearch()}}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Features.Wikipedia.ParseQueryString));RegisterNamespace("FreshLogicStudios.Atlas.Features");FreshLogicStudios.Atlas.Features.WiFi=function(b){FreshLogicStudios.Atlas.Plugin.call(this,b);var d=this;function c(){d.Panel.SetIcon("/Features/WiFi/WiFi.png");d.Panel.SetTitle("WiFi");d.Panel.SetFooterHeight(75);try{pageTracker._trackEvent("WiFi","Open")}catch(f){}}function a(f){var g=new Sys.Net.WebRequest();g.set_url(System.String.Format("/Features/WiFi/WiFi.ashx?zip={0}",f));g.add_completed(e);g.invoke()}function e(k){if(k.get_statusCode()==200){var q=k.get_xml().getElementsByTagName("Hotspot");for(var f=0;f<q.length;f++){if(q[f].getElementsByTagName("Position").length>0){var p=q[f].getElementsByTagName("Name")[0].firstChild.data;var m=q[f].getElementsByTagName("SSID")[0].firstChild.data;var n=q[f].getElementsByTagName("Provider")[0].firstChild.data;var o=q[f].getElementsByTagName("Address1")[0].firstChild.data;var g=q[f].getElementsByTagName("Address2")[0].firstChild.data;var j=new VELatLong(q[f].getElementsByTagName("Latitude")[0].firstChild.data,q[f].getElementsByTagName("Longitude")[0].firstChild.data);var u=System.String.Format("{0}<br />{1}<br />SSID: {2}<br />Provider: {3}",o,g,m,n);var h=new FreshLogicStudios.Atlas.Item(p,u,u,j,d.Color,f+1);d.Items.Add(h)}}var l=k.get_xml().getElementsByTagName("Ad");var s="";for(var f=0;f<l.length;f++){var p=l[f].getElementsByTagName("Title")[0].firstChild.data;var t=l[f].getElementsByTagName("Description")[0].firstChild.data;var r=l[f].getElementsByTagName("Uri")[0].firstChild.data;s+=System.String.Format('<div><a href="{0}" target="_blank">{1}</a></div>',r,p);s+=t}d.Panel.SetFooter(s)}var v='<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}",v,FreshLogicStudios.Atlas.Items.GetSidebarHtml(d.Items)))}this.Search=function(){FreshLogicStudios.Atlas.Web.WebService.GetPostalCode(d.Where.LatLong.Latitude,d.Where.LatLong.Longitude,function(f){a(f)})};c()};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 e(j){if(j.get_statusCode()==200){var h=j.get_xml().getElementsByTagName("item");var m=new Array();for(var f=0;f<h.length;f++){var q=(f+1);var r=(h[f].getElementsByTagName("description")[0].firstChild)?h[f].getElementsByTagName("description")[0].firstChild.data:"";var l=(h[f].getElementsByTagName("title")[0].firstChild)?h[f].getElementsByTagName("title")[0].firstChild.data:"";var n=null;var k=null;if(n==null||k==null){if(h[f].getElementsByTagName("georss:point").length>0){try{var o=h[f].getElementsByTagName("georss:point")[0].firstChild.data;n=o.split(" ")[0];k=o.split(" ")[1]}catch(g){}}}if(n==null||k==null){if(h[f].getElementsByTagName("point").length>0){try{var o=h[f].getElementsByTagName("point")[0].firstChild.data;n=o.split(" ")[0];k=o.split(" ")[1]}catch(g){}}}var p=new VELatLong(parseFloat(n),parseFloat(k));var s=new FreshLogicStudios.Atlas.Item(l,r,r,p,c.Color,q);c.Items.Add(s);m.push(p)}c.EndSearch();c.Panel.SetBody(FreshLogicStudios.Atlas.Items.GetSidebarHtml(c.Items))}else{c.EndSearch()}}function d(h,g,f,i){var j=new Sys.Net.WebRequest();j.set_url(System.String.Format("/Features/Weather/Weather.ashx?north={0}&south={1}&east={2}&west={3}",h,g,f,i));j.add_completed(e);j.invoke()}this.Refresh=function(){c.Panel.SetBody("Loading...");FreshLogicStudios.Atlas.Items.Clear(c.Items);var f=map.GetMapView();d(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 a=c.GetQueryParameters();if(a.Weather){var b=new FreshLogicStudios.Atlas.Features.Weather();b.Where=a.Weather!="undefined"?a.Weather:"";if(b.Where!=""){b.BeginSearch()}}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Features.Weather.ParseQueryString));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(g){if(g.get_statusCode()==200){var j=g.get_xml().getElementsByTagName("item");for(var k=0;k<j.length;k++){var h=FreshLogicStudios.Atlas.GeoRss.Item.FromDom(j[k]);if(h&&h.Shape&&h.Shape.GetPoints().length>0){var l=new FreshLogicStudios.Atlas.Item(h.Title,h.Description,h.Description,h.Shape.GetPoints()[0],c.Color,k+1);c.Items.Add(l)}}var f='<div class="PanelBodyHeader">';f+='<div class="Summary">';f+=(c.Items.GetCount()>0)?System.String.Format("Results {0} - {1}",(c.Index-1)*d+1,(c.Index-1)*d+j.length):"";f+="<br />";f+='Data provided by <a href="http://www.youtube.com/" target="_blank">youtube.com</a>';f+="</div>";f+='<div class="Commands">';f+=(c.Index==1)?"":"<a href=\"javascript:Plugins['"+c.GetId()+"'].Index--; Plugins['"+c.GetId()+"'].Refresh();\">Previous</a>";f+=((c.Index!=1)&&(j.length>=d))?" | ":"";f+=(j.length<d)?"":"<a href=\"javascript:Plugins['"+c.GetId()+"'].Index++; Plugins['"+c.GetId()+"'].Refresh();\">Next</a>";f+="</div>";f+="</div>";c.EndSearch();c.Panel.SetBody(System.String.Format("{0}{1}",f,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...");if(c.What){FreshLogicStudios.Atlas.Advertisements.Keywords.push(c.What)}var f=(c.Index*d)-d+1;var h=new Sys.Net.WebRequest();var g=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);h.set_url(g);h.add_completed(e);h.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 c=new System.Uri(window.location.href);var a=c.GetQueryParameters();if(a.Videos){var b=new FreshLogicStudios.Atlas.Features.Videos();b.What=a.Videos!="undefined"?a.Videos:"";b.RenderPanelHeader();if(b.What!=""){b.BeginSearch()}}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Features.Videos.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(h){if(h.get_statusCode()==200){var k=h.get_xml().getElementsByTagName("Result");for(var e=0;e<k.length;e++){var j=k[e].getElementsByTagName("Title")[0].firstChild.data;var m=k[e].getElementsByTagName("Description")[0].firstChild.data.split(";")[0];var f=new VELatLong(k[e].getElementsByTagName("Latitude")[0].firstChild.data,k[e].getElementsByTagName("Longitude")[0].firstChild.data);var g=new FreshLogicStudios.Atlas.Item(j,m,m,f,c.Color,e+1);c.Items.Add(g)}}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.Photos=function(c,a){FreshLogicStudios.Atlas.Plugin.call(this,a);var f=10;var e=this;this.Index=1;this.What=c||"";function d(){e.Panel.SetIcon("/Features/Photos/Photos.png");e.Panel.SetTitle("Photos");e.RenderPanelHeader();try{pageTracker._trackEvent("Photos","Open")}catch(h){}}function g(m){if(m.get_statusCode()==200){var n=m.get_xml().getElementsByTagName("photo");for(var h=0;h<n.length;h++){var s=(h+1)+((e.Index-1)*10);var v=n[h].getAttribute("id");var w=new Date(parseInt(n[h].getAttribute("dateupload"))*1000);w=new System.DateTime(w.getFullYear(),w.getMonth()+1,w.getDate(),w.getHours(),w.getMinutes(),w.getSeconds(),w.getMilliseconds());var r=n[h].getAttribute("owner");var u=n[h].getAttribute("ownername");var q=n[h].getAttribute("secret");var o=n[h].getAttribute("server");var k=n[h].getAttribute("title");k=k==""?"Untitled":k;var l=new VELatLong(n[h].getAttribute("latitude"),n[h].getAttribute("longitude"));var p=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>',r,v,k,o,q);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>',w.ToString("g"),r,u);var t=new FreshLogicStudios.Atlas.Item(k,j,p,l,e.Color,s);e.Items.Add(t)}var x='<div class="PanelBodyHeader">';x+='<div class="Summary">';x+=(e.Items.GetCount()>0)?System.String.Format("Results {0} - {1}",(e.Index-1)*f+1,(e.Index-1)*f+n.length):"";x+="<br />";x+='Data provided by <a href="http://www.flickr.com/" target="_blank">flickr.com</a>';x+="</div>";x+='<div class="Commands">';x+=(e.Index==1)?"":"<a href=\"javascript:Plugins['"+e.GetId()+"'].Index--; Plugins['"+e.GetId()+"'].Refresh();\">Previous</a>";x+=((e.Index!=1)&&(n.length>=f))?" | ":"";x+=(n.length<f)?"":"<a href=\"javascript:Plugins['"+e.GetId()+"'].Index++; Plugins['"+e.GetId()+"'].Refresh();\">Next</a>";x+="</div>";x+="</div>";e.EndSearch();e.Panel.SetBody(System.String.Format("{0}{1}",x,FreshLogicStudios.Atlas.Items.GetSidebarHtml(e.Items)))}else{e.EndSearch()}}function b(l,i,n,o,k,m){var h=new Sys.Net.WebRequest();var j=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}",l,parseInt(new Date().getTime()/1000),Math.min(n,k),Math.min(i,o),Math.max(n,k),Math.max(i,o),m);h.set_url(System.String.Format("/Proxy.ashx?uri={0}",encodeURIComponent(j)));h.add_completed(g);h.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;">',e.GetId());h+="<label>What: Tag or keyword (optional)</label>";h+=System.String.Format('<input name="What" type="text" value="{0}" /><br />',e.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 />',e.GetId(),System.Configuration.Settings.Defaults.DefaultWhere);h+='<button class="Button" type="submit" name="submit" value="Search">Search</button>';h+="</form>";h+="</div>";e.Panel.SetHeader(h);e.Panel.SetHeaderHeight(100)};this.Refresh=function(){e.Clear();e.Panel.SetBody("Loading...");if(e.What){FreshLogicStudios.Atlas.Advertisements.Keywords.push(e.What)}var h=map.GetMapView();b(e.What,h.TopLeftLatLong.Latitude,h.TopLeftLatLong.Longitude,h.BottomRightLatLong.Latitude,h.BottomRightLatLong.Longitude,e.Index)};this.Search=function(){e.Index=1;if(e.Where.Name!=System.Configuration.Settings.Defaults.DefaultWhere){map.Find(null,e.Where.Name,null,null,null,null,false,false,false,true,e.Refresh)}else{e.Refresh()}};d()};FreshLogicStudios.Atlas.Features.Photos.ParseQueryString=function(){var e=new System.Uri(window.location.href);var a=e.GetQueryParameters();var c=a.photos||a.Photos;if(c){var c=c!="undefined"?c:"";var b=a.where||a.Where;var d=new FreshLogicStudios.Atlas.Features.Photos(c,b);if(c||b){d.BeginSearch()}}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Features.Photos.ParseQueryString));RegisterNamespace("FreshLogicStudios.Atlas.Features");FreshLogicStudios.Atlas.Features.People=function(b){FreshLogicStudios.Atlas.Plugin.call(this,b);var e=20;var d=this;this.Index=1;this.Who="";function c(){d.Panel.SetIcon("/Features/People/People.png");d.Panel.SetTitle("People");d.RenderPanelHeader();try{pageTracker._trackEvent("People","Open")}catch(g){}}function f(k){if(k.get_statusCode()==200){var o=k.get_xml().getElementsByTagName("Place");for(var g=0;g<o.length;g++){var l=(g+1)+((d.Index-1)*10);var p=(o[g].getElementsByTagName("Address")[0].firstChild)?o[g].getElementsByTagName("Address")[0].firstChild.data:"";var n=(o[g].getElementsByTagName("Name")[0].firstChild)?o[g].getElementsByTagName("Name")[0].firstChild.data:"";var m=(o[g].getElementsByTagName("Phone")[0].firstChild)?o[g].getElementsByTagName("Phone")[0].firstChild.data:"";var j=new VELatLong(o[g].getElementsByTagName("Latitude")[0].firstChild.data,o[g].getElementsByTagName("Longitude")[0].firstChild.data);var r=System.String.Format("{0}<br />{1}",p,m);var h=new FreshLogicStudios.Atlas.Item(n,r,r,j,d.Color,l);d.Items.Add(h)}var q='<div class="PanelBodyHeader">';q+='<div class="Summary">';q+=(d.Items.GetCount()>0)?System.String.Format("Results {0} - {1}",(d.Index-1)*e+1,(d.Index-1)*e+o.length):"";q+="</div>";q+='<div class="Commands">';q+=(d.Index==1)?"":"<a href=\"javascript:Plugins['"+d.GetId()+"'].Index--; Plugins['"+d.GetId()+"'].Refresh();\">Previous</a>";q+=((d.Index!=1)&&(o.length>=e))?" | ":"";q+=(o.length<e)?"":"<a href=\"javascript:Plugins['"+d.GetId()+"'].Index++; Plugins['"+d.GetId()+"'].Refresh();\">Next</a>";q+="</div>";q+="</div>";d.EndSearch();d.Panel.SetBody(System.String.Format("{0}{1}",q,FreshLogicStudios.Atlas.Items.GetSidebarHtml(d.Items)))}else{d.EndSearch()}}function a(h,g,j,i,k,l){var m=new Sys.Net.WebRequest();m.set_url(System.String.Format("/Features/People/People.ashx?who={0}&latitude1={1}&longitude1={2}&latitude2={3}&longitude2={4}&index={5}",h,g,j,i,k,l));m.add_completed(f);m.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;">',d.GetId());g+="<label>Who: Name or phone number</label>";g+=System.String.Format('<input name="Who" type="text" value="{0}" /><br />',d.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>";d.Panel.SetHeader(g);d.Panel.SetHeaderHeight(100)};this.Refresh=function(){d.Panel.SetBody("Loading...");FreshLogicStudios.Atlas.Items.Clear(d.Items);var g=map.GetMapView();a(d.Who,g.TopLeftLatLong.Latitude,g.TopLeftLatLong.Longitude,g.BottomRightLatLong.Latitude,g.BottomRightLatLong.Longitude,d.Index)};this.Search=function(){d.Index=1;if(d.Where.Name!=System.Configuration.Settings.Defaults.DefaultWhere){map.Find(null,d.Where.Name,null,null,null,null,false,false,false,true,d.Refresh)}else{d.Refresh()}};c()};RegisterNamespace("FreshLogicStudios.Atlas.Features");FreshLogicStudios.Atlas.Features.Packages=function(){FreshLogicStudios.Atlas.Plugin.call(this);var d=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 a(j){if(j.get_statusCode()==200){var h=j.get_xml().getElementsByTagName("item");var m=new Array();for(var f=0;f<h.length;f++){var q=(f+1);var r=(h[f].getElementsByTagName("description")[0].firstChild)?h[f].getElementsByTagName("description")[0].firstChild.data:"";var l=(h[f].getElementsByTagName("title")[0].firstChild)?h[f].getElementsByTagName("title")[0].firstChild.data:"";var n=null;var k=null;if(n==null||k==null){if(h[f].getElementsByTagName("georss:point").length>0){try{var o=h[f].getElementsByTagName("georss:point")[0].firstChild.data;n=o.split(" ")[0];k=o.split(" ")[1]}catch(g){}}}if(n==null||k==null){if(h[f].getElementsByTagName("point").length>0){try{var o=h[f].getElementsByTagName("point")[0].firstChild.data;n=o.split(" ")[0];k=o.split(" ")[1]}catch(g){}}}var p=new VELatLong(parseFloat(n),parseFloat(k));var s=new FreshLogicStudios.Atlas.Item(l,r,r,p,c.Color,q);c.Items.Add(s);m.push(p)}if(m.length>=2){d=new VEShape(VEShapeType.Polyline,m);d.HideIcon();map.AddShape(d)}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(d!=null){map.DeleteShape(d);d=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(a);e.invoke()};b()};FreshLogicStudios.Atlas.Features.Packages.ParseQueryString=function(){var d=new System.Uri(window.location.href);var a=d.GetQueryParameters();var b=a.packages||a.Packages;if(b){var c=new FreshLogicStudios.Atlas.Features.Packages();c.What=b!="undefined"?b:"";c.RenderPanelHeader();if(c.What!=""){c.BeginSearch()}}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Features.Packages.ParseQueryString));RegisterNamespace("FreshLogicStudios.Atlas.Features");FreshLogicStudios.Atlas.Features.Movies=function(b){FreshLogicStudios.Atlas.Plugin.call(this,b);var d=this;function c(){d.Panel.SetIcon("/Features/Movies/Movies.png");d.Panel.SetTitle("Movies");try{pageTracker._trackEvent("Movies","Open")}catch(f){}}function a(f){var g=new Sys.Net.WebRequest();g.set_url(System.String.Format("/Features/Movies/Movies.ashx?zip={0}",f));g.add_completed(e);g.invoke()}function e(z){if(z.get_statusCode()==200){var f=z.get_xml().getElementsByTagName("Theatre");for(var r=0;r<f.length;r++){if(f[r].getElementsByTagName("Position").length>0){var w=f[r].getElementsByTagName("Name")[0].firstChild.data;var o=f[r].getElementsByTagName("Address1")[0].firstChild.data;var h=f[r].getElementsByTagName("Address2")[0].firstChild?f[r].getElementsByTagName("Address2")[0].firstChild.data:"";var l=f[r].getElementsByTagName("Phone")[0].firstChild.data;var u=f[r].getElementsByTagName("Uri")[0].firstChild.data;var A=new VELatLong(f[r].getElementsByTagName("Latitude")[0].firstChild.data,f[r].getElementsByTagName("Longitude")[0].firstChild.data);var y=System.String.Format("<div>{0}</div><div>{1}</div><div>{2}</div>",o,h,l);y+='<div style="position:relative;">';y+=System.String.Format('<a href="{0}" style="color:#6A6967;" target="_blank" title="View theatre details">details&nbsp;&raquo;</a><br />',u);var B=f[r].getElementsByTagName("Movie");var v="";if(B.length<=0){v+='<span style="color:#6A6967;">no showtimes available</span><br />'}else{v+='<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 />';v+='<img src="/Features/Movies/Showtimes.gif" class="ShowtimesDetailsImage" style="display:none;" alt="" />';v+='<ul class="MoviesByTheatreList" style="display:none;">';for(var s=0;s<B.length;s++){var q=B[s].getElementsByTagName("Name")[0].firstChild.data;var x=(B[s].getElementsByTagName("Rating")[0].firstChild)?B[s].getElementsByTagName("Rating")[0].firstChild.data:"";var C=(B[s].getElementsByTagName("Length")[0].firstChild)?B[s].getElementsByTagName("Length")[0].firstChild.data:"";v+="<li>";v+=System.String.Format('<div><a href="{0}" target="_blank">{1}</a></div>',B[s].getElementsByTagName("Uri")[0].firstChild.data,q);v+=System.String.Format('<div class="MovieDetails"><span class="MovieRating">{0}</span><span class="MovieLength">{1}</span></div>',x,C);v+='<ul class="ShowtimesList">';var p=B[s].getElementsByTagName("Showtime");if(p.length>0){v+=System.String.Format("<li>{0}</li>",p[0].firstChild.data)}else{v+="<li>no showtimes</li>"}for(var t=1;t<p.length;t++){v+=System.String.Format("<li> - {0}</li>",p[t].firstChild.data)}v+="</ul>";v+="</li>"}v+="</ul>"}var m=y+v+"</div></div>";var n=y+"</div></div>";var g=new FreshLogicStudios.Atlas.Item(w,m,n,A,d.Color,r+1);d.Items.Add(g)}}}d.EndSearch()}this.Search=function(){FreshLogicStudios.Atlas.Web.WebService.GetPostalCode(d.Where.LatLong.Latitude,d.Where.LatLong.Longitude,function(f){a(f)})};c()};RegisterNamespace("FreshLogicStudios.Atlas.Features");FreshLogicStudios.Atlas.Features.GasPrices=function(b){FreshLogicStudios.Atlas.Plugin.call(this,b);var d=this;function c(){d.Panel.SetIcon("/Features/GasPrices/GasPrices.png");d.Panel.SetTitle("Gas Prices");try{pageTracker._trackEvent("Gas Prices","Open")}catch(f){}}function a(f){var g=new Sys.Net.WebRequest();g.set_url(System.String.Format("/Features/GasPrices/GasPrices.ashx?zip={0}",f));g.add_completed(e);g.invoke()}function e(l){if(l.get_statusCode()==200){var p=l.get_xml().getElementsByTagName("GasStation");for(var q=0;q<p.length;q++){var o=p[q].getElementsByTagName("Name")[0].firstChild.data;var n=p[q].getElementsByTagName("Address1")[0].firstChild.data;var f=p[q].getElementsByTagName("Address2")[0].firstChild.data;var m=p[q].getElementsByTagName("Price");var k=new VELatLong(p[q].getElementsByTagName("Latitude")[0].firstChild.data,p[q].getElementsByTagName("Longitude")[0].firstChild.data);var r=System.String.Format('<div class="Logo"><img src="http://gadgets.freshlogicstudios.com/GasPrices/Images/GasStationLogo.ashx?name={0}" /></div>',o);r+=System.String.Format("{0}<br />{1}<br /><br />",n,f);for(var g=0;g<m.length;g++){r+=(m[g].getAttribute("type")+": "+m[g].getElementsByTagName("Amount")[0].firstChild.data+(g!=(m.length-1)?"<br />":""))}var h=new FreshLogicStudios.Atlas.Item(o,r,r,k,d.Color,q+1);d.Items.Add(h)}}d.EndSearch()}this.Search=function(){FreshLogicStudios.Atlas.Web.WebService.GetPostalCode(d.Where.LatLong.Latitude,d.Where.LatLong.Longitude,function(f){a(f)})};c()};RegisterNamespace("FreshLogicStudios.Atlas.Features");FreshLogicStudios.Atlas.Features.Xkcd=function(){FreshLogicStudios.Atlas.Plugin.call(this);var c=null;var b=this;function a(){b.Panel.SetIcon("/Features/Experiments/Xkcd/Xkcd.png");b.Panel.SetTitle("XKCD Geohashing");b.RenderPanelHeader();b.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(j){if(j.get_statusCode()==200){var h=j.get_xml().getElementsByTagName("item");var n=new Array();for(var f=0;f<h.length;f++){var r=(f+1);var s=(h[f].getElementsByTagName("description")[0].firstChild)?h[f].getElementsByTagName("description")[0].firstChild.data:"";var m=(h[f].getElementsByTagName("title")[0].firstChild)?h[f].getElementsByTagName("title")[0].firstChild.data:"";var o=null;var k=null;if(o==null||k==null){if(h[f].getElementsByTagName("georss:point").length>0){try{var p=h[f].getElementsByTagName("georss:point")[0].firstChild.data;o=p.split(" ")[0];k=p.split(" ")[1]}catch(g){}}}if(o==null||k==null){if(h[f].getElementsByTagName("point").length>0){try{var p=h[f].getElementsByTagName("point")[0].firstChild.data;o=p.split(" ")[0];k=p.split(" ")[1]}catch(g){}}}var q=new VELatLong(parseFloat(o),parseFloat(k));var t=new FreshLogicStudios.Atlas.Item(m,s,s,q,b.Color,r);b.Items.Add(t);n.push(q)}b.EndSearch();b.Panel.SetBody(System.String.Format("{0}",FreshLogicStudios.Atlas.Items.GetSidebarHtml(b.Items)));var l=new Array();l.push(new VELatLong(Math.floor(b.Where.LatLong.Latitude),Math.floor(b.Where.LatLong.Longitude)));l.push(new VELatLong(Math.floor(b.Where.LatLong.Latitude)+1,Math.floor(b.Where.LatLong.Longitude)));l.push(new VELatLong(Math.floor(b.Where.LatLong.Latitude)+1,Math.floor(b.Where.LatLong.Longitude)+1));l.push(new VELatLong(Math.floor(b.Where.LatLong.Latitude),Math.floor(b.Where.LatLong.Longitude)+1));c=new VEShape(VEShapeType.Polygon,l);c.HideIcon();map.AddShape(c);map.SetMapView(l)}else{b.EndSearch()}}this.Clear=function(){b.HidePushpins();b.Items.Clear();if(c!=null){map.DeleteShape(c);c=null}};this.Search=function(){b.Clear();b.Panel.SetBody("Loading...");var e=new Sys.Net.WebRequest();e.set_url(System.String.Format("/Features/Experiments/Xkcd/Xkcd.ashx?Latitude={0}&Longitude={1}",b.Where.LatLong.Latitude,b.Where.LatLong.Longitude));e.add_completed(d);e.invoke()};a()};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.Events=function(b){FreshLogicStudios.Atlas.Plugin.call(this,b);var d=this;function c(){d.Panel.SetIcon("/Features/Events/Events.png");d.Panel.SetTitle("Events");try{pageTracker._trackEvent("Events","Open")}catch(f){}}function a(f){var g=f.split(" ")[0];var h=f.split(" ")[1];return new Date(g.split("-")[0],g.split("-")[1]-1,g.split("-")[2],h.split(":")[0],h.split(":")[1],h.split(":")[2],0)}function e(j){if(j.get_statusCode()==200){var n=j.get_xml().getElementsByTagName("event");for(var f=0;f<n.length;f++){if(n[f].getElementsByTagName("latitude")[0].firstChild&&n[f].getElementsByTagName("longitude")[0].firstChild){var h=n[f].getAttribute("id");var l="http://www.eventful.com/events/"+h;var m=n[f].getElementsByTagName("title")[0].firstChild.data;var p=(n[f].getElementsByTagName("venue_address")[0].firstChild?n[f].getElementsByTagName("venue_address")[0].firstChild.data+", ":"")+(n[f].getElementsByTagName("city_name")[0].firstChild?n[f].getElementsByTagName("city_name")[0].firstChild.data+", ":"")+(n[f].getElementsByTagName("region_name")[0].firstChild?n[f].getElementsByTagName("region_name")[0].firstChild.data:"")+" "+(n[f].getElementsByTagName("postal_code")[0].firstChild?n[f].getElementsByTagName("postal_code")[0].firstChild.data:"");var k=a(n[f].getElementsByTagName("start_time")[0].firstChild.data);k=new System.DateTime(k.getFullYear(),k.getMonth()+1,k.getDate(),k.getHours(),k.getMinutes(),k.getSeconds(),k.getMilliseconds());var o=new VELatLong(n[f].getElementsByTagName("latitude")[0].firstChild.data,n[f].getElementsByTagName("longitude")[0].firstChild.data);var r=System.String.Format("{0}<br /><br />{1}<br /><br />",k.ToString("g"),p);r+=System.String.Format('<a href="{0}" style="color:#6A6967;" target="_blank">event&nbsp;&raquo;</a><br />',l);var g=new FreshLogicStudios.Atlas.Item(m,r,r,o,d.Color,f+1);d.Items.Add(g)}}}var q='<div class="PanelBodyHeader"><div class="Summary">Data provided by <a href="http://eventful.com/" target="_blank">eventful.com</a></div></div>';d.EndSearch();d.Panel.SetBody(System.String.Format("{0}{1}",q,FreshLogicStudios.Atlas.Items.GetSidebarHtml(d.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(d.Where.LatLong.Latitude+", "+d.Where.LatLong.Longitude));g.set_url(System.String.Format("/Proxy.ashx?uri={0}",encodeURIComponent(f)));g.add_completed(e);g.invoke()};c()};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(h){if(h.get_statusCode()==200){var p=h.get_xml().getElementsByTagName("blog");for(var e=0;e<p.length;e++){var k=p[e].getAttribute("name");var l=(p[e].getElementsByTagName("city")[0].firstChild)?p[e].getElementsByTagName("city")[0].firstChild.data:"";var j=(p[e].getElementsByTagName("div")[0].firstChild)?p[e].getElementsByTagName("div")[0].firstChild.data:"";var m=l+(l=="")?j:", "+j;var g=new VELatLong(p[e].getElementsByTagName("latitude")[0].firstChild.data,p[e].getElementsByTagName("longitude")[0].firstChild.data);var o=m+"<br />";o+=System.String.Format('<a href="{0}" style="color:#6A6967;" target="_blank">blog&nbsp;&raquo;</a>',p[e].getAttribute("url"));o+="<br />";o+=System.String.Format('<a href="{0}" style="color:#6A6967;" target="_blank">feed&nbsp;&raquo;</a>',p[e].getAttribute("xmlurl"));o+="<br />";var f=new FreshLogicStudios.Atlas.Item(k,o,o,g,c.Color,e+1);c.Items.Add(f)}}var n='<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}",n,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.Experimental.Twitter");FreshLogicStudios.Atlas.Experimental.Twitter=function(d,i){FreshLogicStudios.Atlas.Plugin.call(this,i);var b=Pushpin.GetNextColor();var f=1;var j=100;var h=this;var e=null;var c=null;this.Channel=new FreshLogicStudios.Atlas.GeoRss.Channel();this.What=d||"";function g(){if(h.Where===System.Configuration.Settings.Defaults.DefaultWhere){h.Where=""}h.Panel.SetIcon("/Experimental/Twitter/Twitter.png");h.Panel.SetTitle("Twitter");h.RenderPanelHeader();var m=new System.Uri(window.location.href);var k=m.GetQueryParameters();if(!k.lvl){map.SetZoomLevel(6)}h.BeginSearch();try{pageTracker._trackEvent("Twitter","Open")}catch(l){}}function a(p){var o=FreshLogicStudios.Atlas.GeoRss.Channel.FromDom(p);var l=h.Channel.GetUniqueItems(o.Items.ToArray());h.Channel.Items.AddRange(l);if(h.Channel.Items.GetCount()>j){h.Channel.Items.RemoveRange(0,h.Channel.Items.GetCount()-j)}for(var k=l.length-1;k>=0;k--){if(l[k].Shape){var n=new FreshLogicStudios.Atlas.Item(l[k].Title,l[k].Description,l[k].Description,l[k].Shape.GetPoints()[0],b,f++);h.Items.Add(n);n.ShowPushpin()}}while(h.Items.GetCount()>j){h.Items.GetItem(0).HidePushpin();h.Items.RemoveAt(0)}if(f>=j){f=1}if(l.length>0){try{var r=h.Items.GetItem(h.Items.GetCount()-1);r.Center();r.ShowContextMenu()}catch(q){}}var m="<ul>";for(var k=h.Items.GetCount()-1;k>=0;k--){m+=h.Items.GetItem(k).GetSidebarHtml()}m+="</ul>";h.Panel.SetBody(m)}this.Clear=function(){if(c){try{c.abort()}catch(k){}}if(e){window.clearTimeout(e)}f=1;h.HidePushpins();h.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;\">",h.GetId());k+=System.String.Format('<label for="what_{0}"><strong>What:</strong> Tag or keyword (optional)</label>',h.GetId());k+=System.String.Format('<input class="what" id="what_{0}" type="text" value="{1}" /><br />',h.GetId(),h.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 />',h.GetId(),h.Where);k+='<button class="Button" type="submit">Search</button>';k+="</form>";k+="</div>";h.Panel.SetHeader(k);h.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_"+h.GetId()).combobox({arrowURL:"/Images/combobox.png",autoShow:false,data:l})})};this.Search=function(){h.Update()};this.Update=function(){var k="/georss/feeds/twitter.ashx?";if(h.What){FreshLogicStudios.Atlas.Advertisements.Keywords.push(h.What);k+=System.String.Format("q={0}&",encodeURIComponent(h.What))}if(h.Where&&h.Where.Name&&h.Where.Name!=System.Configuration.Settings.Defaults.DefaultWhere){k+=System.String.Format("latitude={0}&longitude={1}&radius=25mi",h.Where.LatLong.Latitude,h.Where.LatLong.Longitude)}c=$.ajax({cache:false,complete:function(){e=window.setTimeout(h.Update,5000)},success:function(m,l){a(m)},url:k})};g()};FreshLogicStudios.Atlas.Experimental.Twitter.ParseQueryString=function(){var e=new System.Uri(window.location.href);var a=e.GetQueryParameters();var c=a.twitter||a.Twitter;if(c){var c=c!="undefined"?c:"";var b=a.where||a.Where;var d=new FreshLogicStudios.Atlas.Experimental.Twitter(c,b)}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Experimental.Twitter.ParseQueryString));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(h){if(h.get_statusCode()==200){var m=h.get_xml().getElementsByTagName("event");for(var e=0;e<m.length;e++){if(m[e].getElementsByTagName("latitude")[0].firstChild&&m[e].getElementsByTagName("longitude")[0].firstChild){var g=m[e].getAttribute("id");var k="http://www.eventful.com/events/"+g;var l=m[e].getElementsByTagName("title")[0].firstChild.data;var o=(m[e].getElementsByTagName("venue_address")[0].firstChild?m[e].getElementsByTagName("venue_address")[0].firstChild.data+", ":"")+(m[e].getElementsByTagName("city_name")[0].firstChild?m[e].getElementsByTagName("city_name")[0].firstChild.data+", ":"")+(m[e].getElementsByTagName("region_name")[0].firstChild?m[e].getElementsByTagName("region_name")[0].firstChild.data:"")+" "+(m[e].getElementsByTagName("postal_code")[0].firstChild?m[e].getElementsByTagName("postal_code")[0].firstChild.data:"");var j=ParseDate(m[e].getElementsByTagName("start_time")[0].firstChild.data);j=new System.DateTime(j.getFullYear(),j.getMonth()+1,j.getDate(),j.getHours(),j.getMinutes(),j.getSeconds(),j.getMilliseconds());var n=new VELatLong(m[e].getElementsByTagName("latitude")[0].firstChild.data,m[e].getElementsByTagName("longitude")[0].firstChild.data);var q=System.String.Format("{0}<br /><br />{1}<br /><br />",j.ToString("g"),o);q+=System.String.Format('<a href="{0}" style="color:#6A6967;" target="_blank">event&nbsp;&raquo;</a><br />',k);var f=new FreshLogicStudios.Atlas.Item(l,q,q,n,c.Color,e+1);c.Items.Add(f)}}}var p='<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}",p,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()};ContextMenu.PanelOffset=new System.Drawing.Size(27,20);function ContextMenu(b,h,a,d,i){var l=this;var e=i;var k=new Panel(b);this.Events=new System.EventCollection();function g(){k.SetTitle(h);k.SetIcon(a);k.GetElement().style.zIndex="80";k.Events.Add(new System.Event("Closed",function(p){m(p)}));l.SetBody(d);l.SetLocation(e);var o=k.GetElement();var n=document.createElement("div");n.className="Arrow";o.appendChild(n);map.AttachEvent("onchangeview",f)}function j(){var o="new VELatLong("+e.Latitude+", "+e.Longitude+")";var n="";if(e&&e.Latitude&&e.Longitude){if(l.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(l.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)}l.SetFooter(n)}function c(){try{var n=map.LatLongToPixel(e);return new System.Drawing.Point(n.x,n.y)}catch(o){return new System.Drawing.Point(0,0)}}function f(){if(k.IsVisible()){if(e&&e.Latitude&&e.Longitude){l.SetLocation(e)}else{k.Hide()}}}function m(n){l.Events.Fire("Closed",l)}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 e};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);j()};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){e=n||new VELatLong(0,0);var o=c();o.Offset(ContextMenu.PanelOffset.Width,-1*ContextMenu.PanelOffset.Height);k.SetLocation(o);j()};this.SetSize=function(n){k.SetSize(n)};this.SetTitle=function(n){k.SetTitle(n)};this.Show=function(p){var t=new System.Drawing.Size(0,0);var q=GetWindowWidth();var o=GetWindowHeight();if(p){var s=c();var n=l.GetSize();if(s.X<0){t.Width=s.X-25}if(s.Y-ContextMenu.PanelOffset.Height<MainMenu.GetHeight()){t.Height=s.Y-ContextMenu.PanelOffset.Height-MainMenu.GetHeight()-25}if(s.X+n.Width>q){t.Width=(s.X+n.Width+25)-q}if(s.Y+n.Height>o){t.Height=(s.Y+n.Height)-o}}if(t.Width!=0||t.Height!=0){map.SetAnimationEnabled(false);var r=new VEPixel(Math.floor(q/2)+t.Width,Math.floor(o/2)+t.Height);map.SetCenter(map.PixelToLatLong(r));map.SetAnimationEnabled(true)}l.SetLocation(e);k.Show(false);FreshLogicStudios.Atlas.Advertisements.Update()};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)}}}function Compass(){}Compass.Panning=false;Compass.MaxScrollSpeed=15;Compass.Initialize=function(){map.AttachEvent("onchangeview",Compass.OnMapChangeView);map.AttachEvent("onchangemapstyle",Compass.OnMapChangeStyle)};Compass.MouseDown=function(a){var b=document.getElementById("AtlasCompass");if(b.setCapture){b.setCapture()}Compass.Panning=true;Compass.Pan(a)};Compass.MouseMove=function(a){if(Compass.Panning){Compass.Pan(a)}};Compass.MouseUp=function(a){var b=document.getElementById("AtlasCompass");if(b.releaseCapture){b.releaseCapture()}Compass.Panning=false;map.EndContinuousPan()};Compass.OnMapChangeView=function(a){Compass.SetOrientation()};Compass.OnMapChangeStyle=function(a){Compass.SetOrientation()};Compass.Pan=function(d){if(!d){d=window.event}var a=document.getElementById("AtlasCompass");var f=document.getElementPosition(a);var g=document.getEventLocation(d);var c=g.X-f.X-(a.offsetWidth/2);var b=g.Y-f.Y-(a.offsetHeight/2);c=Math.min(Math.max(c,-Compass.MaxScrollSpeed),Compass.MaxScrollSpeed);b=Math.min(Math.max(b,-Compass.MaxScrollSpeed),Compass.MaxScrollSpeed);map.StartContinuousPan(c,b)};Compass.SetOrientation=function(){var b=document.getElementById("AtlasCompass");var a="url(/Basic/Toolbox/Images/CompassNorth.gif)";if(map.GetMapStyle()==VEMapStyle.Birdseye||map.GetMapStyle()==VEMapStyle.BirdseyeHybrid){a=System.String.Format("url(/Basic/Toolbox/Images/Compass{0}.gif)",map.GetBirdseyeScene().GetOrientation())}if(b.style.backgroundImage!=a){b.style.backgroundImage=a}};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);RegisterNamespace("FreshLogicStudios.Atlas.Features");FreshLogicStudios.Atlas.Features.Search=function(c,b){FreshLogicStudios.Atlas.Plugin.call(this,b);var d=new System.Collections.ArrayList();var f=20;var e=this;this.Index=1;this.What=c||"";function g(){e.Panel.SetIcon("/Basic/Search/Search.png");e.Panel.SetTitle("Search");e.RenderPanelHeader();try{pageTracker._trackEvent("Search","Open")}catch(h){}}function a(p,l,s,q){e.Panel.SetTitle(e.What);if(l==null){e.Panel.SetBody(System.String.Format("No results found. Try <a href=\"javascript:map.ZoomOut(); Plugins['{0}'].Refresh();\">zooming out</a>.",e.GetId()));return}for(var h=0;h<l.length;h++){var o=(h+1)+((e.Index-1)*f);var n=l[h].Name;var k=l[h].LatLong.Clone();DecodeLatLong(k);var r=System.String.Format("{0}<br />{1}",l[h].Description,l[h].Phone);var j=new FreshLogicStudios.Atlas.Item(n,r,r,k,e.Color,o);e.Items.Add(j);if(d.GetCount()<o){d.Add(l[h])}}var m='<div class="PanelBodyHeader">';m+='<div class="Summary">';m+=(e.Items.GetCount()>0)?System.String.Format("Results {0} - {1}",(e.Index-1)*f+1,(e.Index-1)*f+l.length):"";m+="</div>";m+='<div class="Commands">';m+=(e.Index==1)?"":"<a href=\"javascript:Plugins['"+e.GetId()+"'].Index--; Plugins['"+e.GetId()+"'].Refresh();\">Previous</a>";m+=((e.Index!=1)&&(l.length>=f))?" | ":"";m+=(l.length<f)?"":"<a href=\"javascript:Plugins['"+e.GetId()+"'].Index++; Plugins['"+e.GetId()+"'].Refresh();\">Next</a>";m+="</div>";m+="</div>";e.EndSearch();e.Panel.SetBody(System.String.Format("{0}{1}",m,FreshLogicStudios.Atlas.Items.GetSidebarHtml(e.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;">',e.GetId());h+="<label>What: Business name or category</label>";h+=System.String.Format('<input name="What" type="text" value="{0}" /><br />',e.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 />',e.GetId(),System.Configuration.Settings.Defaults.DefaultWhere);h+='<button class="Button" type="submit" name="submit" value="Search">Search</button>';h+="</form>";h+="</div>";e.Panel.SetHeader(h);e.Panel.SetHeaderHeight(100)};this.Refresh=function(){e.Panel.SetBody("Loading...");FreshLogicStudios.Atlas.Items.Clear(e.Items);e.Index=parseInt(e.Index);if(e.What==""){e.Items.Add(new FreshLogicStudios.Atlas.Item("",e.Where.Name,e.Where.Name,e.Where.LatLong,e.Color,""));e.EndSearch()}else{FreshLogicStudios.Atlas.Advertisements.Keywords.push(e.What);if(d.GetCount()>=e.Index*f){var h=d.GetRange((e.Index-1)*f,Math.min(f,d.GetCount()-((e.Index-1)*f)));a(null,h.ToArray(),null,false)}else{var j=(e.What=="*")?"pinpoint_highres":e.What;var i=(e.Where.Name==System.Configuration.Settings.Defaults.DefaultWhere)?null:e.Where.Name;map.Find(j,i,VEFindType.Businesses,null,e.Index,f,false,false,false,false,a)}}};this.Search=function(){e.Index=1;d.Clear();if(e.Where.Name!=System.Configuration.Settings.Defaults.DefaultWhere){map.Find(null,e.Where.Name,null,null,null,null,false,false,false,true,e.Refresh)}else{e.Refresh()}};g()};FreshLogicStudios.Atlas.Features.Search.ParseQueryString=function(){var f=new System.Uri(window.location.href);var a=f.GetQueryParameters();if(a.ss){var b=a.ss.split("~");var d=a.where1||System.Configuration.Settings.Defaults.DefaultWhere;for(var e=0;e<b.length;e++){var c=new FreshLogicStudios.Atlas.Features.Search(b[e],d);if(e==0){c.BeginSearch()}}}else{if(a.where1){new FreshLogicStudios.Atlas.Features.Search(null,a.where1).BeginSearch()}}};Events.Add(new System.Event("MapLoaded",FreshLogicStudios.Atlas.Features.Search.ParseQueryString));function Help(){}Help.Open=function(){window.open("http://www.freshlogicstudios.com/Products/Atlas/Help.aspx");try{pageTracker._trackEvent("Help","Open")}catch(a){}};function Email(){}Email.Send=function(){var d=new System.Uri(window.location.href);var f="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 c="mailto:?subject="+f+"&body="+IOSec.EncodeUrl(a);document.location.href=c;try{pageTracker._trackEvent("Email","Send")}catch(b){}};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 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 e=new System.Uri(window.location.href);var b=(Directions.Route.StartLocation.Address==""?"Start":Directions.Route.StartLocation.Address);var d=(Directions.Route.EndLocation.Address==""?"End":Directions.Route.EndLocation.Address);var f=System.String.Format("Directions from {0} to {1}",b,d);var a=System.String.Format("Atlas - powered by Fresh Logic Studios\n\n{0}://{1}/{2}",e.GetScheme(),e.GetAuthority(),Directions.GetQueryString());var c=System.String.Format("mailto:?subject={0}&body={1}",f,a);document.location.href=encodeURI(c)};Directions.FindStartLocationCallback=function(c,a,d,b){Directions.OnFindLocationComplete(d,"DirectionsStart")};Directions.FindEndLocationCallback=function(c,a,d,b){Directions.OnFindLocationComplete(d,"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 f=new System.Uri(window.location.href);var d=f.GetQueryParameters();if(d.rtp){Directions.ShowPanel();var h=d.rtp.split("~");if(h[0]){if(h[0].search("\\badr.")==0){Directions.SetStart(h[0].replace("adr.",""))}else{if(h[0].search("\\bpos.")==0){var g=h[0].replace("pos.","").split("_");Directions.SetStart("Start",new VELatLong(g[0],g[1]))}}}if(h[1]){if(h[1].search("\\badr.")==0){Directions.SetEnd(h[1].replace("adr.",""))}else{if(h[1].search("\\bpos.")==0){var e=h[1].replace("pos.","").split("_");Directions.SetEnd("End",new VELatLong(e[0],e[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(h){Directions.Route=h.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 a=0;a<Directions.Route.Itinerary.Items.length;a++){Directions.Route.Itinerary.Items[a].Step=a+1}var c=new System.TimeSpan(0,0,0,Directions.Route.Time);var m=System.String.Format("{0}{1} ",c.GetDays()>0?c.GetDays()+" day":"",c.GetDays()>1?"s":"");m+=System.String.Format("{0}{1} ",c.GetHours()>0?c.GetHours()+" hour":"",c.GetHours()>1?"s":"");m+=System.String.Format("{0}{1} ",c.GetMinutes()>0?c.GetMinutes()+" minute":"",c.GetMinutes()>1?"s":"");var f='<div class="PanelBodyHeader">';f+='<div class="Summary">';f+='Distance:<span id="DirectionsTotalDistance">'+Directions.Route.Distance.toFixed(1)+" mi</span><br />";f+='Time:<span id="DirectionsEstimatedTime">'+m+"</span>";f+="</div>";f+='<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>';f+="</div>";f+='<ul id="DirectionsInstructions">';for(var a=0;a<Directions.Route.Itinerary.Items.length;a++){var e=Directions.Route.Itinerary.Items[a];var b=System.Guid.NewGuid();var g=System.String.Format("/Pushpin/Image.ashx?Color={0}&Text={1}","Blue",e.Step);var j="";var l="";if(e.Step==1){e.Instruction="Depart from "+(Directions.Route.StartLocation.Address==""?"Start":Directions.Route.StartLocation.Address);g="/Basic/Directions/Images/Start.png";j="Start";l="<div>"+e.Text+"</div>"}else{if(e.Step==Directions.Route.Itinerary.Items.length){e.Instruction="Arrive at "+(Directions.Route.EndLocation.Address==""?"End":Directions.Route.EndLocation.Address);g="/Basic/Directions/Images/End.png";j="End";l="<div>"+e.Text+"</div>"}else{var d=e.Distance?'<div class="InstructionDistance">'+e.Distance.toFixed(1)+'<br /><span class="InstructionUnit">mi</span></div>':"";j="Step "+e.Step+" of "+Directions.Route.Itinerary.Items.length;l='<div class="Instruction">'+e.Text+"</div>"+d}}f+='<li class="PanelItem">';f+=System.String.Format('<a href="javascript:Pushpin.ShowContextMenu(\'{1}\'); Pushpin.Center(\'{1}\');"><img class="PanelPushpin" src="{0}" /></a>',g,b);f+='<div class="PanelItemDetail">';f+=System.String.Format("<a class=\"DetailTitle\" href=\"javascript:Pushpin.ShowContextMenu('{0}'); Pushpin.Center('{0}');\">{1}</a>",b,j);f+=System.String.Format('<div class="DetailContent">{0}</div>',l);f+="</div>";f+="</li>";map.DeleteShape(e.Shape);var k=new VEPushpin(b,new VELatLong(e.LatLong.Latitude,e.LatLong.Longitude),g,j,l,"AtlasPushpin");map.AddAtlasPushpin(k);Directions.Pushpins.push(k)}f+="</ul>";Directions.Panel.SetBody(f)};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(c,b){Directions.ClearRoute();if(c){document.getElementById("DirectionsEnd").value=c}if(b){Directions.EndPosition=b.Clone();var a=new VEPushpin(System.Guid.NewGuid(),Directions.EndPosition,"/Basic/Directions/Images/End.png","End","Arrive at End","");map.AddAtlasPushpin(a);Directions.Pushpins.push(a)}else{Directions.EndPosition=undefined}if(Directions.StartPosition!=undefined){var a=new VEPushpin(System.Guid.NewGuid(),Directions.StartPosition,"/Basic/Directions/Images/Start.png","Start","Depart from Start","");map.AddAtlasPushpin(a);Directions.Pushpins.push(a)}};Directions.SetStart=function(c,b){Directions.ClearRoute();if(c){document.getElementById("DirectionsStart").value=c}if(b){Directions.StartPosition=b.Clone();var a=new VEPushpin(System.Guid.NewGuid(),Directions.StartPosition,"/Basic/Directions/Images/Start.png","Start","Depart from Start","");map.AddAtlasPushpin(a);Directions.Pushpins.push(a)}else{Directions.StartPosition=undefined}if(Directions.EndPosition!=undefined){var a=new VEPushpin(System.Guid.NewGuid(),Directions.EndPosition,"/Basic/Directions/Images/End.png","End","Arrive at End","");map.AddAtlasPushpin(a);Directions.Pushpins.push(a)}};Directions.ShowPanel=function(){if(Sidebar.Contains("_Directions")){Directions.Panel.Maximize(true)}else{map.ShowTraffic();Sidebar.Add(Directions.Panel)}};Directions.UpdateAddressFromAmbiguousPanel=function(a,c,b){if(a=="DirectionsStart"){Directions.SetStart(c,b)}else{Directions.SetEnd(c,b)}Directions.GetDirectionsWorker()};Events.Add(new System.Event("MapLoaded",Directions.Initialize));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(c){if(c.length==1){Details.Address=c[0].Address;Details.Search(new VELatLong(c[0].Position.Latitude,c[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 b=0;b<c.length;b++){a+='<li><a href="#" onclick="document.DetailsForm.Where.value = \''+c[b].Address.replace(/\'/g,"\\'")+"'; Details.Search(new VELatLong("+c[b].Position.Latitude+","+c[b].Position.Longitude+')); return false;">'+c[b].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 d=b.get_xml().getElementsByTagName("item");if(d.length>0){var c=(d[0].getElementsByTagName("description")[0].firstChild)?d[0].getElementsByTagName("description")[0].firstChild.data:"";var a=(d[0].getElementsByTagName("title")[0].firstChild)?d[0].getElementsByTagName("title")[0].firstChild.data:"";Details.Panel.SetBody(System.String.Format("<p><strong>{1}</strong><br />{2}</p>{0}",Details.Panel.GetBody(),a,c))}}};Details.Populate=function(a){var b=Details.Address;Details.Clear();Details.Position=a;if(Details.Position!=undefined){Details.Panel.SetBody("Loading...");if(!b){FreshLogicStudios.Atlas.Web.WebService.ReverseGeocode(Details.Position.Latitude,Details.Position.Longitude,Details.OnReverseGeocodeComplete)}else{Details.OnReverseGeocodeComplete(b)}}};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)}};