var L_invalidinvoketarget_text="Invalid invoke target specified.",L_invaliddirections_text="Invalid argument passed; both start and end must be present.",L_invalidpageindex_text="Invalid search results page index is passed.",L_invalidelement_text="Invalid element id; unable to find the element in the document body.",L_noheadelement_text="Head element is missing for the current document; cannot initialize the API framework.",L_noserviceurl_text="Either a service url or script url is required to create VENetwork instance.",L_noscripturl_text="Invalid script source url is assigned; cannot download the assigned script.",L_nostylesurl_text="Invalid style source url is assigned; cannot attach the assigned styles.",L_invalidwhatwhere_text="Invalid what/where parameters; either 'what' or 'where' must be present.",L_notinitialized_text="Map is not loaded; cannot perform this operation.",L_noroute_text="Cannot calculate route at this point; try again later.",L_invalidpushpin_text="Invalid pushpin instance.",L_invalidpushpinid_text="Invalid pushpin id; either id is empty or another pushpin already exists with that id.",L_invalidpolylineid_text="Invalid polyline id; either id is empty or another polyline already exists with that id.",L_invalidpolygonid_text="Invalid polygon id; either id is empty or another polygon already exists with that id.",L_invalidargument_text="Invalid argument; input argument '%1' is not a valid '%2' value.",L_invalidlayerid_text="Invalid layer id; either id is empty or another layer already exists with that id.",L_invalidlayertype_text="Invalid layer type.",L_invalidlayersource_text="Invalid layer source; either layer is empty or does not exist.",L_invalidsourceid_text="Invalid source id; either id is empty or another tile source already exists with that id.",L_invalidminmaxzoom_text="Min zoom is greater than max zoom.",L_invalidopacity_text="Invalid opacity value.",L_loadxml_text="Unable to load source file.",L_Help_Text="Help",L_ErrorServerBusy_Text="The server is temporarily unavailable. Try again later.",L_UnsupportMethod_Text="%1method is not supported.",L_UnsupportClass_Text="%1class is not supported.",L_error_text="Error",L_close_text="close",L_what_text="What",L_where_text="Where",L_find_text="Find",L_selectlocation_text="Select a location",L_Start_Text="Start",L_End_Text="End",L_DirectionsGetDirections_Text="Get directions",L_loading_text=".. Loading ..",L_arriveat_text="Arrive at",L_startat_text="Start at",L_step_text="Step %1 of %2",L_DirectionsStep_Text="Step",L_invalidroute_Text="Unable to find a route for the locations you entered. Ensure that your start and end locations are correct, and try again.",L_invalidlocation_Text="The location you entered cannot be found.",L_CollectionManagerViewerDefaultTitle_Text="Shared Collection",L_CollectionManagerUnsavedCollectionTitle_Text="Unsaved Collection",L_AnnotationConfDefaultTitle_Text="Untitled item",L_TrafficPopupSeverity_Text="Severity",L_TrafficPopupLocation_Text="Location",L_TrafficPopupDescription_Text="Description",L_TrafficPopupStartTime_Text="Start time",L_TrafficPopupEstEndTime_Text="Est. end time",L_TrafficManagerSerious_Text="Serious",L_TrafficManagerModerate_Text="Moderate",L_TrafficManagerMinor_Text="Minor",L_TrafficManager_Zoomout_Text="Zoom out to view Traffic information",L_TrafficManager_Zoomin_Text="Zoom in to view Traffic information",L_ClientTokenInvalid_Text="Invalid client token.",L_ClientTokenExpired_Text="Expired client token.",L_Shp_IncorrectPoints_Text="The number of points does not match the specified VEShape type.",L_Shp_IncorrectLineWidth_Text="The line width must be a positive integer.",L_Shp_IncorrectZoomLevel_Text="The specified  zoom level is invalid.  The valid range is 1 to 21,inclusive.",L_Shp_IncorrectZoomLevel2_Text="Max zoom is less than min zoom.",L_shp_Notinitialized_text="Shape is not initialized.",L_ShpExist_text="This shape has already been added to layer.",L_invalidzindex_text="Invalid z-Index parameters; either 'icon' or 'polyshape' must be present.",L_altitudemodemismatch_Text="All altitudes must have the same altitudeMode in a VEShape.",L_invalidwhere_text="Invalid argument; input argument 'where' is not a valid 'string, VELatLong, VELatLongRectangle, or VEPlace ' value.",L_invalidnonnegativeint_text="Invalid argument; input argument '%1' must be a non-negative int value.",L_invalidbetweenint_text="Invalid argument; input argument '%1' must be between %2 and %3, inclusive.",L_invalidsearchlocation_Text="%1 could not find a match for the location. Please check your spelling, enter the complete address including country name and commas, and try again.",L_ClusterDefaultTitle_Text="%1 locations near here",L_ClusterDefaultDescription_Text="Zoom in for details.",L_InvalidClusterLayer_Text="Cannot apply clustering to a cluster layer.",L_DashboardBirdsEye_Text="Bird's eye",L_DashboardBirdsEyeText_Text="See this location in bird's eye view",L_Dashboard3DText_Text="See this location in Bing Maps 3D",L_Dashboard3DInstalled_Text="Bing Maps 3D has finished updating",L_ObliqueCompassSelectDirection_Text="Change the direction of the view",L_ObliqueModeImageNotAvailable_Text="Sorry, bird's eye images aren't available here.",L_MinimapHybrid_Text="H",L_MinimapRoad_Text="R",L_MinimapHideToolTip_Text="Hide the mini map",L_MinimapShowToolTip_Text="Show the mini map",L_MinimapLargerToolTip_Text="Larger mini map",L_MinimapSmallerToolTip_Text="Smaller mini map",L_MinimapRoadToolTip_Text="Switch to road view",L_MinimapHybridToolTip_Text="Switch to hybrid view",L_MinimapDragToolTip_Text="Drag to move the map",L_MinimapReticuleDragToolTip_Text="Drag to center map",L_ScaleBarMiles_Text="miles",L_ScaleBarKilometers_Text="km",L_ScaleBarMeters_Text="m",L_ScaleBarYards_Text="yds",L_NavActionFlatland_Text="2D",L_NavActionView3D_Text="3D",L_NavActionRoad_Text="Road",L_NavActionAerial_Text="Aerial",L_NavActionHybrid_Text="Hybrid",L_NavActionLabels_Text="Labels",L_NavActionTraffic_Text="Traffic",L_NavActionHideToolTip_Text="Hide the view control",L_NavActionShowToolTip_Text="Show the view control",L_NavActionFlatlandToolTip_Text="View map in 2D mode",L_NavActionView3DToolTip_Text="View map in 3D mode with Bing Maps 3D (Beta)",L_NavActionOrthoToolTip_Text="Switch to map view",L_NavActionObliqueToolTip_Text="Switch to bird's eye view",L_NavActionStreetSideToolTip_Text="Street-level view",L_NavAction3DOrthoToolTip_Text="Look down",L_NavAction3DObliqueToolTip_Text="Look down at an angle",L_NavAction3DStreetSideToolTip_Text="Look toward horizon",L_NavActionShowTrafficToolTip_Text="Show traffic on the map",L_NavActionHideTrafficToolTip_Text="Hide traffic on the map",L_NavActionRoadToolTip_Text="Switch to road view",L_NavActionAerialToolTip_Text="Switch to aerial view",L_NavActionHybridToolTip_Text="Switch to hybrid view",L_NavActionObliqueRotationToolTip_CW_Text="Rotate the camera angle counterclockwise",L_NavActionObliqueRotationToolTip_CCW_Text="Rotate the camera angle clockwise",L_NavActionShowObliqueToolTip_Text="Show bird's eye images on the map",L_NavActionHideObliqueToolTip_Text="Hide bird's eye images on the map",L_NavActionShowLabels_Text="Show labels",L_NavActionHideLabels_Text="Hide labels",L_North_Text="north",L_East_Text="east",L_South_Text="south",L_West_Text="west",L_ObliqueSkippingOneDirection_Text="A bird's eye image facing %2 isn't available for this location. Facing %1 instead.",L_ObliqueSkippingTwoDirections_Text="Bird's eye images facing %2 or %3 aren't available for this location. Facing %1 instead.",L_ObliqueSpinNoOtherImagery_Text="No other bird's eye images are available for this location. Continuing to face %1.",L_ObliqueNoImageryInRequestedDirection_Text="Bird's eye images facing %2 aren't available for this location. Continuing to face %1.",L_NavActionCompassPan_Text="Pan in any direction",L_ZoomBarMinusToolTip_Text="Zoom out. To zoom continuously, click and hold this button.",L_ZoomBarPlusToolTip_Text="Zoom in. To zoom continuously, click and hold this button.",L_ZoomBarSliderToolTip_Text="Move slider to zoom in or zoom out",L_BrowserNotSupported_Text="To use this feature, open Live Search in Windows Internet Explorer version 6 or 7. For more information, and to download the latest version, visit the Microsoft Internet Explorer website (%1%3%2).",L_BrowserNotSupported3D_Text="Bing Maps 3D is currently not supported for your browser. For a list of supported browsers, see Help.",L_NoHardwareAcceleration_Text="Bing Maps 3D has detected that hardware acceleration is turned off.",L_3DLoading_Text="Initializing Bing Maps 3D (Beta).",L_UnableToDisplay3DVIAModel_Text="Unable to display 3D models in collections at this time. Please try again later.",L_InstallVE3DVIATitle_Text="Virtual Earth - 3DVIA (Beta) installation",L_LaunchVE3DVIA_Text="Launching Virtual Earth - 3DVIA (Beta)",L_PluginFeatureNotAvailable_Text="Feature is currently not available. Please try again later.",L_MapLegendTrafficSlow_Text="Slow",L_MapLegendTrafficFast_Text="Fast",L_GeoRssInvalidFormatError_Text="The GeoRSS file you have tried to import is improperly formatted.",L_MapCopyrightMicrosoft="&copy; 2010 Microsoft Corporation",L_MapCopyrightTraffic="Traffic.com",L_MapControlPlatformName_Text="Virtual Earth",L_SupportedBrowserDownloadUrl_Text="http://www.microsoft.com/windows/ie/downloads/default.mspx";_VERegisterNamespaces("MapControl");MapControl.Features={PlatformName:L_MapControlPlatformName_Text,Image:{PoweredLogo:"logo_powered_by_map.png"},MapStyle:{Road:true,Shaded:true,Aerial:true,Hybrid:true,BirdsEye:false,View3D:false},BirdsEyeAtZoomLevel:10,ScaleBarKilometers:true,Traffic:{Flow:{Slow:"0-25 mph",Moderate:"25-45 mph",Fast:"45+ mph"},Enabled:true},Minimap:{ShowByDefault:false}};function _VERegisterNamespaces(){for(var d=0;d<arguments.length;d++){var b=arguments[d].split("."),c=window;for(var a=0;a<b.length;a++){if(!c[b[a]])c[b[a]]={};c=c[b[a]]}}}_VERegisterNamespaces("Msn.MVC");Msn.MVC.AbstractView=function(){this._contextPin=null};Msn.MVC.AbstractView.prototype.OnBeforeSwitchAway=function(){};Msn.MVC.AbstractView.prototype.ShowShimIfSupported=function(){};Msn.MVC.AbstractView.prototype.UpdateShimIfSupported=function(){};_VERegisterNamespaces("Msn.MVC");Msn.MVC.FlatlandView=function(){this._superObj=Msn.MVC.FlatlandView.prototype;this._mapDrawingView=null};Msn.MVC.FlatlandView.prototype=new Msn.MVC.AbstractView;Msn.MVC.FlatlandView.prototype.OnBeforeSwitchAway=function(){if(window.__drawingLoaded){this._ClearAllCollectionLayers();VE_MapDispatch.Clear()}};_VERegisterNamespaces("Msn.MVC");Msn.MVC.View3D=function(){this._superObj=Msn.MVC.View3D.prototype;this._hackUniqueLayerId="UniqueLayer_Hack";this._entityIdShapePostfix="_Shape";this._spacecontrol=null};Msn.MVC.View3D.prototype=new Msn.MVC.AbstractView;Msn.MVC.View3D.prototype.OnBeforeSwitchAway=function(){this._SetView3DControl(null)};Msn.MVC.View3D.prototype._SetView3DControl=function(a){this._spacecontrol=a};Msn.MVC.View3D.prototype.ShowShimIfSupported=function(b,a){ShowShim(b,a)};Msn.MVC.View3D.prototype.UpdateShimIfSupported=function(b,a){UpdateIFrameShim(b,a)};_VERegisterNamespaces("Msn.MVC");Msn.MVC.ViewFacade=function(){this._mvcFlatlandView=null;this._mvcView3D=null;this._curMvcView=null};Msn.MVC.ViewFacade.prototype.OnSwitchToFlatlandView=function(){if(this._mvcFlatlandView==null)this._mvcFlatlandView=new Msn.MVC.FlatlandView;if(this._curMvcView==this._mvcFlatlandView)return;if(this._curMvcView!=null)this._curMvcView.OnBeforeSwitchAway();this._curMvcView=this._mvcFlatlandView;if(window.__drawingLoaded)this._curMvcView.OnAllCollectionLayersRepaint()};Msn.MVC.ViewFacade.prototype.OnSwitchToView3D=function(a){if(this._mvcView3D==null)this._mvcView3D=new Msn.MVC.View3D;this._mvcView3D._SetView3DControl(a);if(this._curMvcView==this._mvcView3D)return;if(this._curMvcView!=null)this._curMvcView.OnBeforeSwitchAway();this._curMvcView=this._mvcView3D;if(window.__drawingLoaded)this._curMvcView.OnAllCollectionLayersRepaint()};Msn.MVC.ViewFacade.prototype.ShowShimIfSupported=function(b,a){if(this._curMvcView==null)return;return this._curMvcView.ShowShimIfSupported(b,a)};Msn.MVC.ViewFacade.prototype.UpdateShimIfSupported=function(b,a){if(this._curMvcView==null)return;return this._curMvcView.UpdateShimIfSupported(b,a)};var mvcViewFacade=new Msn.MVC.ViewFacade,windowWidth=0,windowHeight=0,scrollbarWidth=null;function $ID(a){var b=document;return b.getElementById(a)}function $CE(a){var b=document;return b.createElement(a)}function $CENS(a){var b=document;return b.createElementNS(a)}function GetWindowWidth(){var a=0;if(typeof window.innerWidth=="number")a=window.innerWidth;else if(document.documentElement&&document.documentElement.clientWidth)a=document.documentElement.clientWidth;else if(document.body&&document.body.clientWidth)a=document.body.clientWidth;if(!a||a<100)a=100;return a}function GetWindowHeight(){var a=0;if(typeof window.innerHeight=="number")a=window.innerHeight;else if(document.documentElement&&document.documentElement.clientHeight)a=document.documentElement.clientHeight;else if(document.body&&document.body.clientHeight)a=document.body.clientHeight;if(!a||a<100)a=100;return a}function GetScrollbarWidth(){if(scrollbarWidth)return scrollbarWidth;if(navigator.userAgent.indexOf("IE")>=0){var a=document.createElement("div"),b=null;a.style.visible="hidden";a.style.overflowY="scroll";a.style.position="absolute";a.style.width=0;document.body.insertAdjacentElement("afterBegin",a);b=a.offsetWidth;a.parentNode.removeChild(a);if(!b)b=16;scrollbarWidth=b;return b}else return 0}function GetUrlPrefix(){var a=window.location.pathname.lastIndexOf("/"),b=window.location.protocol+"//"+window.location.hostname+window.location.pathname.substring(0,a+1);return b}function GetUrlParameterString(){var a=window.location.search;if(a.length==0||a.indexOf("?")==-1)return "";return a.substr(a.indexOf("?")+1)}function CheckWipExistence(){var a=GetUrlParameterString();if(a!=""&&a.indexOf("wip=")>-1)return true;return false}function GetUrlParameters(){var b=[],d=GetUrlParameterString();if(!d)return b;var e=d.split("&");for(var c=0;c<e.length;c++){var a=e[c].split("=");if(a.length==2&&a[0]&&a[1]){b.push(unescape(a[0]));b.push(unescape(a[1]))}}return b}function ParseShiftKeyForLinks(a){if(a.shiftKey)return false;return true}function GetEvent(a){return a?a:window.event}function CancelEvent(a){a.cancelBubble=true;a.returnValue=false}function IgnoreEvent(a){a=GetEvent(a);CancelEvent(a);return false}function GetMouseScrollDelta(a){if(a.wheelDelta)return a.wheelDelta;else if(a.detail)return -a.detail;return 0}function IsLeftMouseButton(a){var b=Msn.VE.Environment.BrowserInfo;if(b.Type==Msn.VE.BrowserType.MSIE)return a.button==1||a.button==3||a.type=="click";else if(b.Type==Msn.VE.BrowserType.Firefox)return a.which==1;else return false}function IsRightMouseButton(a){var b=Msn.VE.Environment.BrowserInfo;if(b.Type==Msn.VE.BrowserType.MSIE)return a.button==2||a.button==3||a.type=="contextmenu";else if(b.Type==Msn.VE.BrowserType.Firefox)return a.which==3;else return false}function IsMiddleMouseButton(b){var a=Msn.VE.Environment.BrowserInfo;if(a.Type==Msn.VE.BrowserType.MSIE)return b.button==4;else if(a.Type==Msn.VE.BrowserType.Firefox)return b.which==2;else return false}_VERegisterNamespaces("Msn.VE");Msn.VE.DistanceUnit={Kilometers:"km",Miles:"mi"};Msn.VE.DistanceUnit.IsValidType=function(a){if(typeof a=="string")if(a==Msn.VE.DistanceUnit.Miles||a==Msn.VE.DistanceUnit.Kilometers)return true;return false};function VEException(b,c,a){this.source=b;this.name=c;this.message=a}VEException.prototype.Name=this.name;VEException.prototype.Source=this.source;VEException.prototype.Message=this.message;function MathFloor(a){return Math.floor(a)}function MathCeil(a){return Math.ceil(a)}function MathMax(a,b){return Math.max(a,b)}function MathMin(a,b){return Math.min(a,b)}function MathAbs(a){return Math.abs(a)}function MathRound(a){return Math.round(a)}function DegToRad(a){return a*Math.PI/180}function RadToDeg(a){return a*180/Math.PI}function MatrixMultiply(e,b){if(!e||!b||e[0].length!=b.length)return;var g=e.length,h=b[0].length,d=new Array(g),i=b.length;for(var a=0;a<g;a++){d[a]=new Array(h);for(var c=0;c<h;c++){d[a][c]=0;for(var f=0;f<i;f++)d[a][c]+=e[a][f]*b[f][c]}}return d}function VEParameter(b,a){this.Name=b;this.Value=a}VEParameter.prototype.Name=this.name;VEParameter.prototype.Value=this.value;function VENetwork(c,a,b){if(c!=null&&c!="undefined")this.ServiceUrl=c;this.UseCloseDep=false;if(a!=null&&a!="undefined")Msn.VE.API.Globals.veonbegininvokeevent=a;if(b!=null&&b!="undefined")Msn.VE.API.Globals.veonendinvokeevent=b}function BeginInvoke(f,d,h,g,j){if(this.ServiceUrl==null||this.ServiceUrl=="undefined"||this.ServiceUrl.length==0)throw new VEException("VENetwork:BeginInvoke","err_noserviceurl",L_noserviceurl_text);if(Msn.VE.API&&Msn.VE.API.Globals.veonbegininvokeevent)Msn.VE.API.Globals.veonbegininvokeevent();var c=j;if(!c)c=VENetwork.GetExecutionID();if(d){var b=this.ServiceUrl+"?";for(var e=0;e<d.length;e++){b=b+d[e].Name;b=b+"=";b=b+d[e].Value;b=b+"&"}}else var b=this.ServiceUrl;var a=document.createElement("script");a.type="text/javascript";a.language="javascript";a.id=c;a.src=b;if(this.UseCloseDep==true){var i=openDependency("BEGIN_INVOKE::"+c,function(){EndInvoke(g,h,f,a,c)},c);if(i)VENetwork.GetAttachTarget().appendChild(a)}else{if(navigator.userAgent.indexOf("IE")>=0)a.onreadystatechange=function(){if(a&&("loaded"==a.readyState||"complete"==a.readyState)){a.onreadystatechange=null;EndInvoke(g,h,f,a,c)}};else a.onload=function(){a.onload=null;EndInvoke(g,h,f,a,c)};VENetwork.GetAttachTarget().appendChild(a)}}function EndInvoke(endInvokeTarget,fnCallback,endInvokeMethod,elScript,executionId){var objects=null;if(endInvokeMethod)eval("if(typeof "+endInvokeMethod+" == 'function') {objects = "+endInvokeMethod+"();}");setTimeout(function(){if(elScript.parentNode)elScript.parentNode.removeChild(elScript);elScript=null},100);if(fnCallback!=null&&fnCallback!="undefined")fnCallback(objects,endInvokeTarget);if(Msn.VE.API&&Msn.VE.API.Globals.veonendinvokeevent)Msn.VE.API.Globals.veonendinvokeevent()}VENetwork.GetExecutionID=function(){var a=new Date,b=Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds());b+=Math.round(Math.random()*1000000);return b};function GetXmlHttp(){var a=null;if(window.XMLHttpRequest)a=new XMLHttpRequest;else if(window.ActiveXObject)try{a=new ActiveXObject("Msxml2.XmlHttp.6.0")}catch(b){try{a=new ActiveXObject("Msxml2.XmlHttp.3.0")}catch(c){try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(d){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}}}else throw"XMLHTTP Required: Browser not supported";return a}VENetwork.AttachStyleSheetCallback=function(a){if(a)a()};VENetwork.AttachStyleSheet=function(a,b,d,c){if(a==null||a=="undefined"||a.length==0)throw new VEException("VENetwork:AttachStylesheet","err_nostylesurl","");elStyle=document.createElement("link");if(d==true)elStyle.rel="alternate stylesheet";else elStyle.rel="stylesheet";if(c)elStyle.media=c;elStyle.type="text/css";elStyle.rev="stylesheet";elStyle.id=VENetwork.GetExecutionID();elStyle.href=a;VENetwork.GetAttachTarget().appendChild(elStyle);if(navigator.userAgent.indexOf("IE")>=0)elStyle.onreadystatechange=function(){if(elStyle&&("loaded"==elStyle.readyState||"complete"==elStyle.readyState)){elStyle.onreadystatechange=null;VENetwork.AttachStyleSheetCallback(b)}};else VENetwork.AttachStyleSheetCallback(b);return};VENetwork.DownloadScriptCallback=function(a,b){if(a)a(b)};VENetwork.DownloadScript=function(b,c,d){if(b==null||b=="undefined"||b.length==0)throw new VEException("VENetwork:DownloadScript","err_noscripturl",L_noscripturl_text);var a=document.createElement("script");a.type="text/javascript";a.language="javascript";a.id=VENetwork.GetExecutionID();a.src=b;if(navigator.userAgent.indexOf("IE")>=0)a.onreadystatechange=function(){if(a&&("loaded"==a.readyState||"complete"==a.readyState)){a.onreadystatechange=null;VENetwork.DownloadScriptCallback(c,d)}};else a.onload=function(){a.onload=null;VENetwork.DownloadScriptCallback(c,d)};VENetwork.GetAttachTarget().appendChild(a);return a.id};VENetwork.DownloadXml=function(e,c,b,d){var a=GetXmlHttp();a.open(c,e,true);a.onreadystatechange=function(){if(a.readyState==4){if(b)b(a.responseXML,d);a=null}};a.send(null)};VENetwork.GetAttachTarget=function(){if(document.getElementsByTagName("head")[0]!=null)return document.getElementsByTagName("head")[0];else throw new VEException("VENetwork:cstr","err_noheadelement",L_noheadelement_text)};VENetwork.prototype.BeginInvoke=BeginInvoke;VENetwork.prototype.EndInvoke=EndInvoke;function JSONConstant(){}JSONConstant.culture="culture";JSONConstant.format="format";JSONConstant.json="json";JSONConstant.requestid="rid";function JSONRequestInvoke(f,a,e){var c=new VENetwork,b=VENetwork.GetExecutionID();c.UseCloseDep=true;c.ServiceUrl=f;if(!a)a=[];var d=Msn.VE.API?Msn.VE.API.Globals.locale:window.serviceLocale;a.push(new VEParameter(JSONConstant.culture,'"'+d+'"'));a.push(new VEParameter(JSONConstant.format,JSONConstant.json));a.push(new VEParameter(JSONConstant.requestid,b));c.BeginInvoke("_f"+b,a,e,null,b)}_VERegisterNamespaces("Msn.Drawing");var MC_PointID=10000,MC_PolylineID=30000,MC_PolygonID=50000,MC_SYMBOL_IID=70000,MC_TEXT_IID=90000,MC_ENTITY_IID=200000,MC_COL_IID=1000,MC_GEO_TYPE_SYMBOL="Symbol",MC_GEO_TYPE_POINT="Point",MC_GEO_TYPE_POLYLINE="Polyline",MC_GEO_TYPE_POLYGON="Polygon",MC_GEO_TYPE_TEXT="Text",MC_GEO_TYPE_COL="Collection",MC_GEO_TYPE_ENTITY="Entity",VEShapeType={Pushpin:"Point",Polyline:"Polyline",Polygon:"Polygon"},VEMapserviceType={None:"None",MapCruncher:"MapCruncher",KML:"KML",WMS:"WMS"},VEMapserviceTypeList=[VEMapserviceType.None,VEMapserviceType.MapCruncher,VEMapserviceType.KML,VEMapserviceType.WMS];VEMapserviceTypeIndex=function(c){var b=-1;if(VEMapserviceTypeList!=null)for(var a=0;a<VEMapserviceTypeList.length;a++)if(c==VEMapserviceTypeList[a]){b=a;break}return b};IsValidMapserviceType=function(a){return a!=null&&typeof a!="undefined"&&a!=""&&VEMapserviceTypeIndex(a)!=-1};IsValidMapserviceSource=function(a){return a!=null&&typeof a!="undefined"&&a!=""};IsValidMapserviceMetadata=function(a){return a!=null&&typeof a!="undefined"&&a!=""};IsValidMapserviceOpacity=function(a){return a!=null&&typeof a!="undefined"&&a>=0&&a<=1};Msn.Drawing.GetGeoUID=function(b){var a="";switch(b){case VEShapeType.Polygon:a=MC_PolygonID++;break;case VEShapeType.Pushpin:a=MC_PointID++;break;case VEShapeType.Polyline:a=MC_PolylineID++;break;case MC_GEO_TYPE_SYMBOL:a=MC_SYMBOL_IID++;break;case MC_GEO_TYPE_TEXT:a=MC_TEXT_IID++;break;case MC_GEO_TYPE_COL:a=MC_COL_IID++;break;case MC_GEO_TYPE_ENTITY:a=MC_ENTITY_IID++}return a.toString()};Msn.Drawing.Exception=function(a){this.message=a;this.name="Msn.Drawing.Exception"};Msn.Drawing.Exception.prototype.toString=function(){return this.name+": "+this.message};Msn.Drawing.Point=function(a,b){this.id=0;this.points=[];this.points.push(a);this.points.push(b);this.iid=Msn.Drawing.GetGeoUID(VEShapeType.Pushpin)};Msn.Drawing.Point.prototype.altitudes=null;Msn.Drawing.Point.prototype.altitudeMode="Ground";Msn.Drawing.Point.prototype.type=VEShapeType.Pushpin;Msn.Drawing.Point.prototype.name=null;Msn.Drawing.Point.prototype.symbol=null;Msn.Drawing.Point.prototype.isLabel=true;Msn.Drawing.Point.prototype.isOnLegend=false;Msn.Drawing.Point.prototype.Destroy=function(){this.symbol=null;this.points=null;this.altitudes=null;this.altitudeMode=null};Msn.Drawing.Point.prototype.toString=function(){return this.points[0]+","+this.points[1]};Msn.Drawing.PolyLine=function(a){this.id=0;this.iid=Msn.Drawing.GetGeoUID(VEShapeType.Polyline);this.points=a?a:[];this.minX=null;this.minY=null;this.maxX=null;this.maxY=null;this.length=-1};Msn.Drawing.PolyLine.prototype.toString=function(){if(this.points!=null)return this.points.join(" ");else return ""};Msn.Drawing.PolyLine.prototype.altitudes=null;Msn.Drawing.PolyLine.prototype.altitudeMode="Ground";Msn.Drawing.PolyLine.prototype.extruded=false;Msn.Drawing.PolyLine.prototype.minZ=null;Msn.Drawing.PolyLine.prototype.maxZ=null;Msn.Drawing.PolyLine.prototype.minX=null;Msn.Drawing.PolyLine.prototype.minY=null;Msn.Drawing.PolyLine.prototype.maxX=null;Msn.Drawing.PolyLine.prototype.maxY=null;Msn.Drawing.PolyLine.prototype.iid=Msn.Drawing.GetGeoUID(VEShapeType.Polyline);Msn.Drawing.PolyLine.prototype.labelPosX=null;Msn.Drawing.PolyLine.prototype.labelPosY=null;Msn.Drawing.PolyLine.prototype.labelPosZ=null;Msn.Drawing.PolyLine.prototype.name=null;Msn.Drawing.PolyLine.prototype.type=VEShapeType.Polyline;Msn.Drawing.PolyLine.prototype.symbol=null;Msn.Drawing.PolyLine.prototype.isLabel=true;Msn.Drawing.PolyLine.prototype.isOnLegend=false;Msn.Drawing.PolyLine.prototype.Destroy=function(){this.symbol=null;this.points=null;this.altitudes=null;this.altitudeMode=null;this.extruded=null;this.minX=null;this.minY=null;this.maxX=null;this.maxY=null;this.minZ=null;this.maxZ=null};Msn.Drawing.PolyLine.prototype.GetLength=function(){if(this.length<0)this.length=CalculateShapeLengthP(this.points);return this.length};Msn.Drawing.PolyLine.prototype.SetLength=function(a){this.length=a};Msn.Drawing.Polygon=function(a){this.id=0;this.iid=Msn.Drawing.GetGeoUID(VEShapeType.Polygon);this.points=a;this.length=-1;this.area=-1;this.minX=null;this.minY=null;this.maxX=null;this.maxY=null};Msn.Drawing.Polygon.prototype.altitudes=null;Msn.Drawing.Polygon.prototype.altitudeMode="Ground";Msn.Drawing.Polygon.prototype.extruded=false;Msn.Drawing.Polygon.prototype.minZ=null;Msn.Drawing.Polygon.prototype.maxZ=null;Msn.Drawing.Polygon.prototype.labelPosX=null;Msn.Drawing.Polygon.prototype.labelPosY=null;Msn.Drawing.Polygon.prototype.labelPosZ=null;Msn.Drawing.Polygon.prototype.symbol=null;Msn.Drawing.Polygon.prototype.isLabel=true;Msn.Drawing.Polygon.prototype.isOnLegend=false;Msn.Drawing.Polygon.prototype.type=VEShapeType.Polygon;Msn.Drawing.Polygon.prototype.name=null;Msn.Drawing.Polygon.prototype.Destroy=function(){this.symbol=null;this.points=null;this.altitudes=null;this.altitudeMode=null;this.extruded=null;this.minX=null;this.minY=null;this.maxX=null;this.maxY=null;this.minZ=null;this.maxZ=null};Msn.Drawing.Polygon.prototype.GetLength=function(){if(this.length<0)this.length=CalculateShapeLength(this);return this.length};Msn.Drawing.Polygon.prototype.SetLength=function(a){this.length=a};Msn.Drawing.Polygon.prototype.GetArea=function(){if(this.area<0)this.area=CalculateAreaP(this.points);if(this.area<0)this.area=CalculateAreaP(this.points,false);return this.area};Msn.Drawing.Polygon.prototype.SetArea=function(a){this.area=a};Msn.Drawing.Stroke=function(){this.width=1;this.linecap="round";this.opacity=1;this.linejoin="miter";this.color=new Msn.Drawing.Color(255,255,255,1);this.fillcolor=new Msn.Drawing.Color(0,255,0,1)};Msn.Drawing.Color=function(d,c,b,a){this.R=d?d:0;this.G=c?c:0;this.B=b?b:0;this.A=a?a:0;this.ToHexString=function(){return VEColorToHexString(this.R,this.G,this.B)}};VEShapeStyle=function(){this.iid=Msn.Drawing.GetGeoUID(MC_GEO_TYPE_SYMBOL);this.id=this.iid};VEShapeStyle.prototype.point_type="v:rect";VEShapeStyle.prototype.name="symbol";VEShapeStyle.prototype.highlight_stroke_color="#336666";VEShapeStyle.prototype.highlight_fill_color="#FFCC33";VEShapeStyle.prototype.shape_drawtype="v:shape";VEShapeStyle.prototype.shape_fill="false";VEShapeStyle.prototype.shape_filled="false";VEShapeStyle.prototype.shape_unselectable="off";VEShapeStyle.prototype.style_zIndex=60;VEShapeStyle.prototype.style_zIndex_polyshape=50;VEShapeStyle.prototype.style_position="absolute";VEShapeStyle.prototype.style_filter="alpha(opacity=30)";VEShapeStyle.prototype.style_width="10";VEShapeStyle.prototype.style_height="10";VEShapeStyle.prototype.style_visibility="visible";VEShapeStyle.prototype.style_display="block";VEShapeStyle.prototype.stroke_drawtype="v:stroke";VEShapeStyle.prototype.stroke_on="true";VEShapeStyle.prototype.stroke_joinstyle="miter";VEShapeStyle.prototype.stroke_endcap="round";VEShapeStyle.prototype.stroke_opacity="1";VEShapeStyle.prototype.stroke_color="#0000FF";VEShapeStyle.prototype.stroke_weight="2pt";VEShapeStyle.prototype.stroke_style="Single";VEShapeStyle.prototype.stroke_filltype="solid";VEShapeStyle.prototype.stroke_color2="#FF0000";VEShapeStyle.prototype.stroke_dashstyle="Solid";VEShapeStyle.prototype.stroke_startarrow="none";VEShapeStyle.prototype.stroke_startarrowwidth="medium";VEShapeStyle.prototype.stroke_startarrowlength="medium";VEShapeStyle.prototype.stroke_endarrow="none";VEShapeStyle.prototype.stroke_endarrowwidth="medium";VEShapeStyle.prototype.stroke_endarrowlength="medium";VEShapeStyle.prototype.fill_drawtype="v:fill";VEShapeStyle.prototype.fill_color="#008000";VEShapeStyle.prototype.fill_colors="30% yellow";VEShapeStyle.prototype.fill_color2="#0000FF";VEShapeStyle.prototype.fill_type="solid";VEShapeStyle.prototype.fill_opacity="0.3";VEShapeStyle.prototype.fill_on="false";VEShapeStyle.prototype.textbox_drawtype="v:textbox";VEShapeStyle.prototype.textbox_text="name";VEShapeStyle.prototype.textbox_color="#FFFFFF";VEShapeStyle.prototype.textbox_bold=false;VEShapeStyle.prototype.textbox_italic=false;VEShapeStyle.prototype.textbox_underscore=false;VEShapeStyle.prototype.textbox_font="Arial";VEShapeStyle.prototype.textbox_size=7;VEShapeStyle.prototype.imagedata_on=false;VEShapeStyle.prototype.imagedata_src=null;VEShapeStyle.prototype.isOn=false;VEShapeStyle.prototype.textbox_OffsetX=0;VEShapeStyle.prototype.textbox_OffsetY=0;VEShapeStyle.prototype.textbox_backcolor="#0000FF";VEShapeStyle.textbox_color_opacity="1";VEShapeStyle.textbox_backcolor_opacity="1";VEShapeStyle.prototype.img_offsetX=0;VEShapeStyle.prototype.img_offsetY=0;VEShapeStyle.prototype.img_width=22;VEShapeStyle.prototype.img_height=22;VEShapeStyle.prototype.Clone=function(){var a=new VEShapeStyle;a.point_type=this.point_type;a.name=this.name;a.line_color=this.line_color;a.line_width=this.line_width;a.line_dasharray=this.line_dasharray;a.highlight_stroke_color=this.highlight_stroke_color;a.highlight_fill_color=this.highlight_fill_color;a.shape_drawtype=this.shape_drawtype;a.shape_fill=this.shape_fill;a.shape_filled=this.shape_filled;a.shape_unselectable=this.shape_unselectable;a.style_zIndex=this.style_zIndex;a.style_zIndex_polyshape=this.style_zIndex_polyshape;a.style_position=this.style_position;a.style_filter=this.style_filter;a.style_width=this.style_width;a.style_height=this.style_height;a.style_visibility=this.style_visibility;a.style_display=this.style_display;a.stroke_drawtype=this.stroke_drawtype;a.stroke_on=this.stroke_on;a.stroke_joinstyle=this.stroke_joinstyle;a.stroke_endcap=this.stroke_endcap;a.stroke_opacity=this.stroke_opacity;a.stroke_color=this.stroke_color;a.stroke_weight=this.stroke_weight;a.stroke_style=this.stroke_style;a.stroke_filltype=this.stroke_filltype;a.stroke_color2=this.stroke_color2;a.stroke_dashstyle=this.stroke_dashstyle;a.stroke_startarrow=this.stroke_startarrow;a.stroke_startarrowwidth=this.stroke_startarrowwidth;a.stroke_startarrowlength=this.stroke_startarrowlength;a.stroke_endarrow=this.stroke_endarrow;a.stroke_endarrowwidth=this.stroke_endarrowwidth;a.stroke_endarrowlength=this.stroke_endarrowlength;a.fill_drawtype=this.fill_drawtype;a.fill_color=this.fill_color;a.fill_colors=this.fill_colors;a.fill_color2=this.fill_color2;a.fill_type=this.fill_type;a.fill_opacity=this.fill_opacity;a.fill_on=this.fill_on;a.textbox_drawtype=this.textbox_drawtype;a.textbox_text=this.textbox_text;a.textbox_color=this.textbox_color;a.textbox_bold=this.textbox_bold;a.textbox_italic=this.textbox_italic;a.textbox_underscore=this.textbox_underscore;a.textbox_backcolor=this.textbox_backcolor;a.imagedata_on=this.imagedata_on;a.imagedata_src=this.imagedata_src;a.isOn=this.isOn;a.textbox_OffsetX=this.textbox_OffsetX;a.textbox_OffsetY=this.textbox_OffsetY;a.img_offsetX=this.img_offsetX;a.img_offsetY=this.img_offsetY;a.img_width=this.img_width;a.img_height=this.img_height;return a};function VE_MapLineClip(){var b=-360,c=360,d=-180,e=180,a={LEFT:1,RIGHT:2,BOTTOM:4,TOP:8};function h(i,s,u,t,v){b=s;c=t;d=u;e=v;if(typeof i=="undefined"||i==null||i.length<4)return null;var m=false,o=i.length;if(i[o-2]==i[0]&&i[o-1]==i[1])m=true;var f=[];for(var l=0;l<i.length;l++)f.push(i[l]);var k=a.LEFT;while(k<=8){var q=f[f.length-2],r=f[f.length-1];f.push(q);f.push(r);var h=[],p=f.length;for(var j=0;j<p-2;j=j+2)g(h,k,f[j],f[j+1],f[j+2],f[j+3]);if(m){var n=h.length;if(h[n-2]!=h[0]||h[n-1]!=h[1]){h.push(h[0]);h.push(h[1])}}f=null;k=k*2;f=h}return f}function g(g,j,h,i,k,l){var n=f(h,i),o=f(k,l);if((j&n)==0&&(j&o)==0){g.push(h);g.push(i)}else if((j&n)==0||(j&o)==0){var m=(j&n)==0?true:false;if(j==a.LEFT){var q=i+(l-i)*(b-h)/(k-h);if(m){g.push(h);g.push(i)}g.push(b);g.push(q)}else if(j==a.RIGHT){var q=i+(l-i)*(c-h)/(k-h);if(m){g.push(h);g.push(i)}g.push(c);g.push(q)}else if(j==a.TOP){var p=h+(k-h)*(e-i)/(l-i);if(m){g.push(h);g.push(i)}g.push(p);g.push(e)}else if(j==a.BOTTOM){var p=h+(k-h)*(d-i)/(l-i);if(m){g.push(h);g.push(i)}g.push(p);g.push(d)}};}function f(g,h){var f=0;if(g<b)f=f|a.LEFT;else if(g>c)f=f|a.RIGHT;if(h<d)f=f|a.BOTTOM;else if(h>e)f=f|a.TOP;return f}this.Clip=h}VE_LineClip=new VE_MapLineClip;var L_GraphicsInitError_Text="Your Web browser does not support SVG or VML. Some graphics features may not function properly.";_VERegisterNamespaces("Msn.Drawing");Msn.Drawing.Graphic=function(){};Msn.Drawing.Graphic.CreateGraphic=function(e,b){if(document.all)return new Msn.Drawing.VMLGraphic(e,b);else{if(navigator.userAgent.indexOf("KHTML")!==-1||Gimme.Browser.isOpera)return new Msn.Drawing.SVGGraphic(e,b);var c=0,f=0,g=new RegExp("Firefox/(.*)"),d=g.exec(navigator.userAgent);if(d&&d.length>=2){var a=d[1].split(".");if(a){c=a[0];f=a[1];if(parseInt(c)>0&&parseInt(f)>=5||parseInt(c)>=2)return new Msn.Drawing.SVGGraphic(e,b)}}throw new Msn.Drawing.Exception(L_GraphicsInitError_Text)}};Msn.Drawing.BaseGraphic=function(){this._stroke=new Msn.Drawing.Stroke};Msn.Drawing.BaseGraphic.prototype.CreatePrimitive=function(){};Msn.Drawing.BaseGraphic.prototype.DrawPrimitive=function(d,c,a){var b=new VEShapeStyle;if(a._stroke){b.stroke_weight=a._stroke.width;b.stroke_joinstyle=a._stroke.linejoin;b.stroke_color=a._stroke.color.ToHexString();b.stroke_dashstyle=a._stroke.linecap;b.stroke_opacity=a._stroke.color.A.toString();b.fill_color=a._stroke.fillcolor.ToHexString();b.fill_opacity=a._stroke.fillcolor.A.toString()}c.symbol=b;var e=a.CreatePrimitive(d,c,"");return e};Msn.Drawing.BaseGraphic.prototype.SetStroke=function(a){this._stroke=a};Msn.Drawing.VMLGraphic=function(c,d){Msn.Drawing.BaseGraphic.call();var g=new Msn.Drawing.Color(255,0,0,1),f=new Msn.Drawing.Color(255,0,0,1),e=1,a=c;c.unselectable="on";var b=[];this.DrawPrimitive=function(f,e){var c=Msn.Drawing.VMLGraphic.prototype.DrawPrimitive(d,f,this);if(a&&c){if(e)a.appendChild(wrapVmlElementInDiv(c));else a.appendChild(c);b.push(c)}};this.resetOffset=function(){};this.SetZIndex=function(a){e=a};this.Clear=function(){var a=null,c=null;while(a=b.pop()){c=a.parentElement;if(c)c.removeChild(a);a=null}};this.Destroy=function(){this.Clear();a=null}};Msn.Drawing.VMLGraphic.prototype=new Msn.Drawing.BaseGraphic;Msn.Drawing.VMLGraphic.prototype.CreatePrimitive=function(d,a){var b=null;if(a.type==VEShapeType.Pushpin){if(a.symbol.shape_drawtype=="v:oval"||a.symbol.shape_drawtype=="v:rect"||a.symbol.shape_drawtype=="v:roundrect")b=document.createElement(a.symbol.shape_drawtype);else b=document.createElement("v:roundrect");var f=LatLongtoRoundedPixel(d,a.points[1],a.points[0]);b.style.width=a.symbol.style_width;b.style.height=a.symbol.style_height;b.style.left=-5+f.x+d.GetOffsetX()+"px";b.style.top=-5+f.y+d.GetOffsetY()+"px";b.style.position=a.symbol.style_position}else{b=document.createElement("v:shape");b.className="MSVE_Shape";var g=null;g=GetVmlPath(d,a);var h=d.GetMapWidth(),i=d.GetMapHeight();b.style.top="0px";b.style.left="0px";b.style.width=h+"px";b.style.height=i+"px";b.coordsize=h+" "+i;b.style.position=a.symbol.style_position;b.path=g}b.id=a.id!=0?a.id:a.iid;b.style.zIndex=a.symbol.style_zIndex_polyshape;b.unselectable=a.symbol.shape_unselectable;var c=document.createElement("v:stroke");c.joinstyle=a.symbol.stroke_joinstyle;c.endcap=a.symbol.stroke_endcap;c.opacity=a.symbol.stroke_opacity;c.dashstyle=a.symbol.stroke_dashstyle;c.filltype=a.symbol.stroke_filltype;c.color2=a.symbol.stroke_color2;c.color=a.symbol.stroke_color;c.weight=a.symbol.stroke_weight;c.linestyle=a.symbol.stroke_style;if(a.type==VEShapeType.Polygon){var e=document.createElement("v:fill");e.color=a.symbol.fill_color;e.colors=a.symbol.fill_colors;e.color2=a.symbol.fill_color2;e.type=a.symbol.fill_type;e.opacity=a.symbol.fill_opacity;b.appendChild(e)}else if(a.type==VEShapeType.Polyline){b.fill=false;b.filled=false}else if(a.type==VEShapeType.Pushpin){b.style.filter=a.symbol.style_filter;b.style.zIndex=a.symbol.style_zIndex;b.style.display=a.symbol.style_display;b.unselectable=a.symbol.shape_unselectable;b.fill=true;b.filled=true;b.fillcolor=a.symbol.fill_color}b.appendChild(c);return b};Msn.Drawing.VMLGraphic.prototype.UpdatePoints=function(d,a,b,c){if(c&&(a.type==VEShapeType.Polyline||a.type==VEShapeType.Polygon)){var e=GetVmlPath(d,a);b.path=e}return b};Msn.Drawing.VMLGraphic.prototype.UpdateStyle=function(f,a,e){e.style.zIndex=a.symbol.style_zIndex_polyshape;e.unselectable=a.symbol.shape_unselectable;var c=e.firstChild,b=null,d=null;while(c!=null){if(c.tagName=="stroke")b=c;else if(c.tagName=="fill")d=c;c=c.nextSibling}if(b){b.joinstyle=a.symbol.stroke_joinstyle;b.endcap=a.symbol.stroke_endcap;b.opacity=a.symbol.stroke_opacity;b.dashstyle=a.symbol.stroke_dashstyle;b.filltype=a.symbol.stroke_filltype;b.color2=a.symbol.stroke_color2;b.color=a.symbol.stroke_color;b.weight=a.symbol.stroke_weight;b.linestyle=a.symbol.stroke_style}if(a.type==VEShapeType.Polygon&&d){d.color=a.symbol.fill_color;d.color2=a.symbol.fill_color2;d.type=a.symbol.fill_type;d.opacity=a.symbol.fill_opacity}return e};Msn.Drawing.VMLGraphic.prototype._printable=false;Msn.Drawing.VMLGraphic.prototype._printTilesLayer=null;Msn.Drawing.VMLGraphic.prototype._printTopLayer=null;Msn.Drawing.VMLGraphic.prototype.CreatePrintLayer=function(a,d,c,b){if(!this._printable){this._printTilesLayer=document.createElement("div");this._printTilesLayer.className="MSVE_Print_TileLayer";this._printTilesLayer.innerHTML="<xml:namespace ns='urn:schemas-microsoft-com:vml' prefix='v'/>";a.appendChild(this._printTilesLayer);this._printTopLayer=document.createElement("div");this._printTopLayer.className="MSVE_Print_TopLayer";this._printTopLayer.innerHTML="<xml:namespace ns='urn:schemas-microsoft-com:vml' prefix='v'/>";this._printTopLayer.style.width=c;this._printTopLayer.style.height=b;this._printTopLayer.zIndex=100;a.parentNode.appendChild(this._printTopLayer);this._printable=true}};Msn.Drawing.VMLGraphic.prototype.RemovePrintLayer=function(){if(this._printable){this._printable=false;this._printTilesLayer.parentNode.removeChild(this._printTilesLayer);this._printTopLayer.parentNode.removeChild(this._printTopLayer);this._printTilesLayer=null;this._printTopLayer=null}};Msn.Drawing.VMLGraphic.prototype.AddPrintTile=function(f,g,e,d,b,h,c){var a=null;if(this._printable){a=document.createElement("div");a.style.position="absolute";a.style.top=g;a.style.left=e;a.style.width=d+1;a.style.height=b+1;a.style.zIndex=c;a.innerHTML="<v:image src='"+f+"' style='width:100%;height:100%;left:0px;top:0px;behavior:url(#default#VML);display:inline-block;'></v:image>";this._printTilesLayer.appendChild(a)}return a};Msn.Drawing.VMLGraphic.prototype.RemovePrintTile=function(a){if(a.parentNode)a.parentNode.removeChild(a)};Msn.Drawing.VMLGraphic.prototype.AddLogo=function(b){if(this._printable){var a=document.createElement("v:image");a.src=b;a.className="MSVE_PoweredByLogo_print";this._printTopLayer.appendChild(a)}};Msn.Drawing.SVGGraphic=function(c,b){Msn.Drawing.BaseGraphic.call();var g=new Msn.Drawing.Color(255,0,0,1),f=new Msn.Drawing.Color(0,255,0,1);_curmap=b;this._svgLayer=null;var d=60,e=c,a=[];this.DrawPrimitive=function(d){var c=Msn.Drawing.SVGGraphic.prototype.DrawPrimitive(b,d,this);if(c)a.push(c)};this.resetOffset=function(){_curmap.resetSvgLayer()};this.SetZIndex=function(a){d=a;if(this._svgLayer!=null)this._svgLayer.SetZIndex(a)};this.Destroy=function(){this.Clear()};this.Clear=function(){if(this._svgLayer==null)return;var b=null,c=null;while(b=a.pop()){c=b.parentNode;if(c)c.removeChild(b);b=null}}};Msn.Drawing.SVGGraphic.prototype=new Msn.Drawing.BaseGraphic;Msn.Drawing.SVGGraphic.prototype.CreatePrimitive=function(a,b,c){this._svgLayer=a.getSvgLayer();return this._svgLayer.addShape(b,c)};Msn.Drawing.SVGGraphic.prototype.UpdatePoints=function(a,b,c){this._svgLayer=a.getSvgLayer();return this._svgLayer.UpdatePoints(b,c)};Msn.Drawing.SVGGraphic.prototype.UpdateStyle=function(a,b,c){this._svgLayer=a.getSvgLayer();return this._svgLayer.UpdateStyle(b,c)};Msn.Drawing.SVGGraphic.prototype._printable=false;Msn.Drawing.SVGGraphic.prototype._printTilesLayer=null;Msn.Drawing.SVGGraphic.prototype._printTopLayer=null;Msn.Drawing.SVGGraphic.prototype._printLogo=null;Msn.Drawing.SVGGraphic.prototype._offsetX=null;Msn.Drawing.SVGGraphic.prototype._offsetY=null;Msn.Drawing.SVGGraphic.prototype.CreatePrintLayer=function(d,a,c,b){if(!this._printable){this._svgLayer=a.getSvgLayer();this._printTopLayer=this._svgLayer.CreatePrintLayer("MSVE_Print_TopLayer");this._printTopLayer.setAttributeNS(null,"width",parseInt(c));this._printTopLayer.setAttributeNS(null,"height",parseInt(b));this._printTilesLayer=this._svgLayer.CreatePrintLayer("MSVE_Print_TileLayer");this._printable=true}};Msn.Drawing.SVGGraphic.prototype.RemovePrintLayer=function(){if(this._printable){this._printTilesLayer.parentNode.removeChild(this._printTilesLayer);this._printTopLayer.parentNode.removeChild(this._printTopLayer);this._printTilesLayer=null;this._printTopLayer=null;this._printLogo=null;this._printable=false}};Msn.Drawing.SVGGraphic.prototype.AddPrintTile=function(g,h,f,e,c,b,d){var a=null;if(this._printable){a=document.createElementNS("http://www.w3.org/2000/svg","image");a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",g);a.setAttributeNS(null,"preserveAspectRatio","none");a.setAttributeNS(null,"x",f-this._offsetX);a.setAttributeNS(null,"y",h-this._offsetY);a.setAttributeNS(null,"width",e);a.setAttributeNS(null,"height",c);a.setAttributeNS(null,"opacity",b);this.AddPrintTileToLayer(a,d)}return a};Msn.Drawing.SVGGraphic.prototype.AddPrintTileToLayer=function(d,b){var a=this._printTilesLayer.firstChild;while(a&&a.style.zIndex<b)a=a.nextSibling;if(!a||a.style.zIndex!=b){var c=document.createElementNS("http://www.w3.org/2000/svg","g");c.style.zIndex=b;this._printTilesLayer.insertBefore(c,a);a=c}a.appendChild(d)};Msn.Drawing.SVGGraphic.prototype.RemovePrintTile=function(a){if(this._printable)a.parentElement.removeChild(a)};Msn.Drawing.SVGGraphic.prototype.RePositionPrintTile=function(a,c,b){a.setAttributeNS(null,"x",b-this._offsetX);a.setAttributeNS(null,"y",c-this._offsetY)};Msn.Drawing.SVGGraphic.prototype.SetOffset=function(a,b){this._offsetX=a;this._offsetY=b};Msn.Drawing.SVGGraphic.prototype.AddLogo=function(b){if(this._printable){var a=document.createElementNS("http://www.w3.org/2000/svg","image");a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",b);a.setAttributeNS(null,"class","MSVE_PoweredByLogo_print");a.setAttributeNS(null,"x",6);a.setAttributeNS(null,"y",parseInt(this._printTopLayer.getAttribute("height"))-79);this._printLogo=a;this._printTopLayer.appendChild(a)}};Msn.Drawing.SVGGraphic.prototype.RepositionLogo=function(b,a){if(this._printable&&this._printLogo)this._printLogo.setAttributeNS(null,"y",parseInt(a)-79)};Msn.Drawing.SvgLayer=function(f,g){var c=g,b=null,e=false,h=false;if(e==false){e=true;b=document.createElementNS("http://www.w3.org/2000/svg","svg");b.setAttribute("height","100%");b.setAttribute("width","100%");f.appendChild(b);this.lineDashStyles=[];var a=this.lineDashStyles;a[0]=["Solid","none"];a[1]=["ShortDash","6,2"];a[2]=["ShortDot","2,2"];a[3]=["ShortDashDot","6,2,2,2"];a[4]=["ShortDashDotDot","6,2,2,2,2,2"];a[5]=["Dot","2,6"];a[6]=["Dash","10,6"];a[7]=["LongDash","20,6"];a[8]=["DashDot","10,6,2,6"];a[9]=["LongDashDot","20,6,2,6"];a[10]=["LongDashDotDot","20,6,2,6,2,6"]}this.addShape=function(e){if(b==null)return;var a=null;if(e.type==VEShapeType.Pushpin){a=document.createElementNS("http://www.w3.org/2000/svg","rect");var i=LatLongtoRoundedPixel(c,e.points[1],e.points[0]);a.setAttribute("x",i.x-4);a.setAttribute("y",i.y-4);a.setAttribute("width","8pt");a.setAttribute("height","8pt");a.setAttribute("stroke-width",e.symbol.stroke_weight);a.setAttribute("stroke",e.symbol.stroke_color);a.setAttribute("fill",e.symbol.fill_color);b.appendChild(a)}else if(e.type==VEShapeType.Polyline||e.type==VEShapeType.Polygon){var h=e.type==VEShapeType.Polygon?true:false;a=document.createElementNS("http://www.w3.org/2000/svg",h?"polygon":"polyline");a.setAttributeNS(null,"class","MSVE_Shape");a.setAttribute("points",GetSvgPath(c,e.points));a.setAttribute("stroke",e.symbol.stroke_color);a.setAttribute("stroke-width",e.symbol.stroke_weight);a.setAttribute("stroke-linejoin",e.symbol.stroke_joinstyle);a.setAttribute("stroke-opacity",d(e.symbol.stroke_opacity));var g=this.lineDashStyles;for(var f=0;f<g.length;f++)if(e.symbol.stroke_dashstyle==g[f][0])a.setAttribute("stroke-dasharray",g[f][1]);if(!h)a.setAttribute("fill","none");else{a.setAttribute("fill-rule","evenodd");a.setAttribute("fill",e.symbol.fill_color);a.setAttribute("fill-opacity",d(e.symbol.fill_opacity))}}if(a){a.setAttribute("id",e.id!=0?e.id:e.iid);b.appendChild(a)}return a};function d(b){var a=parseFloat(b);if(a==NaN)a=.3;else if(a>1)a/=100;else if(a<0)a=0;return a}this.SetZIndex=function(a){if(!c.bShowSVG)return;c.GetsvgDiv().style.zIndex=a};this.UpdatePoints=function(a,b){if(a.type==VEShapeType.Polyline||a.type==VEShapeType.Polygon)b.setAttribute("points",GetSvgPath(c,a.points))};this.UpdateStyle=function(a,c){if(b==null)return;if(a.type!=VEShapeType.Pushpin){c.setAttribute("stroke",a.symbol.stroke_color);c.setAttribute("stroke-width",a.symbol.stroke_weight);c.setAttribute("stroke-linejoin",a.symbol.stroke_joinstyle);c.setAttribute("stroke-opacity",d(a.symbol.stroke_opacity));var f=this.lineDashStyles;for(var e=0;e<f.length;e++)if(a.symbol.stroke_dashstyle==f[e][0])c.setAttribute("stroke-dasharray",f[e][1]);if(a.type==VEShapeType.Polyline)c.setAttribute("fill","none");else{c.setAttribute("fill",a.symbol.fill_color);c.setAttribute("fill-opacity",d(a.symbol.fill_opacity))}}return a};this.CreatePrintLayer=function(c){var a=null;if(b){a=document.createElementNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"class",c);b.insertBefore(a,b.firstChild)}return a}};function GetSvgPath(j,e){if(!e)return null;var a=0,k=e.length,f=k/2,i=0,c=new Array(Math.max(128,Math.round(k/8))),b=null,l=0,m=0,g=0,h=0;while(a<f){g=e[a*2];h=e[a*2+1];if(a==f-1||a==0||VE_IsDisplayLatLon(j,l,m,g,h,f)){b=LatLongtoRoundedPixel(j,h,g);if(!b)return;var d="";if(a<f-1)d=d.concat(b.x,",",b.y,",");else d=d.concat(b.x,",",b.y);if(i>=c.length)c.length+=Math.round(c.length/4);c[i++]=d;l=g;m=h}a++}if(i>0)c.length=i;return c.join("")}function LatLongtoRoundedPixel(b,d,e){var c;if(typeof VEMap!="undefined"&&b instanceof VEMap)c=new VELatLong(d,e);else c=new Msn.VE.LatLong(d,e);var a=b.LatLongToPixel(c,b.GetZoomLevel());if(!a)return null;a.x=MathRound(a.x);a.y=MathRound(a.y);return a}VE_LatLongThreshold={PixelDiff:8,DistDiff:.5,OriginLat:0,OriginLon:0,LatDiff:0,LonDiff:0,UseThreshold:true,IsNotInit:true};function VE_SetLatLonThreshold(c,e,d){VE_LatLongThreshold.IsNotInit=false;if(e!=null&&d!=null){VE_LatLongThreshold.OriginLat=d;VE_LatLongThreshold.OriginLon=e}var a,b=LatLongtoRoundedPixel(c,VE_LatLongThreshold.OriginLat,VE_LatLongThreshold.OriginLon);if(b){a=c.PixelToLatLong(new VEPixel(b.x+VE_LatLongThreshold.PixelDiff,b.y+VE_LatLongThreshold.PixelDiff));VE_LatLongThreshold.LatDiff=Math.abs(a.latitude-VE_LatLongThreshold.OriginLat);VE_LatLongThreshold.LonDiff=Math.abs(a.longitude-VE_LatLongThreshold.OriginLon)}}function VE_IsDisplayLatLon(e,i,h,b,a){if(!VE_LatLongThreshold.UseThreshold)return true;var c=Math.abs(VE_LatLongThreshold.OriginLat-a),d=Math.abs(VE_LatLongThreshold.OriginLon-b);if(Math.max(c,d)>VE_LatLongThreshold.DistDiff||VE_LatLongThreshold.IsNotInit)VE_SetLatLonThreshold(e,b,a);var f=Math.abs(a-h),g=Math.abs(b-i);if(f>VE_LatLongThreshold.LatDiff||g>VE_LatLongThreshold.LonDiff)return true;return false}function GetVmlPath(j,a){var h=a.points;if(!h)return null;var g=0,l=h.length,m=l/2,e=0,b=new Array(Math.max(128,Math.round(l/8)));b[e++]="m ";var q=MathRound(j.GetOffsetY()),p=MathRound(j.GetOffsetX()),f=null,n=0,o=0,c=0,d=0;if(l>=4){c=h[g*2];d=h[g*2+1];f=LatLongtoRoundedPixel(j,d,c);if(!f)return null;var i="";i=i.concat(f.x+p,",",f.y+q," l ");if(e>=b.length)b.length+=Math.round(b.length/4);b[e++]=i;n=c;o=d;++g}var k=false;if(a.type!=VEShapeType.Pushpin)if(a.minX==null||a.minY==null||a.maxX==null||a.maxY==null){k=false;a.minX=360;a.minY=360;a.maxX=-360;a.maxY=-360}else k=true;while(g<m){c=h[g*2];d=h[g*2+1];if(!k){a.minX=Math.min(a.minX,c);a.minY=Math.min(a.minY,d);a.maxX=Math.max(a.maxX,c);a.maxY=Math.max(a.maxY,d)}if(VE_IsDisplayLatLon(j,n,o,c,d,m)||g==m-1){f=LatLongtoRoundedPixel(j,d,c);if(!f)return null;var i="";i=i.concat(f.x+p,",",f.y+q," ");if(e>=b.length)b.length+=Math.round(b.length/4);b[e++]=i;n=c;o=d}++g}if(e>=b.length)b.length+=1;b[e++]=" e";if(e>0)b.length=e;return b.join("")}function GetCurrentMapViewBounds(b){var o=b.GetCenterLongitude(),p=b.GetCenterLatitude(),a=b.LatLongToPixel(new Msn.VE.LatLong(p,o)),h=b.GetMapWidth(),g=b.GetMapHeight();if(!a||isNaN(a.x)||isNaN(a.y))return new Msn.VE.Bounds(0,0,-Infinity,-Infinity,Infinity,Infinity);var l,n,k,m,j=false,q=b.GetMapStyle(),c=b.PixelToLatLong(new VEPixel(a.x-h/2,a.y+g/2)),d=b.PixelToLatLong(new VEPixel(a.x+h/2,a.y-g/2));if(Msn.VE.MapStyle.IsViewOblique(q)){var e=b.PixelToLatLong(new VEPixel(a.x-h/2,a.y-g/2)),f=b.PixelToLatLong(new VEPixel(a.x+h/2,a.y+g/2));if(c!=null&&d!=null&&e!=null&&f!=null){l=Math.min(c.longitude,d.longitude,e.longitude,f.longitude);n=Math.min(c.latitude,d.latitude,e.latitude,f.latitude);k=Math.max(c.longitude,d.longitude,e.longitude,f.longitude);m=Math.max(c.latitude,d.latitude,e.latitude,f.latitude)}else j=true}else if(c!=null&&d!=null){l=Math.min(c.longitude,d.longitude);n=Math.min(c.latitude,d.latitude);k=Math.max(c.longitude,d.longitude);m=Math.max(c.latitude,d.latitude)}else j=true;var i=null;if(j)i=new Msn.VE.Bounds(0,0,-Infinity,-Infinity,Infinity,Infinity);else i=new Msn.VE.Bounds(0,0,l,n,k,m);return i}function GetBufferedMapViewBounds(b,a){var c=null,e=Math.abs(a.x2-a.x1),d=Math.abs(a.y2-a.y1);c=new Msn.VE.Bounds(0,0,a.x1-b*e,a.y1-b*d,a.x2+b*e,a.y2+b*d);return c}function IsContainedInView(a,b){var c=false;if(b.x1>a.x1&&b.y1>a.y1&&b.x2<a.x2&&b.y2<a.y2)c=true;return c}Msn.Drawing.ComputeBoundingBox=function(a){if(typeof a=="undefined"||a==null||a.length==0)return null;var c=[],f=Infinity,g=Infinity,d=-Infinity,e=-Infinity;for(var b=0;b<a.length;b=b+2){f=Math.min(f,a[b]);g=Math.min(g,a[b+1]);d=Math.max(d,a[b]);e=Math.max(e,a[b+1])}c[0]=f;c[1]=g;c[2]=d;c[3]=e;return c};function IsBoundsIntersect(a,b){if(a==null)return true;if(b==null)return true;if(a.x2<b.x1||a.x1>b.x2||a.y2<b.y1||a.y1>b.y2)return false;return true}function IsDisplayShape(d,c,e,g,f,h){if(c==0)return true;if(e==f&&g==h)return true;var a=null,b=null;a=d.LatLongToPixel(new Msn.VE.LatLong(g,e));b=d.LatLongToPixel(new Msn.VE.LatLong(h,f));if(a==null||b==null)return true;if(Math.abs(b.y-a.y)>c||Math.abs(b.x-a.x)>c)return true;else return false}function IsRecIntersect(c,d,a,b,g,h,e,f){if(a<g||c>e||b<h||d>f)return false;return true}function wrapVmlElementInDiv(a){var c=Msn.VE.Css.Functions.getComputedStyle,b=document.createElement("div");b.className="VmlContainer";b.style.left=c(a,"left");b.style.top=c(a,"top");b.style.width=c(a,"width");b.style.height=c(a,"height");a.style.position="relative";a.style.left="0px";a.style.top="0px";a.style.width="100%";a.style.height="100%";b.appendChild(a);return b}function VEColorToHexString(c,b,a){return "#"+(c<16?"0":"")+Number(c).toString(16)+(b<16?"0":"")+Number(b).toString(16)+(a<16?"0":"")+Number(a).toString(16)}function VEHexStringToColor(){this.Convert=function(a){a=a.toUpperCase();var b=hTov(a.substring(0,1)),c=hTov(a.substring(1,2)),d=hTov(a.substring(2,3)),e=hTov(a.substring(3,4)),f=hTov(a.substring(4,5)),g=hTov(a.substring(5,6)),h=b*16+c,i=d*16+e,j=f*16+g;return new VEColor(h,i,j,1)};function hTov(h){var v=0;if(h=="A")v=10;else if(h=="B")v=11;else if(h=="C")v=12;else if(h=="D")v=13;else if(h=="E")v=14;else if(h=="F")v=15;else v=eval(h);return v}}_VERegisterNamespaces("Msn.VE");$MVEM=new function(){this.IsEnabled=function(a){if(a==undefined)throw new VEException("$MVEM.IsEnabled","err_invalidfeature","Specified feature is invalid.");return a}};function VEException(b,c,a){this.source=b;this.name=c;this.message=a}VEException.prototype.Name=this.name;VEException.prototype.Source=this.source;VEException.prototype.Message=this.message;function pseudoHover(a){if(!document.all)return;var d=function(){a.className+=" ms_pseudoHover"},c=function(){a.className=a.className.replace(/\s*ms_pseudoHover/g,"")};a.attachEvent("onmouseenter",d);a.attachEvent("onmouseleave",c);window.attachEvent("onunload",b);function b(){a.detachEvent("onmouseenter",d);a.detachEvent("onmouseleave",c);window.detachEvent("onunload",b)}}function pseudoHoverForChildren(d,a){if(!document.all)return;if(!a)a="LI";var c=d.getElementsByTagName(a);for(var b=0;b<c.length;b++)this.pseudoHover(c[b])}function pseudoHoverRemove(a){if(!document.all)return;a.className=a.className.replace(/\s*ms_pseudoHover/g,"")}_VERegisterNamespaces("Msn.VE.Css");Msn.VE.CurrentDomain=typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null?Msn.VE.API.Globals.vecurrentdomain:".";Msn.VE.Css={Cursors:{Auto:"auto",Default:"default",Crosshair:"crosshair",Pointer:"pointer",Move:"move",Wait:"wait",Text:"text",Help:"help",NResize:"n-resize",NEResize:"ne-resize",NWResize:"nw-resize",SResize:"s-resize",SEResize:"se-resize",SWResize:"sw-resize",EResize:"e-resize",WResize:"w-resize",CustomCursors:null,defineCustomCursors:function(c){Msn.VE.Css.Cursors.CustomCursors=c;var b,d=c.length;for(b=0;b<d;b++){var a=c[b];if(navigator.userAgent.indexOf(" Safari/")>-1)Msn.VE.Css.Cursors[a.name]=a.fallback;else Msn.VE.Css.Cursors[a.name]='url("'+a.domain+a.path+'"), '+a.fallback}}},RegEx:{RectClip:/rect\((auto|\d+px|\d*\.*\d+em|\d*\.*\d+pt)\s*,*\s*(auto|\d+px|\d*\.*\d+em|\d*\.*\d+pt)\s*,*\s*(auto|\d+px|\d*\.*\d+em|\d*\.*\d+pt)\s*,*\s*(auto|\d+px|\d*\.*\d+em|\d*\.*\d+pt)\)/},Functions:{addClass:function(a){this.alterClass(a,arguments,true)},removeClass:function(a){this.alterClass(a,arguments,false)},alterClass:function(a,e,g){var c,h=e.length;for(c=1;c<h;c++){var d=e[c],d=e[c].replace(/^\s*/,"").replace(/\s*$/,"");if(d.indexOf(" ")!=-1)continue;var f=new RegExp("(^| )"+d+"( |$)","i");if(g){if(!f.test(a.className))if(a.className=="")a.className=d;else a.className+=" "+d}else{var b=a.className;b=b.replace(f,"$1");b=b.replace(/ $/,"");a.className=b}}},getComputedStyle:function(b,c){var a=null;if(document.defaultView&&document.defaultView.getComputedStyle&&typeof document.defaultView.getComputedStyle!="undefined")a=document.defaultView.getComputedStyle(b,null);else a=b.currentStyle;return a[c]},setClip:function(c,d,e){var b=Msn.VE.Css.Functions.getClip(c,0),f=Msn.VE.Css.RegEx.RectClip,a=f.exec(b);a[d]=e;if(d==0)c.style.clip=a[0];else{a[d]=e;a.shift();b="rect("+a.join(" ")+")";c.style.clip=b}},getClip:function(d,e){var b=d.style.clip;if(b==""){var b=(window.opera?"auto":Msn.VE.Css.Functions.getComputedStyle(d,"clip"))||"auto";if(b=="auto")b="rect(auto auto auto auto)";else if(typeof b=="undefined"||b==null){var c=d.currentStyle;if(typeof c!="undefined"&&c!=null)b="rect("+c.clipTop+" "+c.clipRight+" "+c.clipBottom+" "+c.clipLeft+")"}}var f=Msn.VE.Css.RegEx.RectClip,a=f.exec(b);if(e==0)return a[0];a[1]=a[1]=="auto"?0:a[1];a[4]=a[4]=="auto"?0:a[4];a[2]=a[2]=="auto"?d.offsetWidth:a[2];a[3]=a[3]=="auto"?d.offsetHeight:a[3];if(e==5)return a;else return a[e]}}};_VERegisterNamespaces("Msn.VE");Msn.VE.OSType={Windows:1,Windows95:2,Windows98:3,WindowsMillenium:4,WindowsNT:5,WindowsNT4:6,Windows2000:7,Windows2000SP1:8,WindowsXP:9,WindowsXPSP2:10,WindowsServer2003:11,WindowsServer2003SP1:12,WindowsVista:13,MacOS:30,MacOS9:31,MacOSX:32,Linux:40,Unknown:100};Msn.VE.CLRType={CLR10:1,CLR11:2,CLR20:4,CLR30:8};Msn.VE.BrowserType={Firefox:1,MSIE:2,Opera:3,Unknown:10};Msn.VE.BrowserCaps={VML:1,SVG:2,WindowlessSelectElement:4,RightMouseButton:8,AddFavourite:16,VectorCapable:3};Msn.VE.BrowserInfo=function(){var a=this;this.Type=null;this.BrowserCaps=0;this.CLRType=0;this.MajorVersion=null;this.MinorVersion=null;this.versionString=null;this.UserAgent=null;this.OSType=null;this.Locale=null;if(arguments.length==0){this.UserAgent=window.navigator.userAgent;this.currentBrowser=true}else{this.UserAgent=arguments[0];this.currentBrowser=false;if(arguments.length>=2)this.Locale=arguments[1]}this.IsCompatibleWith=function(c){for(var b=0;b<c.length;b++){var a=c[b];if(a.Type==this.Type&&(this.MajorVersion>a.MajorVersion||a.MajorVersion==this.MajorVersion&&a.MinorVersion>=this.MinorVersion))return true}return false};function b(){if(a.UserAgent.indexOf("Mac")==-1&&(a.UserAgent.indexOf("Gecko")!=-1||a.UserAgent.indexOf("MSIE")!=-1))a.BrowserCaps|=Msn.VE.BrowserCaps.RightMouseButton}function c(){if(a.UserAgent.indexOf("MSIE 7")!=-1||a.UserAgent.indexOf("Gecko")!=-1)a.BrowserCaps|=Msn.VE.BrowserCaps.WindowlessSelectElement}function j(){if(a.UserAgent.indexOf("Mac")==-1&&(a.UserAgent.indexOf("MSIE 5")!=-1||a.UserAgent.indexOf("MSIE 6")!=-1||a.UserAgent.indexOf("MSIE 7")!=-1))a.BrowserCaps|=Msn.VE.BrowserCaps.VML}function i(){if(a.UserAgent.indexOf("MSIE")==-1){var d=0,e=0,f=new RegExp("Firefox/(.*)"),c=f.exec(a.UserAgent);if(c&&c.length>=2){var b=c[1].split(".");if(b){d=b[0];e=b[1];if(parseInt(d)>0&&parseInt(e)>=5)a.BrowserCaps|=Msn.VE.BrowserCaps.SVG}}}}function h(){try{if(a.UserAgent.indexOf("MSIE")!=-1)a.BrowserCaps|=Msn.VE.BrowserCaps.AddFavourite}catch(b){}}this.GetVersionString=function(){if(this.versionString==null)if(a.UserAgent.indexOf("Win")!=-1&&a.UserAgent.indexOf("MSIE")!=-1){var b=null,c;try{b=document.createElement("<DIV STYLE='behavior:url(#default#clientCaps); display: none' ID='__clientCaps'>");document.body.appendChild(b);c=b.getComponentVersion("{89820200-ECBD-11CF-8B85-00AA005B4383}","componentid")}catch(d){c=a.MajorVersion+"."+a.MinorVersion}finally{if($ID("__clientCaps")!=null)$ID("__clientCaps").parentNode.removeChild(b)}this.versionString=c}else if(a.MajorVersion!=null&&a.MajorVersion!=null)this.versionString=a.MajorVersion+"."+a.MinorVersion;else this.versionString="";return this.versionString};function e(){if(a.UserAgent.indexOf("MSIE")!=-1){var c=new RegExp("MSIE ([0-9]).([0-9])"),b=c.exec(a.UserAgent);if(b!=null){a.MajorVersion=parseInt(b[1]);a.MinorVersion=parseInt(b[2]);return}}else if(a.UserAgent.indexOf("Firefox")!=-1){var c=new RegExp("Firefox/([0-9]).([0-9])(.*)"),b=c.exec(a.UserAgent);if(b!=null){a.MajorVersion=parseInt(b[1]);a.MinorVersion=parseInt(b[2]);return}}else if(a.UserAgent.indexOf("Opera")!=-1){var c=new RegExp("Opera/([0-9]).([0-9])"),b=c.exec(a.UserAgent);if(b!=null){a.MajorVersion=parseInt(b[1]);a.MinorVersion=parseInt(b[2]);return}}a.MajorVersion=null;a.MinorVersion=null}function g(){if(a.UserAgent.indexOf("Mac OS X")!=-1)a.OSType=Msn.VE.OSType.MacOSX;else if(a.UserAgent.indexOf("Mac")!=-1)a.OSType=Msn.VE.OSType.MacOS;else if(a.UserAgent.indexOf("Linux")!=-1)a.OSType=Msn.VE.OSType.Linux;else if(a.UserAgent.indexOf("Win95")!=-1||a.UserAgent.indexOf("Windows 95")!=-1)a.OSType=Msn.VE.OSType.Windows95;else if(a.UserAgent.indexOf("Win98")!=-1||a.UserAgent.indexOf("Windows 98")!=-1)a.OSType=Msn.VE.OSType.Windows98;else if(a.UserAgent.indexOf("Win 9x 4.90")!=-1)a.OSType=Msn.VE.OSType.WindowsMillenium;else if(a.UserAgent.indexOf("Windows NT 4.0")!=-1)a.OSType=Msn.VE.OSType.WindowsNT4;else if(a.UserAgent.indexOf("Windows NT 5.01")!=-1)a.OSType=Msn.VE.OSType.Windows2000SP1;else if(a.UserAgent.indexOf("Windows NT 5.0")!=-1)a.OSType=Msn.VE.OSType.Windows2000;else if(a.UserAgent.indexOf("Windows NT 5.1")!=-1&&a.UserAgent.indexOf("SV1")!=-1)a.OSType=Msn.VE.OSType.WindowsXPSP2;else if(a.UserAgent.indexOf("Windows NT 5.1")!=-1)a.OSType=Msn.VE.OSType.WindowsXP;else if(a.UserAgent.indexOf("Windows NT 5.2")!=-1&&a.UserAgent.indexOf("SV1")!=-1)a.OSType=Msn.VE.OSType.WindowsServer2003SP1;else if(a.UserAgent.indexOf("Windows NT 5.2")!=-1)a.OSType=Msn.VE.OSType.WindowsServer2003;else if(a.UserAgent.indexOf("Windows NT 6.0")!=-1)a.OSType=Msn.VE.OSType.WindowsVista;else if(a.UserAgent.indexOf("Windows NT")!=-1)a.OSType=Msn.VE.OSType.WindowsNT;else if(a.UserAgent.indexOf("Win")!=-1)a.OSType=Msn.VE.OSType.Windows;else a.OSType=Msn.VE.OSType.Unknown}function d(){if(a.UserAgent.indexOf(".NET CLR 1.0")!=-1)a.CLRType|=Msn.VE.CLRType.CLR10;if(a.UserAgent.indexOf(".NET CLR 1.1")!=-1)a.CLRType|=Msn.VE.CLRType.CLR11;if(a.UserAgent.indexOf(".NET CLR 2.0")!=-1)a.CLRType|=Msn.VE.CLRType.CLR20;if(a.UserAgent.indexOf(".NET CLR 3.0")!=-1)a.CLRType|=Msn.VE.CLRType.CLR30}function f(){if(a.Locale!=null)return;a.Locale="en-US";if(a.UserAgent.indexOf("MSIE")!=-1){if(navigator.browserLanguage)a.Locale=navigator.browserLanguage;if(navigator.userLanguage)a.Locale=navigator.userLanguage;if(navigator.systemLanguage)a.Locale=navigator.systemLanguage}else if(a.UserAgent.indexOf("Gecko")!=-1){var c=new RegExp("; (.*); rv:"),b=c.exec(a.UserAgent);if(b&&b.length>=2)a.Locale=b[1].substring(b[1].lastIndexOf(" "),b[1].length+1)}else if(a.UserAgent.indexOf("Opera")!=-1){var c=new RegExp(" (.*)\\)"),b=c.exec(a.UserAgent);if(b&&b.length>=2)a.Locale=b[1].substring(b[1].lastIndexOf(" "),b[1].length+1)}}function k(){if(a.UserAgent.indexOf("Gecko")!=-1)a.Type=Msn.VE.BrowserType.Firefox;else if(a.UserAgent.indexOf("MSIE")!=-1)a.Type=Msn.VE.BrowserType.MSIE;else if(a.UserAgent.indexOf("Opera")!=-1)a.Type=Msn.VE.BrowserType.Opera;else a.Type=Msn.VE.BrowserType.Unknown;e();g();d();f();h();i();j();c();b()}k()};Msn.VE.Environment=function(){};Msn.VE.Environment.Redirect=function(a){window.location.href=a};Msn.VE.Environment.BrowserInfo=new Msn.VE.BrowserInfo;Msn.VE.Environment.IsFF20=function(){var a=Msn.VE.Environment.BrowserInfo;if(a.Type==Msn.VE.BrowserType.Firefox){var b=a.MajorVersion;if(b>=2)return true}return false};Msn.VE.Environment.IsIE50=function(){var a=Msn.VE.Environment.BrowserInfo;if(a.Type==Msn.VE.BrowserType.MSIE){var b=a.MajorVersion;if(b>=5)return true}return false};_VERegisterNamespaces("Msn.VE");Msn.VE.PushPinTypes={Default:0,SearchResultPrecise:1,Annotation:2,Direction:3,DirectionTemp:4,TrafficLight:5,TrafficOthers:6,YouAreHere:7,AdStandard:8,AdWide:9,AdCategory:10,AdRoofStandard:11,AdRoofWide:12,AdSponsor:13,DirectionStep:14,Context:15,SearchResultNonprecise:16,Collection:17,Overlay:18};Msn.VE.MapActionMode={ModeUnknown:0,Mode2D:1,Mode3D:2,ModeOblique:3};Msn.VE.BirdsEyeSearchSpinDirection={ClockwiseSpin:-1,NoSpin:0,CounterclockwiseSpin:1};Msn.VE.LineJoinMode={Straight:"miter",Round:"round"};Msn.VE.Css.Cursors.defineCustomCursors([{name:"Grab",domain:".",path:"/cursors/grab.cur",fallback:"move"},{name:"Grabbing",domain:".",path:"/cursors/grabbing.cur",fallback:"move"},{name:"Target",domain:".",path:"/cursors/target.cur",fallback:"crosshair"}]);Msn.VE.MapControl=function(p_elSource,p_htParams,p_parentAPIControl){var offsetMeters=20971520,baseMetersPerPixel=163840,buffer=0,maxTilePixelBuffer=768,animatedMovementEnabled=true,zoomTotalSteps=6,keyboardPanSpeed=15,panToLatLongSpeed=15,earthRadius=6378137,earthCircumference=earthRadius*2*Math.PI,projectionOffset=earthCircumference*.5,minZoom=1,maxZoom=19,emptyTile="http://virtualearth.msn.com/i/spacer.gif",minLatitude=-85,maxLatitude=85,minLongitude=-180,maxLongitude=180,tileSize=256,generations={},zoomLevelToAdjustObliqueToOrthro=18,kbInputZIndex=0,containerZIndex=0,mapZIndex=1,swapZIndex=1,baseZIndex=2,debugZIndex=3,baseZIndex=11,topZIndex=20,p_this=this,m_clientToken=null,cssCursors=Msn.VE.Css.Cursors,cssFn=Msn.VE.Css.Functions,roadStyle=Msn.VE.MapStyle.Road,shadedStyle=Msn.VE.MapStyle.Shaded,hybridStyle=Msn.VE.MapStyle.Hybrid,aerialStyle=Msn.VE.MapStyle.Aerial,obliqueStyle=Msn.VE.MapStyle.Oblique,obliqueHybridStyle=Msn.VE.MapStyle.ObliqueHybrid;generations[roadStyle]=15;generations[aerialStyle]=15;generations[hybridStyle]=15;generations[obliqueStyle]=15;generations[obliqueHybridStyle]=15;var mapTiles="Road",trafficTiles="Traffic",marketMaxZoom=1,currentScaleBarUnit=null,currentView=new Msn.VE.MapView(p_this),preferredView=new Msn.VE.MapView(p_this),previousZoomLevel=1,previousCenter=null,lastViewChangeType=null,previousMapStyle=null,lastOrthoZoomLevel=15,lastOrthoMapStyle=roadStyle,x=0,y=0,width=0,height=0,trafficAvailable=false,tileLayerManager=new VETileLayerManager,originX=0,originY=0,offsetX=0,offsetY=0,tileViewportX1=0,tileViewportY1=0,tileViewportX2=0,tileViewportY2=0,tileViewportWidth=0,tileViewportHeight=0,dragging=false,keyboardPan=false,lastMouseX=0,lastMouseY=0,zooming=false,zoomCounter=0,panning=false,panCounter=0,panningX=0,panningY=0,panLatitude=null,panLongitude=null,pushpins=[],lines=[],map=document.createElement("div"),keyboard=document.createElement("input");keyboard.id="wl_ve_mapInput";var logo=null,scaleBar=null,mapLegend=null,copyright=null;this.UpdateCopyright=function(){if(copyright)copyright.Update()};var dashboardContainer=null,dashboard=null,minimapControl=null,minimapContainer=null,mouseZoomDisabled=false,mousewheelZoomToCenter=true,isMinimap=false,boxTool=null,panTool=null,targetTool=null,currentTool=null,orthoMode=null,obliqueMode=null,threeDMode=null,currentMode=null,previousMode=null,Initialized2D=false,currentBounds=null,defaultEventTable=[],customEventTable=[],debug=false,graphicCanvas=null,svgLayer=null,svgDiv=null,bShowSVG=true;this.GetsvgDiv=function(){return svgDiv};var mapCenterOffset=new VEPixel(0,0),resizeInProgress=false,loadBaseTiles=true,view3DCreated=false,spacecontrol=false,spacediv=null,spaceCameraIsFlying=false,init3dparam=null,resizeTimer=null,traffic3dAdded=false,initial3dView=null,cameraUpdateCount=0,photoplugin3dActive=false;this.Is3DPhotoPluginActive=function(){return photoplugin3dActive};this.Set3DPhotoPluginActive=function(a){photoplugin3dActive=a};function SetChildDiv(a){map.appendChild(a)}function EnableGeoCommunity(a){hijackMouseMove=a}function IsGeoCommunityEnabled(){return hijackMouseMove}function HijackMouseCursor(a){hijackMouseCursor=a}function IsHijackMouseCursor(){return hijackMouseCursor}function GetOffsetX(){return offsetX}function GetOffsetY(){return offsetY}function GetOriginY(){return originY}function GetOriginX(){return originX}this.Init=function(){orthoMode=new OrthoMode;orthoMode.Init();if(p_htParams.obliqueEnabled){obliqueMode=new ObliqueMode;obliqueMode.SetGUID(p_htParams.mapGUID);obliqueMode.Init(p_htParams.obliqueUrl?p_htParams.obliqueUrl:"%0dev.virtualearth.net/services/v1/ImageryMetadataService/ImageryMetadataService.asmx")}if(p_htParams.clientToken)this.SetClientToken(p_htParams.clientToken);threeDMode=new ThreeDMode;threeDMode.Init();UpdateFromParent();map.className="MSVE_Map";map.style.zIndex=mapZIndex;p_elSource.appendChild(map);cssFn.addClass(p_elSource,"MSVE_MapContainer");keyboard.className="MSVE_KeyboardInput";if(typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null&&Web.Browser.isSafari()){keyboard.style.top=0;keyboard.style.left=0;keyboard.style.border=0;if(Web.Browser.isSafari2()){keyboard.style.height=0;keyboard.style.width=0}else if(Web.Browser.isSafari3()){keyboard.style.outlineWidth=0;keyboard.style.color="transparent";keyboard.style.backgroundColor="transparent"}}p_elSource.appendChild(keyboard);if(!p_htParams.fixedView){p_elSource.attachEvent("onmousedown",MouseDown);p_elSource.attachEvent("onmouseup",MouseUp);p_elSource.attachEvent("onmousemove",MouseMove);p_elSource.attachEvent("ondblclick",MouseDoubleClick);p_elSource.attachEvent("oncontextmenu",ContextMenu);p_elSource.attachEvent("onclick",MouseClick);p_elSource.attachEvent("onmouseout",MouseOut);p_elSource.attachEvent("onmouseover",MouseOver);p_elSource.attachEvent("onmouseenter",MouseEnter);p_elSource.attachEvent("onmouseleave",MouseLeave)}if(p_htParams.buffer!=undefined&&p_htParams.buffer!=null)SetTilePixelBuffer(p_htParams.buffer);var startIn3DMode=false;loadBaseTiles=typeof p_htParams.loadBaseTiles=="undefined"||p_htParams.loadBaseTiles!=false;if(p_htParams.mapMode!="undefined"&&p_htParams.mapMode!=null&&p_htParams.mapMode==Msn.VE.MapActionMode.Mode3D||p_htParams.altitude&&p_htParams.altitude>-1000||p_htParams.tilt&&p_htParams.tilt!=-90||p_htParams.direction&&p_htParams.direction!=0){SetBaseTileSource();startIn3DMode=true;currentMode=threeDMode}init3dparam=p_htParams.mapGUID;if((p_htParams.latitude!=null&&typeof p_htParams.latitude!="undefined"&&p_htParams.longitude!=null&&typeof p_htParams.longitude!="undefined"&&p_htParams.zoomlevel!=null&&typeof p_htParams.zoomlevel!="undefined"||p_htParams.boundingBox!=null&&typeof p_htParams.boundingBox!="undefined")&&p_htParams.mapstyle!=null&&typeof p_htParams.mapstyle!="undefined")try{var initialView=new Msn.VE.MapView(p_this);initialView.SetMapStyle(ValidateMapStyle(p_htParams.mapstyle),p_htParams.obliqueSceneId,p_htParams.birdseyeOrientation);if(startIn3DMode){initialView.sceneId=p_htParams.obliqueSceneId;initialView.photoX=p_htParams.photoX;initialView.photoY=p_htParams.photoY;initialView.photoScale=p_htParams.photoScale}if(p_htParams.boundingBox){var bb=p_htParams.boundingBox;if(bb.northwest){bb.northwest.latitude=ClipLatitude(bb.northwest.latitude);bb.northwest.longitude=ClipLongitude(bb.northwest.longitude)}if(bb.southeast){bb.southeast.latitude=ClipLatitude(bb.southeast.latitude);bb.southeast.longitude=ClipLongitude(bb.southeast.longitude)}initialView.SetLatLongRectangle(bb);if(startIn3DMode)initialView.Resolve(orthoMode,width,height)}else{initialView.SetZoomLevel(eval(p_htParams.zoomlevel));initialView.SetCenterLatLong(new Msn.VE.LatLong(eval(p_htParams.latitude),eval(p_htParams.longitude)))}if(p_htParams.altitude)initialView.SetAltitude(p_htParams.altitude);if(p_htParams.tilt)initialView.SetTilt(p_htParams.tilt);if(p_htParams.direction)initialView.SetDirection(p_htParams.direction);if(p_htParams.cameraPos){initialView.cameraLatlong=new Msn.VE.LatLong(eval(p_htParams.cameraPos[0]),eval(p_htParams.cameraPos[1]));initialView._needsPivotOperation=false}if(!startIn3DMode)SetBaseTileSource();currentView=initialView}catch(a){if(!startIn3DMode)SetDefaultView();else currentView=initialView}else if(!startIn3DMode)SetDefaultView();else currentView=initialView;if(startIn3DMode)this.Init3DOnly();else this.Init2DOnly();if(typeof p_htParams.hideCopyright=="undefined"||!p_htParams.hideCopyright){copyright=new Copyright(p_elSource);copyright.Init();copyright.Update();if(scaleBar)copyright.PinTo(scaleBar);if(mapLegend)mapLegend.PinTo(copyright)}if(typeof p_htParams.showMinimap!="undefined"&&p_htParams.showMinimap){var loadMinimapNow=false;if(obliqueMode!=null&&Msn.VE.MapStyle.IsViewOblique(p_htParams.mapstyle))loadMinimapNow=true;CreateMinimap(null,null,null,loadMinimapNow,null,p_htParams.minimapVersion,p_htParams.clientToken)}if(p_htParams.showDashboard){if(p_htParams.showMapModeSwitch!=false)p_htParams.showMapModeSwitch=true;CreateDashboard(p_htParams.dashboardX,p_htParams.dashboardY,p_htParams.dashboardSize,p_htParams.dashboardId,p_htParams.showMapModeSwitch,p_htParams.obliqueEnabled,p_htParams.labelsDefault,p_htParams.dashboardVersion)}if(p_htParams.showMapLegend)this.CreateLegend();if(startIn3DMode)copyright.Hide()};AttachEvent("onstartmapstyleoblique",function(){if(targetTool)targetTool.trackMovement()});AttachEvent("onendmapstyleoblique",function(){if(targetTool)targetTool.ignoreMovement()});AttachEvent("onchangeview",OnChangeView);this.Init2DOnly=function(a){mvcViewFacade.OnSwitchToFlatlandView();currentView.doRoadShading=typeof p_htParams.doRoadShading!="undefined"&&p_htParams.doRoadShading==true;if(!p_htParams.fixedView){boxTool=new BoxTool;boxTool.Init();panTool=new PanTool;panTool.Init();currentTool=panTool;keyboard.attachEvent("onkeydown",KeyDown);keyboard.attachEvent("onkeyup",KeyUp);keyboard.attachEvent("onblur",StopKeyboardPan);p_elSource.attachEvent("onmousewheel",MouseWheel)}targetTool=new TargetTool;targetTool.init();if(!p_htParams.disableLogo){logo=new Logo(p_elSource);logo.Init()}if(typeof copyright!="undefined"&&copyright!=null)copyright.Show();if(obliqueMode&&currentMode!=obliqueMode)obliqueMode.UpdateAvailability();graphicCanvas=GetGraphic(this);tileLayerManager.Active=true;if(currentView==null)SetDefaultView();else{if(a==true||!Initialized2D){SetView(currentView);Initialized2D=true}SetView(null)}if(p_htParams.showScaleBar){InitScaleBar();scaleBar.Show()}Fire("oninitmode",Msn.VE.MapActionMode.Mode2D)};function InitScaleBar(){scaleBar=new ScaleBar(p_elSource);scaleBar.Init();if(currentScaleBarUnit)SetScaleBarDistanceUnit(currentScaleBarUnit);if(copyright)copyright.PinTo(scaleBar);AttachEvent("onendzoom",scaleBar.Update);AttachEvent("onendpan",scaleBar.Update);AttachEvent("onobliquechange",scaleBar.Update);AttachEvent("onchangemapstyle",scaleBar.Update);AttachEvent("onresize",scaleBar.Reposition)}this.Init3DOnly=function(){if(typeof LoadMapDrawing=="function")LoadMapDrawing(null);if(dashboard)if(window.navigator.userAgent.indexOf("Firefox")<0){var d=dashboard.GetShimmedElements(),c;for(c=0;c<d.length;c++)UpdateIFrameShim(d[c])}var b;try{if(currentView==null)b=SetDefaultView();else{var a=currentView.MakeCopy();if(Msn.VE.MapStyle.IsViewOblique(currentView.mapStyle)){a.SetMapStyle(lastOrthoMapStyle);a.SetZoomLevel(a.GetZoomLevel()+zoomLevelToAdjustObliqueToOrthro)}a.SetCenterLatLong(new Msn.VE.LatLong(currentView.latlong.latitude,currentView.latlong.longitude));a.cameraLatlong=currentView.cameraLatlong;b=SetView(a)}}catch(e){b=false}if(!b){this._Disable3DMode(true);return}if(!view3DCreated)return;mvcViewFacade.OnSwitchToView3D(spacecontrol);if(p_htParams.showDashboard)spacecontrol.ShowNavigationControl=true;if(typeof p_htParams.hideCopyright=="undefined"||!p_htParams.hideCopyright)spacecontrol.ShowCopyright=true;if(typeof copyright!="undefined"&&copyright!=null)copyright.Hide();if(p_htParams.showScaleBar)spacecontrol.ShowScale=true;if(currentScaleBarUnit&&p_htParams.showScaleBar||Msn.VE.API)this.SetScaleBarDistanceUnit(currentScaleBarUnit);if((typeof Msn.VE.API=="undefined"||!Msn.VE.API)&&window.locale)spacecontrol.DisplayMetricUnits=MapControl.Features.ScaleBarKilometers;if(mapLegend)mapLegend.UpdateShim();spacecontrol.AttachEvent("OnHardwareCapabilitiesUpdate","OnHardwareCapabilitiesUpdate");if(spacecontrol.HardwareClassificationLevel>0)this.Setup3DManifests();tileLayerManager.AddAllTileSourcesTo3D(spacecontrol);AttachEvent("onchangetraffic",OnView3DScaleBarPositionUpdate);AttachEvent("onchangemapstyle",OnChangeMapStyle3D);spacecontrol.AttachEvent("OnCameraChanged","OnView3DUpdateViewpoint");spacecontrol.AttachEvent("OnBeginCameraChange","OnBeginFlyTo");if(!p_htParams.fixedView){spacecontrol.AttachEvent("OnHover","OnView3DPushpinHover");spacecontrol.AttachEvent("OnHoverEnd","OnView3DHoverEnd");spacecontrol.AttachEvent("OnDropGeometry","OnView3DDropGeometry");spacecontrol.AttachEvent("OnLatLonAltClicked","OnView3DLatLonAltClicked");spacecontrol.AttachEvent("OnMouseDown","OnMouseDown3D");spacecontrol.AttachEvent("OnMouseUp","OnMouseUp3D");spacecontrol.AttachEvent("OnClick","OnClick3D");spacecontrol.AttachEvent("OnMouseOver","OnMouseOver3D");spacecontrol.AttachEvent("OnMouseOut","OnMouseOut3D");spacecontrol.AttachEvent("OnDoubleClick","OnDoubleClick3D");spacecontrol.AttachEvent("OnModelViewSuccess","UniqueModelViewSuccess");spacecontrol.AttachEvent("OnModelViewFailure","UniqueModelViewFailure");spacecontrol.AttachEvent("OnModelFullyDownloaded","UniqueModelFullyDownloaded")}else spacecontrol.FixedView=true;traffic3dAdded=false;if(typeof VE_TrafficManager!="undefined"&&VE_TrafficManager!=null)VE_TrafficManager.GetTrafficInfo(false);OnView3DScaleBarPositionUpdate();if(typeof VE_BrandExplorationManager!="undefined"&&VE_BrandExplorationManager!=null)VE_BrandExplorationManager.Clear();LoadStreetLevelGeometry(spacecontrol);LoadHiResModelsPlugin(spacecontrol);LoadWeatherPlugin(spacecontrol);if(!init3dparam)Relay3DPushpins();Fire("oninitmode",Msn.VE.MapActionMode.Mode3D)};this.Setup3DManifests=function(){var c=currentView.mapStyle,a="http://go.microsoft.com/fwlink/?LinkID=98770",b="http://go.microsoft.com/fwlink/?LinkID=98775",d="http://go.microsoft.com/fwlink/?LinkID=98774";if(c=="a"){a="http://go.microsoft.com/fwlink/?LinkID=98771";spacecontrol.ShowAtmosphere=true}if(c=="h"){a="http://go.microsoft.com/fwlink/?LinkID=98772";spacecontrol.ShowAtmosphere=true}if(c=="r"){spacecontrol.TexturesVisible=false;if(spacecontrol.HardwareClassificationLevel<3)a="http://go.microsoft.com/fwlink/?LinkID=98769";spacecontrol.ShowAtmosphere=false}else spacecontrol.TexturesVisible=true;if(2==spacecontrol.HardwareClassificationLevel){d="http://go.microsoft.com/fwlink/?LinkID=98773";b="http://go.microsoft.com/fwlink/?LinkID=98776"}else if(1==spacecontrol.HardwareClassificationLevel){d="http://go.microsoft.com/fwlink/?LinkID=98773";b=""}if(loadBaseTiles)spacecontrol.AddImageSource("Terrain","Texture",GetManifestUrl(a),0,1);spacecontrol.AddElevationSource("Terrain","DEM",GetManifestUrl(d),0);if(b!="")spacecontrol.AddModelSource("Model","Model",GetManifestUrl(b));else spacecontrol.RemoveModelSource("Model","Model")};this.ShowSVG=function(a){bShowSVG=a};this.getSvgLayer=function(){if(svgLayer==null){svgDiv=document.createElement("div");svgDiv.style.position="absolute";if(bShowSVG)svgDiv.style.zIndex=60;else svgDiv.style.zIndex=-1;svgDiv.align="left";this.resizeSVG();map.appendChild(svgDiv);svgLayer=new Msn.Drawing.SvgLayer(svgDiv,this)}return svgLayer};this.resetSvgLayer=function(){this.getSvgLayer();svgDiv.style.top=-parseInt(map.style.top)+"px";svgDiv.style.left=-parseInt(map.style.left)+"px";if(currentMode!=threeDMode&&graphicCanvas){graphicCanvas.SetOffset(offsetX,offsetY);tileLayerManager.RePositionPrintTiles()}};this.resizeSVG=function(){if(svgDiv!=null){var b=GetWindowWidth(),a=GetWindowHeight();svgDiv.style.top="0px";svgDiv.style.left="0px";svgDiv.style.width=b+"px";svgDiv.style.height=a+"px";if(currentMode!=threeDMode&&graphicCanvas){graphicCanvas.SetOffset(offsetX,offsetY);graphicCanvas.RepositionLogo(g(p_elSource).getStyle("width"),g(p_elSource).getStyle("height"));tileLayerManager.RePositionPrintTiles()}}};function GetGraphic(a){if(!graphicCanvas)try{graphicCanvas=Msn.Drawing.Graphic.CreateGraphic(map,a);graphicCanvas.SetZIndex(17)}catch(b){}return graphicCanvas}this.GetDashboard=function(){return dashboard};this.GetMinimap=function(){return minimapControl};this.DisableZoomEvents=function(a){mouseZoomDisabled=a};this.GetMouseWheelZoomToCenter=function(){return mousewheelZoomToCenter};this.SetMouseWheelZoomToCenter=function(a){mousewheelZoomToCenter=a};this.SetMinimapMode=function(){mouseZoomDisabled=true;isMinimap=true};this.SetCursor=function(a){var b=p_elSource.style;if(b.cursor!=a)b.cursor=a};this.Destroy=function(){if(currentView){currentView.Destroy();currentView=null}if(preferredView){preferredView.Destroy();preferredView=null}if(copyright){copyright.Destroy();copyright=null}if(currentMode==threeDMode&&currentMode!=null)this.Destroy3DOnly();else{this.Destroy2DOnly();while(pushpins.length)pushpins.pop().Destroy();ClearLines()}if(!p_htParams.fixedView){p_elSource.detachEvent("onmousedown",MouseDown);p_elSource.detachEvent("onmouseup",MouseUp);p_elSource.detachEvent("onmousemove",MouseMove);p_elSource.detachEvent("ondblclick",MouseDoubleClick);p_elSource.detachEvent("oncontextmenu",ContextMenu);p_elSource.detachEvent("onmousewheel",MouseWheel);p_elSource.detachEvent("onclick",MouseClick);p_elSource.detachEvent("onmouseout",MouseOut);p_elSource.detachEvent("onmouseover",MouseOver);p_elSource.detachEvent("onmouseenter",MouseEnter);p_elSource.detachEvent("onmouseleave",MouseLeave)}if(dashboard){if(typeof dashboard.Destroy!="undefined")dashboard.Destroy();dashboard=null}if(mapLegend){DetachEvent("onendzoom",mapLegend.Update);DetachEvent("onendpan",mapLegend.Update);DetachEvent("onobliquechange",mapLegend.Update);if(typeof VE_TrafficManager!="undefined"&&VE_TrafficManager!=null)VE_TrafficManager.CloseTrafficLegend();mapLegend.Destroy();mapLegend=null}if(dashboardContainer){dashboardContainer.detachEvent("onmousedown",IgnoreEvent);dashboardContainer.detachEvent("onmouseup",IgnoreEvent);dashboardContainer.detachEvent("onmousemove",DashboardContainerMouseMoveEvent);dashboardContainer.detachEvent("onmousewheel",IgnoreEvent);dashboardContainer.detachEvent("ondblclick",IgnoreEvent);dashboardContainer.detachEvent("oncontextmenu",IgnoreEvent);dashboardContainer.detachEvent("onkeydown",IgnoreEvent);dashboardContainer.detachEvent("onkeyup",IgnoreEvent);dashboardContainer=null}if(minimapControl){minimapControl.Destroy();minimapControl=null}if(minimapContainer){minimapContainer.detachEvent("onmousedown",IgnoreEvent);minimapContainer.detachEvent("onmouseup",IgnoreEvent);minimapContainer.detachEvent("onmousemove",DashboardContainerMouseMoveEvent);minimapContainer.detachEvent("onmousewheel",IgnoreEvent);minimapContainer.detachEvent("ondblclick",IgnoreEvent);minimapContainer.detachEvent("oncontextmenu",IgnoreEvent);minimapContainer.detachEvent("onkeydown",IgnoreEvent);minimapContainer.detachEvent("onkeyup",IgnoreEvent);minimapContainer=null}if(orthoMode){orthoMode.Destroy();orthoMode=null}if(obliqueMode){obliqueMode.Destroy();obliqueMode=null}if(threeDMode){threeDMode.Destroy();threeDMode=null}DestroyEventTable();m_clientToken=null;p_elSource.style.backgroundColor="transparent";p_elSource.style.backgroundImage="none";p_elSource.style.filter="";keyboard=p_elSource=p_this=map=null;tileLayerManager.ClearTileLayers();cssCursors=null;cssFn=null};this.Destroy2DOnly=function(){if(!p_htParams.fixedView){keyboard.detachEvent("onkeydown",KeyDown);keyboard.detachEvent("onkeyup",KeyUp);keyboard.detachEvent("onblur",StopKeyboardPan);p_elSource.detachEvent("onmousewheel",MouseWheel)}tileLayerManager.Active=false;if(scaleBar){DetachEvent("onendzoom",scaleBar.Update);DetachEvent("onendpan",scaleBar.Update);DetachEvent("onobliquechange",scaleBar.Update);DetachEvent("onchangemapstyle",scaleBar.Update);DetachEvent("onresize",scaleBar.Reposition);scaleBar.Destroy();scaleBar=null}if(copyright)copyright.PinTo(null);if(logo){logo.Destroy();logo=null}if(boxTool){boxTool.Destroy();boxTool=null}if(panTool){panTool.Destroy();panTool=null}if(targetTool){targetTool.destroy();targetTool=null}if(graphicCanvas){graphicCanvas.Destroy();graphicCanvas=null}Fire("ondestroymode",Msn.VE.MapActionMode.Mode2D)};this.Destroy3DOnly=function(){DetachEvent("onchangetraffic",OnView3DScaleBarPositionUpdate);DetachEvent("onchangemapstyle",OnChangeMapStyle3D);view3DCreated=false;try{spacecontrol.Close()}catch(c){}spacecontrol=false;window.status="";if(spacediv!=null){spacediv.removeNode(true);spacediv=null}if(dashboard&&dashboard.GetShimmedElements){var b=dashboard.GetShimmedElements(),a;for(a=0;a<b.length;a++)destroyIFrameShim(b[a].id)}if(mapLegend)mapLegend.RemoveShim();Fire("ondestroymode",Msn.VE.MapActionMode.Mode3D)};function OnView3DScaleBarPositionUpdate(){var a=0;if(typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null){if(VE_TrafficManager.turnedOn&&VE_TrafficManager.legend!=null&&VE_TrafficManager.legendPinned)a=25}else if(VE_TrafficManager.turnedOn)a=25;if(spacecontrol)spacecontrol.RaiseEvent("CB24F613-FE72-442e-857A-BB2FD6BFBAA5","OnScaleBarPositionChange",a)}function UpdateFromParent(){var a=g(p_elSource).getPagePosition();x=a.x;y=a.y;width=p_elSource.offsetWidth;height=p_elSource.offsetHeight}function CreateDashboard(c,d,b,h,e,g,f,a){if(currentMode==threeDMode&&currentMode!=null)b=Msn.VE.DashboardSize.Normal;dashboard=Msn.VE.NavControlFactory(p_elSource,p_this,b,h,e,g,f,a);dashboard.Init();dashboardContainer=dashboard.GetElement();if(a==5){if(isFinite(parseInt(c)))dashboardContainer.style.left=c+"px";if(isFinite(parseInt(d)))dashboardContainer.style.top=d+"px"}}function CreateMinimap(c,d,a,f,g,h,e){minimapContainer=document.createElement("div");if(typeof a!="undefined"&&a!=null)minimapContainer.id=a;else minimapContainer.id="MSVE_minimap";p_elSource.appendChild(minimapContainer);minimapContainer.attachEvent("onmousedown",IgnoreEvent);minimapContainer.attachEvent("onmouseup",IgnoreEvent);minimapContainer.attachEvent("onmousemove",DashboardContainerMouseMoveEvent);minimapContainer.attachEvent("onmousewheel",IgnoreEvent);minimapContainer.attachEvent("ondblclick",IgnoreEvent);minimapContainer.attachEvent("oncontextmenu",IgnoreEvent);minimapContainer.attachEvent("onkeydown",IgnoreEvent);minimapContainer.attachEvent("onkeyup",IgnoreEvent);minimapControl=new Msn.VE.Minimap(minimapContainer,p_this,g,h);if(e)minimapControl.SetClientToken(e);var b=f||IsMapViewOblique()||$MVEM.IsEnabled(MapControl.Features.Minimap.ShowByDefault);b=b&&IsModeEnabled(Msn.VE.MapActionMode.Mode2D);if(b)minimapControl.Init();if(typeof c!="undefined"&&c!=null&&typeof d!="undefined"&&d!=null)minimapControl.SetPosition(c,d);return minimapControl}function OnChangeView(){if(Msn.VE.MapStyle.IsViewOblique(currentView.mapStyle)){var b=GetObliqueScene();if(b!=null&&targetTool){var a=Msn.VE.Geometry,e=g(p_elSource).getPagePosition(),c=new a.Point(e.x+(map.offsetLeft-originX),e.y+(map.offsetTop-originY)),d=2/currentView.zoomLevel,h=new a.Point(c.x+b.GetWidth()/d,c.y+b.GetHeight()/d),f=new a.Rectangle(c,h);f.scale(-256);targetTool.setBoundingArea(f);a=null}b=null}if(obliqueMode)obliqueMode.UpdateAvailability()}function SetDefaultView(){var a=new Msn.VE.MapView(p_this);a.SetCenterLatLong(new Msn.VE.LatLong(0,0));a.SetZoomLevel(1);a.SetMapStyle(roadStyle);SetBaseTileSource(a);SetView(a);Initialized2D=true}function SetAltitude(b){Sync3dView();var a=currentView.MakeCopy();a.SetAltitude(b);SetView(a)}function SetTilt(b){Sync3dView();var a=currentView.MakeCopy();a.SetTilt(b);SetView(a)}function SetDirection(b){Sync3dView();var a=currentView.MakeCopy();a.SetDirection(b);SetView(a)}function GetCurrentMode(){return currentMode}function GetObliqueMode(){return obliqueMode}function GetOrthoMode(){return orthoMode}function GetMapWidth(){return width}function GetMapHeight(){return height}function SetMapHeight(a){height=a;p_this.h=a;p_elSource.style.height=a}function GetCurrentMapView(){return preferredView.MakeCopy()}function SetCenter(c,b){Sync3dView();var a=preferredView.MakeCopy();a.SetCenterLatLong(new Msn.VE.LatLong(c,b));SetView(a)}function SetCenterAccurate(c,b){Sync3dView();var a=preferredView.MakeCopy();a.SetCenterLatLongAccurate(new Msn.VE.LatLong(c,b));SetView(a)}function SetMapStyle(b,f,c,e,d){Sync3dView();var a=currentView.MakeCopy();a.SetMapStyle(ValidateMapStyle(b),f,c,e,d);if(Msn.VE.MapStyle.IsViewOblique(currentView.mapStyle)!=Msn.VE.MapStyle.IsViewOblique(b))if(Msn.VE.MapStyle.IsViewOblique(b)){Fire("onstartmapstyleoblique");a.SetZoomLevel(1);lastOrthoZoomLevel=currentView.zoomLevel;lastOrthoMapStyle=currentView.mapStyle}else if(Msn.VE.MapStyle.IsViewOblique(currentView.mapStyle)){Fire("onendmapstyleoblique");a.SetZoomLevel(lastOrthoZoomLevel)}a.latlong.latitude=GetCenterLatitude();a.latlong.longitude=GetCenterLongitude();if(currentMode==threeDMode)a._supressFlyToCall=true;SetView(a)}function SetScaleBarDistanceUnit(a){currentScaleBarUnit=a;if(scaleBar!=null){scaleBar.SetDistanceUnit(a);scaleBar.Update()}if(currentMode==threeDMode&&spacecontrol!=null){if(a==null)bUseKilometers=$MVEM.IsEnabled(MapControl.Features.ScaleBarKilometers);else bUseKilometers=a==Msn.VE.DistanceUnit.Kilometers;spacecontrol.DisplayMetricUnits=bUseKilometers}}function SetScaleBarVisibility(a){p_htParams.showScaleBar=a;if(currentMode!=null)if(currentMode==threeDMode){if(spacecontrol!=null)spacecontrol.ShowScale=a}else if(a){if(!scaleBar)InitScaleBar();scaleBar.Show()}else if(scaleBar)scaleBar.Hide()}function ValidateMapStyle(a){if(Msn.VE.MapStyle.IsViewOrtho(a)||Msn.VE.MapStyle.IsViewOblique(a))return a;else return roadStyle}function GetCenterLatitude(){if(currentMode==threeDMode){if(view3DCreated){var a=spacecontrol.GetCenterLatitude();return isNaN(a)?null:a}return null}else if(currentView!=null&&currentView!="undefined"&&currentView.latlong!=null&&currentView.latlong!="undefined"&&currentView.latlong.latitude!=null&&currentView.latlong.latitude!="undefined")return currentView.GetCenterLatLong().latitude;return null}function GetCenterLongitude(){if(currentMode==threeDMode){if(view3DCreated){var a=spacecontrol.GetCenterLongitude();return isNaN(a)?null:a}return null}else if(currentView!=null&&currentView!="undefined"&&currentView.latlong!=null&&currentView.latlong!="undefined"&&currentView.latlong.longitude!=null&&currentView.latlong.longitude!="undefined")return currentView.GetCenterLatLong().longitude;return null}function ComputeCenterPoint(a){currentView.latlong=currentMode.PixelToLatLong(currentView.center,currentView.zoomLevel);if(a)preferredView.Copy(currentView)}function GetLatitude(c){var b=new VEPixel(originX+offsetX+width/2,originY+offsetY+c),a=currentMode.PixelToLatLong(b,currentView.zoomLevel);if(!a)return null;return a.latitude}function GetLongitude(c){var b=new VEPixel(originX+offsetX+c,originY+offsetY+height/2),a=currentMode.PixelToLatLong(b,currentView.zoomLevel);if(!a)return null;return a.longitude}function GetY(b){var c=new Msn.VE.LatLong(b,currentView.center.longitude),a=LatLongToPixel(c);if(!a)return null;return MathRound(a.y)}function GetX(b){var c=new Msn.VE.LatLong(currentView.center.latitude,b),a=LatLongToPixel(c);if(!a)return null;return MathRound(a.x)}function LatLongToPixel(c,a){if(a==null||typeof a=="undefined")a=currentView.zoomLevel;var b=currentMode.LatLongToPixel(c,a);if(b!=null)if(currentMode!=threeDMode){b.x-=originX+offsetX;b.y-=originY+offsetY}return b}function LatLongToPixelAsync(c,a,d){if(a==null||typeof a=="undefined")a=currentView.zoomLevel;var b=function(a){if(a!=null&&typeof a!="undefined"&&currentMode!=threeDMode)for(var b=0;b<a.length;++b)if(a[b]!=null){a[b].x-=originX+offsetX;a[b].y-=originY+offsetY}d(a)};currentMode.LatLongToPixelAsync(c,a,b)}function PixelToLatLong(b,a){if(a==null||typeof a=="undefined")a=currentView.zoomLevel;var c=new VEPixel(b.x+originX+offsetX,b.y+originY+offsetY);return currentMode.PixelToLatLong(c,a)}function PixelToLatLongAsync(c,b,e){if(b==null||typeof b=="undefined")b=currentView.zoomLevel;var d=[];for(var a=0;a<c.length;++a)d[a]=new VEPixel(c[a].x+originX+offsetX,c[a].y+originY+offsetY);currentMode.PixelToLatLongAsync(d,b,e)}function GetZoomLevel(){return currentView.zoomLevel}function GetMapStyle(){return currentView.mapStyle}function GetMapMode(){var a=Msn.VE.MapActionMode.ModeUnknown;if(currentMode!=null)if(currentMode==threeDMode)a=Msn.VE.MapActionMode.Mode3D;else if(currentMode==orthoMode)a=Msn.VE.MapActionMode.Mode2D;else if(currentMode==obliqueMode)a=Msn.VE.MapActionMode.ModeOblique;return a}function GetMode(){var a=Msn.VE.MapActionMode.ModeUnknown;if(currentMode!=null)if(currentMode==threeDMode)a=Msn.VE.MapActionMode.Mode3D;else if(currentMode==orthoMode)a=Msn.VE.MapActionMode.Mode2D;else if(currentMode==obliqueMode)if(this.GetDashboard().GetMode()==1)a=Msn.VE.MapActionMode.Mode2D;else a=Msn.VE.MapActionMode.Mode3D;return a}function GetAltitude(){return currentView.GetAltitude()}function GetTilt(){return currentView.GetTilt()}function GetDirection(){return currentView.GetDirection()}function EnableMode(b,a){switch(b){case Msn.VE.MapActionMode.Mode3D:this._Enable3DMode(a);break;case Msn.VE.MapActionMode.Mode2D:default:this._Disable3DMode(a);UnHidePins()}}function _Enable3DMode(a){if(currentMode!=threeDMode&&currentMode!=null){VE_3DPhotoPluginObj=0;VE_3DGeoCommunityPluginObj=0;VE_3DStreetLevelGeometryObj=0;VE_3DWeatherPluginObj=0;VE_3DHiResModelsPluginObj=0;PluginEventRegistered=0;PhotoPluginEventRegistered=0;GeoCommunityPluginEventRegistered=0;StreetLevelGeometryEventRegistered=0;previousMode=currentMode;currentMode=threeDMode;this.Destroy2DOnly();if(typeof a!="undefined")init3dparam=a;this.Init3DOnly()}}function _Disable3DMode(a){if(currentMode==threeDMode&&currentMode!=null){previousMode=currentMode;currentMode=orthoMode;this.Destroy3DOnly();this.Init2DOnly(a)}}function ControlReady(){return IsModeEnabled(Msn.VE.MapActionMode.Mode2D)||IsModeEnabled(Msn.VE.MapActionMode.Mode3D)&&Get3DControl()!=null}function Get3DControl(){if(view3DCreated)return spacecontrol;return null}function IsModeEnabled(b){var a=currentMode!=null&&currentMode==threeDMode;switch(b){case Msn.VE.MapActionMode.Mode2D:return !a;break;case Msn.VE.MapActionMode.Mode3D:return a}return false}function Get3DVisibleArea(acceptRegionAroundCenter){if(!view3DCreated)return null;var lat1,lon1,lat2,lon2,lat3,lon3,lat4,lon4,aroundcenter,ret=spacecontrol.QueryRegion();eval(ret);if((acceptRegionAroundCenter=="undefined"||acceptRegionAroundCenter==false)&&aroundcenter==1)return null;var points=[];points.push(new Msn.VE.LatLong(lat1,lon1));points.push(new Msn.VE.LatLong(lat2,lon2));points.push(new Msn.VE.LatLong(lat3,lon3));points.push(new Msn.VE.LatLong(lat4,lon4));return points}function Show3DTraffic(a){if(view3DCreated)if(!traffic3dAdded||a){spacecontrol.AddImageSource("Terrain","Traffic",GetManifestUrl("http://go.microsoft.com/fwlink/?LinkID=98777"),1,.6);traffic3dAdded=true}}function Remove3DTraffic(){if(view3DCreated&&traffic3dAdded){spacecontrol.RemoveImageSource("Terrain","Traffic");traffic3dAdded=false}}function Show3DBirdseye(a,b){if(currentMode==threeDMode&&spacecontrol){ProcessPhotoPluginActionIn3D("PhotosEnabled","enabled="+(a?"1":"0")+";labels="+(b?"1":"0"),spacecontrol);p_this.Set3DPhotoPluginActive(a);p_this.UpdateCopyright()}}function Sync3dView(){if(spacecontrol&&spaceCameraIsFlying)spacecontrol.RaiseCameraChangedEvent()}function OnBeginCameraUpdate(){cameraUpdateCount++;spaceCameraIsFlying=true}function OnEndCameraUpdate(){spaceCameraIsFlying=false}function IsCameraFlying(){return spaceCameraIsFlying}function GetMetersPerPixel(b,a){if(!b)b=currentView.latlong.latitude;if(!a)a=currentView.zoomLevel;return Math.cos(DegToRad(b))*currentMode.MetersPerPixel(a)}function Fill(){var b=g(p_elSource).getStyle("width"),a=g(p_elSource).getStyle("height"),f=parseInt(b)-width,h=parseInt(a)-height;if(!/px$/.test(b))width=p_elSource.clientWidth||p_elSource.offsetWidth;else width=parseInt(b);if(!/px$/.test(a))height=p_elSource.clientHeight||p_elSource.offsetHeight;else height=parseInt(a);if(!panning)if(currentMode!=threeDMode){panning=true;var e=g(map).getComputedPosition(),c={x:e.x+f/2,y:e.y+h/2};offsetX=-c.x;offsetY=-c.y;var d=new VEPixel(width/2+originX+offsetX,height/2+originY+offsetY);currentView.SetCenter(d);preferredView.SetCenter(new VEPixel(d.x,d.y));window.setTimeout(tileLayerManager.PanView,1);g(map).slideToPoint(c,"quickly","MAP_SLIDE",function(){panning=false},Gimme.Animation.AccelerationLines.quickStartDecelerate)}else PanToView(currentView);if(resizeInProgress)resizeInProgress=false}function Resize(b,a){if(resizeTimer!=null&&typeof resizeTimer=="number")window.clearTimeout(resizeTimer);p_this.w=b;p_this.h=a;resizeTimer=window.setTimeout(p_this.FireResize,250)}this.FireResize=function(){if(resizeInProgress)return;else resizeInProgress=true;var b=p_this.w,a=p_this.h;if(!b||b<=0||!a||a<=0)Fill();else{p_elSource.style.width=b+"px";p_elSource.style.height=a+"px";UpdateFromParent();if(currentMode==null||currentMode!=threeDMode){if(b&&b>=0)width=b;if(a&&a>=0)height=a}PanToView(currentView)}if(copyright)copyright.Reposition();if(scaleBar)scaleBar.Reposition();if(mapLegend)mapLegend.Reposition();if(!document.all)p_this.resizeSVG();Fire("onresize")};function IsObliqueAvailable(){return obliqueMode?obliqueMode.IsAvailable():false}function GetObliqueScene(){return obliqueMode?obliqueMode.GetScene():null}function SetAnimationEnabled(a){animatedMovementEnabled=a}function IsAnimationEnabled(){return animatedMovementEnabled&&currentMode!=threeDMode}function SetObliqueScene(a){if(obliqueMode)SetMapStyle(obliqueStyle,a,null)}function SetObliqueLocation(f,c,d,e){if(obliqueMode){Sync3dView();var a=currentView.MakeCopy(),b;if(IsMapViewOblique())b=GetMapStyle();else b=p_htParams.labelsDefault?obliqueHybridStyle:obliqueStyle;a.SetMapStyle(b,null,c);a.SetZoomLevel(d);if(!Msn.VE.MapStyle.IsViewOblique(currentView.mapStyle)){Fire("onstartmapstyleoblique");lastOrthoZoomLevel=currentView.zoomLevel;lastOrthoMapStyle=currentView.mapStyle}a.SetCenterLatLong(f);a.callback=e;SetView(a)}}function SetObliqueOrientation(d,c,b){if(obliqueMode){var a;if(IsMapViewOblique())a=GetMapStyle();else a=p_htParams.labelsDefault?obliqueHybridStyle:obliqueStyle;SetMapStyle(a,null,d,c,b)}}function Debug(a){debug=a}function GetMapLegend(){return mapLegend}function SetFocus(){if(currentMode==threeDMode)spacecontrol.Focus();else keyboard.focus()}function StopKeyboardPan(){if(panning&&keyboardPan)StopContinuousPan()}function UpdatePreferredView(){preferredView.Copy(currentView)}function GetCenterOffset(){if(currentMode!=null&&currentMode==threeDMode)return new VEPixel(0,0);return mapCenterOffset}function SetCenterOffset(a){if(typeof a!="undefined"&&a!=null)mapCenterOffset=a}function GetLastViewChangeType(){var a=lastViewChangeType;lastViewChangeType=null;return a}function ShowNonIENotSupportedDialog(){Fire("onerror",CreateEvent(currentView.latlong,currentView.zoomLevel,L_BrowserNotSupported_Text.replace(/%1/g,'<a href="'+L_SupportedBrowserDownloadUrl_Text+'" target="_blank">').replace(/%3/g,L_SupportedBrowserDownloadUrl_Text).replace(/%2/g,"</a>")))}function DelayedHWDialog(){ShowMessage(L_NoHardwareAcceleration_Text)}function SetShowMapModeSwitch(a){if(dashboard&&dashboard.constructor==Msn.VE.NavAction)dashboard.SetShowMapModeSwitch(a)}function SetTilePixelBuffer(a){buffer=a<maxTilePixelBuffer?a:maxTilePixelBuffer}function SetClientToken(a){m_clientToken=a;if(tileLayerManager){tileLayerManager.SetClientToken(mapTiles,m_clientToken);tileLayerManager.SetClientToken(trafficTiles,m_clientToken)}if(minimapControl)minimapControl.SetClientToken(m_clientToken);if(obliqueMode)obliqueMode.SetClientToken(m_clientToken)}function GetTopPx(){if(typeof p_elSource!="undefined"&&p_elSource!=null)return g(p_elSource).getPagePosition().y;else return 0}function GetLeftPx(){if(typeof p_elSource!="undefined"&&p_elSource!=null)return g(p_elSource).getPagePosition().x;else return 0}function GetObliqueAvailability(b,a){if(obliqueMode)obliqueMode.GetObliqueAvailability(b,a);else if(typeof a=="function")a(false)}function GetMapSurface(){return map}this.CreateLegend=function(){if(!mapLegend){mapLegend=new MapLegend(p_elSource);mapLegend.Init();if(copyright)mapLegend.PinTo(copyright)}return mapLegend};function CalculateTileViewPort(a,b,d,c,e){return tileLayerManager.CalculateTileViewPort(a,b,d,c,e)}function GetCurrentTileViewPort(){return tileLayerManager.GetViewPort()}function SetPrintable(a){if(a){graphicCanvas.CreatePrintLayer(map,this,g(p_elSource).getStyle("width"),g(p_elSource).getStyle("height"));tileLayerManager.SetPrintable(true);graphicCanvas.AddLogo(logo.GetURL());g(p_elSource).addClass("MSVE_Printable_Map")}else{tileLayerManager.SetPrintable(false);graphicCanvas.RemovePrintLayer(this);g(p_elSource).removeClass("MSVE_Printable_Map")}}function IsMapViewOblique(){return Msn.VE.MapStyle.IsViewOblique(GetMapStyle())}function IsMapViewOrtho(){return Msn.VE.MapStyle.IsViewOrtho(GetMapStyle())}function GetTileGeneration(a){return generations[a]}function ClipView(b,c){var a=ShiftView(b,c,0,0);if(typeof a!="undefined"&&a!=null)b.SetCenter(new VEPixel(b.center.x+a.x,b.center.y+a.y))}function ShiftView(b,a,c,d){if(b!=null&&b.center!=null&&a!=null&&a!="undefined"){c=ClipDelta(c,width,b.center.x-width/2,b.zoomLevel,a.z1,a.x1,a.x2,b.mapStyle);d=ClipDelta(d,height,b.center.y-height/2,b.zoomLevel,a.z1,a.y1,a.y2,b.mapStyle);return new VEPixel(c,d)}}function ClipDelta(a,b,d,g,f,i,h){var c=tileSize*i*Math.pow(2,g-f),e=tileSize*h*Math.pow(2,g-f);if(IsMapViewOblique()){c-=Math.ceil(b/2);e+=Math.ceil(b/2)}if(b>e-c)a=(e-c-b)/2-d+c;else if(d+a<c)a=c-d;else if(d+b+a>e)a=e-d-b;return a}function VECopyrightTableEntry(b,a,e,f,c,d){this.MinZoomLevel=b;this.MaxZoomLevel=a;this.MinLatitude=e;this.MinLongitude=f;this.MaxLatitude=c;this.MaxLongitude=d}VECopyrightTableEntry.prototype.IsMatch=function(b,c,a){var d=false;if(b>=this.MinZoomLevel&&b<=this.MaxZoomLevel&&(c>=this.MinLatitude&&c<=this.MaxLatitude)&&(a>=this.MinLongitude&&a<=this.MaxLongitude))d=true;return d};function VECopyrightTable(){var L_MapControlImageCourtesyOfNAVTEQ_Text = '&copy; 2009 NAVTEQ';
var L_MapControlImageCourtesyOfAND_Text = '&copy; AND';
var L_MapControlImageCourtesyOfDigitalGlobe_Text = '&copy; 2009 DigitalGlobe';
var L_MapControlImageCourtesyOfNASA_Text = 'Image courtesy of NASA';
var L_MapControlImageCourtesyOfHarrisCorp_Text = '&copy; Harris Corp, Earthstar Geographics LLC';
var L_MapControlImageCourtesyOfUSGS_Text = 'Image courtesy of USGS';
var L_MapControlImageCourtesyOfGetmapping_Text = '&copy; Getmapping plc';
var L_MapControlImageCourtesyOfGeoEye_Text = '&copy; 2009 GeoEye';
var L_MapControlImageCourtesyOfPasco_Text = '&copy; 2009 Pasco';
var L_MapControlImageCourtesyOfIntergraph_Text = '&copy; GeoContent / (p) Intergraph';
var L_MapControlImageCourtesyOfTerraItaly_Text = '&copy; 2009 TerraItaly';
var L_MapControlImageCourtesyOfIntermap_Text = '&copy; 2009 Intermap';
var L_MapControlImageCourtesyOfIndianaMap_Text = 'Image courtesy of the IndianaMap';
var L_MapControlImageCourtesyOfStateOfNevada_Text = 'Image courtesy of the Nevada State Mapping Advisory Committee';
var L_MapControlImageCourtesyOfInterAtlas_Text = '&copy; 2009 InterAtlas';
var L_MapControlImageCourtesyOfEurosense_Text = '&copy; 2009 Eurosense';
var L_MapControlImageCourtesyOfIGP_Text = '&copy; 2009 IGP';
var L_MapControlImageCourtesyOfIGN_Text = '&copy; 2009 IGN';
var L_MapControlImageCourtesyOfBEV_Text = '&copy; 2009 BEV / (p) Intergraph';

var m_tableKeys = [];
m_tableKeys[Msn.VE.MapStyle.Road] = [ L_MapControlImageCourtesyOfNAVTEQ_Text, L_MapControlImageCourtesyOfAND_Text ];
m_tableKeys[Msn.VE.MapStyle.Aerial] = [ L_MapControlImageCourtesyOfDigitalGlobe_Text, L_MapControlImageCourtesyOfNASA_Text, L_MapControlImageCourtesyOfHarrisCorp_Text, L_MapControlImageCourtesyOfUSGS_Text, L_MapControlImageCourtesyOfGetmapping_Text, L_MapControlImageCourtesyOfGeoEye_Text, L_MapControlImageCourtesyOfPasco_Text, L_MapControlImageCourtesyOfIntergraph_Text, L_MapControlImageCourtesyOfTerraItaly_Text, L_MapControlImageCourtesyOfIntermap_Text, L_MapControlImageCourtesyOfIndianaMap_Text, L_MapControlImageCourtesyOfStateOfNevada_Text, L_MapControlImageCourtesyOfInterAtlas_Text, L_MapControlImageCourtesyOfEurosense_Text, L_MapControlImageCourtesyOfIGP_Text, L_MapControlImageCourtesyOfIGN_Text, L_MapControlImageCourtesyOfBEV_Text ];

var m_table = [];
m_table[Msn.VE.MapStyle.Road] = [];
m_table[Msn.VE.MapStyle.Road][L_MapControlImageCourtesyOfNAVTEQ_Text] = [];
m_table[Msn.VE.MapStyle.Road][L_MapControlImageCourtesyOfNAVTEQ_Text].push( new VECopyrightTableEntry( 1, 21, -90, -180, 90, 180) );
m_table[Msn.VE.MapStyle.Road][L_MapControlImageCourtesyOfAND_Text] = [];
m_table[Msn.VE.MapStyle.Road][L_MapControlImageCourtesyOfAND_Text].push( new VECopyrightTableEntry( 1, 21, -90, -180, 90, 180) );
m_table[Msn.VE.MapStyle.Aerial] = [];
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfDigitalGlobe_Text] = [];
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfDigitalGlobe_Text].push( new VECopyrightTableEntry( 14, 19, -67, -179.99, 27, 0) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfDigitalGlobe_Text].push( new VECopyrightTableEntry( 14, 19, 27, -179.99, 87, -126.5) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfDigitalGlobe_Text].push( new VECopyrightTableEntry( 14, 19, 48.4, -126.5, 87, -5.75) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfDigitalGlobe_Text].push( new VECopyrightTableEntry( 14, 19, -67, 28, 86.5, 179.99) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfDigitalGlobe_Text].push( new VECopyrightTableEntry( 14, 19, -67, 0, 37.8, 28) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfDigitalGlobe_Text].push( new VECopyrightTableEntry( 14, 19, 37.7, 18.5, 59.8, 28) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfDigitalGlobe_Text].push( new VECopyrightTableEntry( 14, 19, 43, -81.6, 48.4, -10) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfDigitalGlobe_Text].push( new VECopyrightTableEntry( 14, 19, 27, -70, 43, -10) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfDigitalGlobe_Text].push( new VECopyrightTableEntry( 14, 19, 27, -10, 35.8, 0) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfDigitalGlobe_Text].push( new VECopyrightTableEntry( 14, 19, 27, -120, 32.3, -105.8) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfDigitalGlobe_Text].push( new VECopyrightTableEntry( 14, 19, 43.4, 13.78, 54.9, 18.5) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfNASA_Text] = [];
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfNASA_Text].push( new VECopyrightTableEntry( 1, 8, -90, -180, 90, 180) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfHarrisCorp_Text] = [];
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfHarrisCorp_Text].push( new VECopyrightTableEntry( 9, 13, -90, -180, 90, 180) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfUSGS_Text] = [];
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfUSGS_Text].push( new VECopyrightTableEntry( 14, 17, 17.99, -150.11, 61.39, -65.57) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGetmapping_Text] = [];
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGetmapping_Text].push( new VECopyrightTableEntry( 14, 19, 49.94, -6.35, 58.71, 1.78) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text] = [];
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push( new VECopyrightTableEntry( 14, 19, 44.53, -63.75, 45.06, -63.45) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push( new VECopyrightTableEntry( 14, 19, 45.39, -73.78, 45.66, -73.4) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push( new VECopyrightTableEntry( 14, 19, 45.2, -75.92, 45.59, -75.55) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push( new VECopyrightTableEntry( 14, 19, 42.95, -79.81, 44.06, -79.42) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push( new VECopyrightTableEntry( 14, 19, 50.35, -114.26, 51.25, -113.82) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push( new VECopyrightTableEntry( 14, 19, 48.96, -123.33, 49.54, -122.97) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push( new VECopyrightTableEntry( 14, 19, -35.42, 138.32, -34.47, 139.07) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push( new VECopyrightTableEntry( 14, 19, -32.64, 115.58, -32.38, 115.85) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push( new VECopyrightTableEntry( 14, 19, -34.44, 150.17, -33.27, 151.49) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push( new VECopyrightTableEntry( 14, 19, -28.3, 152.62, -26.94, 153.64) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfPasco_Text] = [];
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfPasco_Text].push( new VECopyrightTableEntry( 14, 19, 23.5, 122.5, 46.65, 151.66) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIntergraph_Text] = [];
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIntergraph_Text].push( new VECopyrightTableEntry( 14, 19, 47, 5, 55.5, 16) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfTerraItaly_Text] = [];
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfTerraItaly_Text].push( new VECopyrightTableEntry( 14, 21, 43.15, 6.5, 47.15, 14) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfTerraItaly_Text].push( new VECopyrightTableEntry( 14, 21, 41.3, 9.9, 43.15, 16.4) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfTerraItaly_Text].push( new VECopyrightTableEntry( 14, 21, 36.5, 7.9, 41.3, 18.7) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIntermap_Text] = [];
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIntermap_Text].push( new VECopyrightTableEntry( 1, 21, 49, -11, 60, 2) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIndianaMap_Text] = [];
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIndianaMap_Text].push( new VECopyrightTableEntry( 14, 19, 37.7, -88.2, 41.9, -84.7) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfStateOfNevada_Text] = [];
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfStateOfNevada_Text].push( new VECopyrightTableEntry( 14, 19, 34.85, -120.2, 42.12, -113.91) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfInterAtlas_Text] = [];
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfInterAtlas_Text].push( new VECopyrightTableEntry( 14, 21, 48.37, 1.4, 49.28, 3.37) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfInterAtlas_Text].push( new VECopyrightTableEntry( 14, 19, 47.72, 1.67, 48.05, 2.18) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfInterAtlas_Text].push( new VECopyrightTableEntry( 14, 19, 45.55, 4.57, 45.95, 5.33) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfInterAtlas_Text].push( new VECopyrightTableEntry( 14, 19, 43.18, 4.92, 43.77, 5.82) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfEurosense_Text] = [];
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfEurosense_Text].push( new VECopyrightTableEntry( 14, 19, 51, 3, 53.65, 7.67) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfEurosense_Text].push( new VECopyrightTableEntry( 14, 19, 50.58, 5.42, 51, 5.47) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIGP_Text] = [];
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIGP_Text].push( new VECopyrightTableEntry( 14, 19, 36.88, -9.6, 42.27, -6) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIGN_Text] = [];
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIGN_Text].push( new VECopyrightTableEntry( 14, 19, 42, -5, 51.25, 8.5) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIGN_Text].push( new VECopyrightTableEntry( 14, 19, 41.25, 8.3, 43.1, 9.65) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIGN_Text].push( new VECopyrightTableEntry( 14, 19, 17.85, -63.17, 18.15, -62.77) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIGN_Text].push( new VECopyrightTableEntry( 14, 19, 15.75, -61.9, 16.55, -60.9) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIGN_Text].push( new VECopyrightTableEntry( 14, 19, 14.35, -61.25, 14.95, -60.75) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIGN_Text].push( new VECopyrightTableEntry( 14, 19, 2.25, -54.65, 6, -51.4) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIGN_Text].push( new VECopyrightTableEntry( 14, 19, -21.5, 55, -20.75, 56) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIGN_Text].push( new VECopyrightTableEntry( 14, 19, 46.7, -56.5, 47.2, -56.1) );
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfBEV_Text] = [];
m_table[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfBEV_Text].push( new VECopyrightTableEntry( 14, 19, 46.25, 9.4, 49.2, 17.3) );

;this.CreditsFor=function(a,i,j,h){var e=[];if(a!="undefined"&&a!=null&&typeof m_tableKeys[a]!="undefined"&&m_tableKeys[a]!=null){var k=m_tableKeys[a].length;for(var c=0;c<k;++c){var f=m_tableKeys[a][c],d=m_table[a][f],g=d.length;for(var b=0;b<g;++b)if(d[b].IsMatch(i,j,h)){e.push(f);break}}}return e};this.CreditsForView=function(a){var b=[];b.push(L_MapCopyrightMicrosoft);if(a.mapStyle==Msn.VE.MapStyle.Hybrid){b=b.concat(this.CreditsFor(Msn.VE.MapStyle.Road,a.zoomLevel,a.latlong.latitude,a.latlong.longitude));b=b.concat(this.CreditsFor(Msn.VE.MapStyle.Aerial,a.zoomLevel,a.latlong.latitude,a.latlong.longitude))}else if(a.mapStyle==Msn.VE.MapStyle.ObliqueHybrid){b=b.concat(this.CreditsFor(Msn.VE.MapStyle.Road,17,a.latlong.latitude,a.latlong.longitude));b=b.concat(this.CreditsFor(Msn.VE.MapStyle.Oblique,a.zoomLevel,a.latlong.latitude,a.latlong.longitude))}else b=b.concat(this.CreditsFor(a.mapStyle,a.zoomLevel,a.latlong.latitude,a.latlong.longitude));if(view3DCreated&&a.mapStyle!=Msn.VE.MapStyle.Oblique&&photoplugin3dActive)b=b.concat(this.CreditsFor(Msn.VE.MapStyle.Oblique,a.zoomLevel,a.latlong.latitude,a.latlong.longitude));if(typeof VE_TrafficManager!=="undefined")if(VE_TrafficManager.turnedOn&&L_MapCopyrightTraffic!=""){var d=false;if(L_MapControlImageCourtesyOfNAVTEQ_Text)for(var c=0;c<b.length;c++)if(b[c]==L_MapControlImageCourtesyOfNAVTEQ_Text){d=true;b.splice(c+1,0,L_MapCopyrightTraffic);break}if(!d)b.push(L_MapCopyrightTraffic)}return b}}var g_sVECopyrightTable=new VECopyrightTable;function Copyright(f){var d=document.createElement("div"),a=document.createElement("div"),c=null,b=null;this.Show=function(){f.appendChild(d);f.appendChild(a)};this.Hide=function(){try{f.removeChild(d);f.removeChild(a)}catch(b){}};this.Init=function(){d.className="MSVE_Copyright MSVE_CopyrightBackground";a.className="MSVE_Copyright MSVE_CopyrightForeground";e();this.Show()};this.Destroy=function(){this.Hide();c=null;b=null;d=a=null};function e(){var e=0;if(c&&c.style.display!=="none"){var h=parseInt(g(c).getStyle("height")),f=parseInt(c.style.bottom);e+=(isNaN(h)?0:h)+(isNaN(f)?0:f)}d.style.bottom=e+"px";a.style.bottom=e+1+"px";if(b)window.setTimeout(b.Reposition,1)}function j(){var g=g_sVECopyrightTable.CreditsForView(currentView),c="",f="";for(var b=0;b<g.length;++b){if(b>0)if(b==2)c+="\n";else c+="  ";f+="<span>"+g[b]+"</span> ";c+=g[b]}if(view3DCreated)spacecontrol.SetCopyrightString(c);d.innerHTML=f;a.innerHTML=f;e()}function i(){e()}function k(c){b=c;if(b)b.SetPinElement(a)}function h(a){c=a;e()}this.Reposition=e;this.Update=j;this.SetOffset=i;this.PinTo=k;this.SetPinElement=h}function MapEvent(f,d,e,a,c,b,g){this.view=f;this.oblique=d;this.error=e;this.requestedView=a;this.elementID=c;this.mouseButton=b;this.e=g}function CreateEvent(b,f,c,d,e,n,g,h){var a=currentView.MakeCopy();if(b!=null&&b instanceof Msn.VE.LatLong){if(Msn.VE.API!=null){var m=new VELatLongFactory(new VELatLongFactorySpecFromMapView(a));a.LatLong=m.CreateVELatLong(b.latitude,b.longitude);a.latlong=b}else a.latlong=b;if(typeof g!="undefined"&&g!=null)a.altitude=parseFloat(g);else a.altitude=0}if(f!=null&&typeof f=="number")a.zoomLevel=f;if(c==null||typeof c=="undefined")c="";var j=null;if(obliqueMode)j=obliqueMode.GetEventInfo();var i=null;if(d!=null&&d instanceof Msn.VE.MapView)i=d.MakeCopy();var k=null;if(typeof e!="undefined"&&e!=null)k=e;var l=null;if(typeof h!="undefined"&&h!=null)l=h;return new MapEvent(a,j,c,i,k,n,l)}function CreateCustomEvent(h,b,d){var a=new MapEvent;if(d)a.error=d.error;a.eventName=h;a.zoomLevel=currentView.zoomLevel;a.mapStyle=currentView.mapStyle;if(currentMode!=threeDMode){a.birdseyeSceneID=currentView.sceneId;a.birdseyeSceneOrientation=currentView.sceneOrientation;if(b){a.leftMouseButton=IsLeftMouseButton(b);a.rightMouseButton=IsRightMouseButton(b);a.middleMouseButton=IsMiddleMouseButton(b);a.mouseWheelChange=GetMouseScrollDelta(b);a.screenX=b.screenX;a.screenY=b.screenY;var e=Gimme.Screen.getMousePosition(b);a.clientX=e.x;a.clientY=e.y;var f=g(p_elSource).getPagePosition();a.mapX=a.clientX-f.x;a.mapY=a.clientY-f.y;a.keyCode=b.keyCode;a.altKey=b.altKey;a.ctrlKey=b.ctrlKey;a.shiftKey=b.shiftKey;a.elementID=null;var c=GetTarget(b);while(typeof c!="undefined"&&c!=null)if(typeof c.id!="undefined"&&c.id!=null&&c.id.indexOf(MC_IID_NAMESPACE)==0&&c.tagName!="CANVAS"){a.elementID=c.id;break}else if(typeof c.className!="undefined"&&c.className!=null&&c.className=="MSVE_MapContainer")break;else c=c.parentElement}}else if(d){if(d.view)a.latLong=d.view.LatLong;else a.latLong=null;a.elementID=d.elementID;a.leftMouseButton=d.mouseButton=="Left";a.rightMouseButton=d.mouseButton=="Right";a.middleMouseButton=d.mouseButton=="Middle";a.mouseWheelChange=0;a.keyCode=0;a.altKey=false;a.ctrlKey=false;a.shiftKey=false}return a}function AttachEvent(d,c){var a=defaultEventTable[d];if(!a){a=[];defaultEventTable[d]=a}for(var b=0;b<a.length;b++)if(a[b]==c)return true;a.push(c)}function DetachEvent(d,c){var a=defaultEventTable[d];if(!a)return;for(var b=0;b<a.length;b++)if(a[b]==c)a.splice(b,1)}function AttachCustomEvent(d,c){var a=customEventTable[d];if(!a){a=[];customEventTable[d]=a}for(var b=0;b<a.length;b++)if(a[b]==c)return true;a.push(c)}function DetachCustomEvent(d,c){var a=customEventTable[d];if(a)for(var b=0;b<a.length;b++)if(a[b]==c)a.splice(b,1)}function IsEventAttached(a){var b=customEventTable[a],c=defaultEventTable[a];return c!=null||b!=null}function Fire(b,a){FireCustomEvent(b,a);FireDefaultEvent(b,a)}function FireDefaultEvent(d,b){var a=defaultEventTable[d];if(!b)b=CreateEvent();if(a)for(var c=0;c<a.length;c++)a[c](b)}var currentShapeID=null;function FireCustomEvent(d,a){var b=false,c=customEventTable[d];if(c){if(a&&a instanceof MapEvent){var f=window.event;a=CreateCustomEvent(d,f,a)}else a=CreateCustomEvent(d,a,null);for(var e=0;e<c.length;e++)b=b|c[e](a)}return b}function DisposeAllCustomEvent(){while(customEventTable.length){var a=customEventTable.pop();while(a.length)a.pop();a=null}}function DestroyEventTable(){while(defaultEventTable.length){var a=defaultEventTable.pop();while(a.length)a.pop();a=null}defaultEventTable=null;DisposeAllCustomEvent();customEventTable=null}function KeyDown(c){if(isMinimap)return false;c=GetEvent(c);if(FireCustomEvent("onkeydown",c))return false;var e=c.ctrlKey?5:1,d=keyboardPanSpeed*e,a=panningX,b=panningY;switch(c.keyCode){case 9:case 17:case 18:if(panning&&keyboardPan)StopContinuousPan();return true;case 37:a=-d;break;case 38:b=-d;break;case 39:a=d;break;case 40:b=d;break;case 107:case 187:case 61:case 43:a=0;b=0;ZoomIn();$VE_A.Log($VE_A.PgName.Map,"Zoom in","Keyboard");break;case 109:case 189:a=0;b=0;ZoomOut();$VE_A.Log($VE_A.PgName.Map,"Zoom out","Keyboard");break;case 65:if($MVEM.IsEnabled(MapControl.Features.MapStyle.Aerial)){a=0;b=0;SetMapStyle(aerialStyle);$VE_A.Log($VE_A.PgName.Map,"MapStyleAerial","Keyboard")}break;case 72:if($MVEM.IsEnabled(MapControl.Features.MapStyle.Hybrid)){a=0;b=0;SetMapStyle(hybridStyle);$VE_A.Log($VE_A.PgName.Map,"MapStyleHybrid","Keyboard")}break;case 82:if($MVEM.IsEnabled(MapControl.Features.MapStyle.Road)){a=0;b=0;SetMapStyle(roadStyle);$VE_A.Log($VE_A.PgName.Map,"MapStyleRoad","Keyboard")}break;case 66:if($MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye))if(obliqueMode&&obliqueMode.IsAvailable()){a=0;b=0;SetMapStyle(obliqueHybridStyle);$VE_A.Log($VE_A.PgName.Map,"MapStyleObliqueHybrid","Keyboard")}break;case 79:if($MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye))if(obliqueMode&&obliqueMode.IsAvailable()){a=0;b=0;SetMapStyle(obliqueStyle);$VE_A.Log($VE_A.PgName.Map,"MapStyleOblique","Keyboard")}break;case 51:case 99:if($MVEM.IsEnabled(MapControl.Features.MapStyle.View3D)){p_this.EnableMode(Msn.VE.MapActionMode.Mode3D);$VE_A.Log($VE_A.PgName.Map,"Mode3D","Keyboard")}}if(a||b)ContinuousPan(a,b,null,true);FireDefaultEvent("onkeydown");return false}function KeyUp(a){a=GetEvent(a);if(FireCustomEvent("onkeyup",a))return false;var b=panningX,c=panningY,d=true;switch(a.keyCode){case 37:b=0;break;case 38:c=0;break;case 39:b=0;break;case 40:c=0;break;default:d=false}if(d){ContinuousPan(b,c,null,true);$VE_A.Log($VE_A.PgName.Map,"Pan","Keyboard")}if(FireCustomEvent("onkeypress",a))return false}var northLatitude=0,southLatitude=0,westLongitude=0,eastLongitude=0;function AddLine(h,f,g,l,n,m,a,d,i,k,j){if(h==null||f==null||g==null||a==null||d==null)return null;var e=[];for(var b=0;b<a.length;b++)e.push(BuildRegionHeap(a[b],0,a[b].length-1));var c=new Line;c.Init(h,f,g,l,n,m,e,d,i,k,j);lines.push(c);return c}function RemoveLine(c){for(var a=0;a<lines.length;a++){var b=lines[a];if(b.id==c){lines.splice(a,1);b.Destroy();return}}}function ClearLines(){while(lines.length>0)lines.pop().Destroy()}function ShowLines(){graphicCanvas.Clear();for(var a=0;a<lines.length;a++){lines[a].StartLine();lines[a].Show()}}function HideLines(){for(var a=0;a<lines.length;a++){lines[a].Hide();lines[a].RemoveFromMap()}}function UpdateLines(){if(typeof graphicCanvas==="object"&&graphicCanvas!==null)graphicCanvas.Clear();if(!document.all)currentView.GetMap().resetSvgLayer();for(var a=0;a<lines.length;a++)lines[a].UpdateLine()}function BuildRegionHeap(f,e,g){var h=g-e+1;if(h<1)return null;else if(h==1)return f[e];var d=null,c=null;if(h==2){d=f[e];c=f[g]}else{var i=Math.round((e+g)/2);d=BuildRegionHeap(f,e,i);c=BuildRegionHeap(f,i+1,g)}if(d!=null&&c!=null){var b=d.boundingRectangle,a=c.boundingRectangle,l=b[0].latitude>a[0].latitude?b[0].latitude:a[0].latitude,k=b[0].longitude>a[0].longitude?b[0].longitude:a[0].longitude,m=b[1].latitude<a[1].latitude?b[1].latitude:a[1].latitude,n=b[1].longitude<a[1].longitude?b[1].longitude:a[1].longitude,j=[new Msn.VE.LatLong(l,k),new Msn.VE.LatLong(m,n)];return new Msn.VE.LineRegion(j,null,[d,c])}else if(d!=null)return d;else if(c!=null)return c;return null}var IsDrivingEventAttached=false;function Line(){var t=5,v=new Msn.Drawing.Color(0,169,235,.7),w="Solid",d=new Msn.Drawing.Stroke,H=4,c=null,e="",f=true,A="",i="",r=0,y=0,x=0,B=0,z=0,a=null,b=null,h=null,g=null,I=0,J=0,n=false;function F(m,u,C,c,j,k,p,s,l,f,o){if(!c)c=t;if(!j)j=v;if(!k)k=defaultZIndex;if(!f)f=w;n=o;this.id=m;e=m;if(l)d.linejoin=l;A=c+"pt";i=j;r=k;a=u;b=C;g=s;h=p;y=a[0];x=b[0];B=a[a.length-1];z=b[b.length-1];d.color=i;d.width=c;d.linecap=f;q();if(!IsDrivingEventAttached){AttachEvent("onstartzoom",HideLines);AttachEvent("onchangeview",UpdateLines);IsDrivingEventAttached=true}this._Draw3D();AttachEvent("oninitmode",this._Draw3D)}function E(){if(view3DCreated)spacecontrol.DeleteGeometry(0,e);DetachEvent("oninitmode",this._Draw3D);m();a=b=h=c=null}this._Draw3D=function(){if(view3DCreated){var c=[];for(var f=0;f<a.length;f++){c.push(b[f]);c.push(",");c.push(a[f]);if(f!=a.length-1)c.push(" ")}var g=c.join("");spacecontrol.AddPolyline("0",e,g,i.ToHexString(),.75,d.width)}};function m(){if(graphicCanvas)graphicCanvas.Clear()}function G(){if(!f){j();return}if(c)c.style.display="block"}function j(){if(c)c.style.display="none"}function u(a){f=a;if(!f)j()}function q(){l();o()}function D(){l();o()}function l(){var a=height<900?900:height,b=width<900?900:width;northLatitude=GetLatitude(-0.5*a);southLatitude=GetLatitude(1.5*a);westLongitude=GetLongitude(-0.5*b);eastLongitude=GetLongitude(1.5*b)}function o(){if(Msn.VE.MapStyle.IsViewOblique(currentView.mapStyle)){graphicCanvas.Clear();return}if(view3DCreated)return;var b=[],a=g.length-1;while(g[a]<currentView.zoomLevel&&a>=0)a--;k(h[a],b);C(b)}function k(f,c){if(s(f.boundingRectangle[0],f.boundingRectangle[1]))return;if(f.childRegions!=null)for(var j=0;j<f.childRegions.length;j++)k(f.childRegions[j],c);else{var h=f.indices,e=new Msn.VE.LatLong(a[h[0]],b[h[0]]),d,g=false;if(p(e.latitude,e.longitude)){c.push(e.longitude);c.push(e.latitude);g=true}for(var i=1;i<h.length;i++){d=new Msn.VE.LatLong(a[h[i]],b[h[i]]);if(p(d.latitude,d.longitude)){if(!g){c.push(e.longitude);c.push(e.latitude)}g=true;c.push(d.longitude);c.push(d.latitude)}else if(g){g=false;c.push(d.longitude);c.push(d.latitude)}e=d}}}function C(g){if(!graphicCanvas)return;var a=new Msn.Drawing.PolyLine(g);a.id=e;var b=VE_LatLongThreshold.UseThreshold;VE_LatLongThreshold.UseThreshold=false;graphicCanvas.SetZIndex(r);graphicCanvas.SetStroke(d);graphicCanvas.DrawPrimitive(a,n);VE_LatLongThreshold.UseThreshold=b;c=$ID(e);if(f)c.style.display="block";else c.style.display="none"}function p(a,b){return a>=southLatitude&&a<=northLatitude&&b>=westLongitude&&b<=eastLongitude}function s(a,b){return a.latitude>northLatitude&&b.latitude>northLatitude||a.latitude<southLatitude&&b.latitude<southLatitude||a.longitude>eastLongitude&&b.longitude>eastLongitude||a.longitude<westLongitude&&b.longitude<westLongitude}this.Init=F;this.Destroy=E;this.RemoveFromMap=m;this.Show=G;this.Hide=j;this.ChangeVisibility=u;this.StartLine=q;this.UpdateLine=D}function Logo(b){var a=null;this.Init=function(){if(navigator.userAgent.toLowerCase().indexOf("msie")!=-1){a=document.createElement("div");a.className="MSVE_PoweredByLogo MSVE_PoweredByLogo_ie";if(Msn.VE.API!=null)a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+Msn.VE.API.Globals.vecurrentdomain+"/i/bin/"+Msn.VE.API.Globals.vecurrentversion+"/"+MapControl.Features.Image.PoweredLogo+"', sizingMethod='scale')"}else{a=document.createElement("img");a.src=this.GetURL();a.className="MSVE_PoweredByLogo"}b.appendChild(a)};this.GetURL=function(){var c=location.pathname.lastIndexOf("/"),d=location.pathname.substring(0,c+1),b="http://"+location.host+d,a="";if(Msn.VE.API!=null){b=Msn.VE.API.Globals.vecurrentdomain+"/";a=Msn.VE.API.Globals.vecurrentversion}else a=window.buildVersion;return b+"i/bin/"+a+"/"+MapControl.Features.Image.PoweredLogo};this.Destroy=function(){b.removeChild(a);a=null}}var hijackMouseMove=false,hijackMouseCursor=false,isLastButtonMiddle=false;function MouseDown(a){a=GetEvent(a);CancelEvent(a);if(currentMode!=threeDMode&&FireCustomEvent("onmousedown",a))return false;if(zooming)return false;if(panning)StopContinuousPan();if(obliqueMode)obliqueMode.CancelRequest();if(!mouseZoomDisabled)if(a.which&&a.which==2)currentTool=boxTool;else if(!a.which&&a.button&&a.button==4)currentTool=boxTool;else if(a.ctrlKey|a.altKey)currentTool=boxTool;if(!document.all&&!isEnablingDefaultDblClick)isEnablingDefaultDblClick=true;dragging=true;var b=typeof a.which!="undefined"?a.which:a.button;if(!hijackMouseMove&&!hijackMouseCursor&&b==1)p_this.SetCursor(cssCursors.Grabbing);if(currentTool)currentTool.OnMouseDown(a);return false}var lastmouseX=0,lastmouseY=0;function MouseMove(a){a=GetEvent(a);var b=Gimme.Screen.getMousePosition(a);lastmouseX=b.x;lastmouseY=b.y;if(currentMode!=threeDMode&&FireCustomEvent("onmousemove",a))return false;if(hijackMouseMove){a=GetEvent(a);CancelEvent(a);var c=g(p_elSource).getPagePosition();x=c.x;y=c.y;var e=originX+offsetX+lastmouseX-x,f=originY+offsetY+lastmouseY-y,d=CreateEvent(currentMode.PixelToLatLong(new VEPixel(e,f),currentView.zoomLevel));FireDefaultEvent("onmousemove",d);return}if(currentTool&&dragging)currentTool.OnMouseMove(a);return false}function MouseUp(a){a=GetEvent(a);CancelEvent(a);if(a)isLastButtonMiddle=IsMiddleMouseButton(a);if(currentMode!=threeDMode&&FireCustomEvent("onmouseup",a))return false;dragging=false;if(!hijackMouseMove&&!hijackMouseCursor)p_this.SetCursor(cssCursors.Grab);var b;if(currentTool)b=currentTool.OnMouseUp(a);if(targetTool&&targetTool.isOutOfBounds())targetTool.OnMouseUp(a);var c=true;if(typeof b!="undefined"&&b.view!=null){isEnablingDefaultDblClick=b.view.disableDbClick!=true;c=b.view.disableMapFocus!=true}else isEnablingDefaultDblClick=true;currentTool=panTool;try{if(c)keyboard.focus()}catch(d){}return false}function IsOnscreen(c,d){var b=tileSize*Math.pow(2,currentView.zoomLevel),a=originX+offsetX+c-x;if(a<0||a>b)return false;a=originY+offsetY+d-y;if(a<0||a>b)return false;return true}var isEnablingDefaultDblClick=true;function MouseDoubleClick(a){a=GetEvent(a);CancelEvent(a);var b=Gimme.Screen.getMousePosition(a);if(currentMode!=threeDMode&&FireCustomEvent("ondoubleclick",a))return false;if(hijackMouseMove)return false;if(isEnablingDefaultDblClick){UpdateFromParent();if(panning||zooming||mouseZoomDisabled)return false;if(!IsMapViewOblique()&&!IsOnscreen(b.x,b.y))return false;var c=preferredView.MakeCopy();c.SetCenter(new VEPixel(originX+offsetX+b.x-x-mapCenterOffset.x,originY+offsetY+b.y-y-mapCenterOffset.y));if(a.ctrlKey|a.altKey){c.SetZoomLevel(currentView.zoomLevel-1);$VE_A.Log($VE_A.PgName.Map,"Zoom out","Mouse")}else{c.SetZoomLevel(currentView.zoomLevel+1);$VE_A.Log($VE_A.PgName.Map,"Zoom in","Mouse")}SetView(c);return false}else isEnablingDefausltDblClick=true}function MouseWheel(a){a=GetEvent(a);CancelEvent(a);if(currentMode!=threeDMode&&FireCustomEvent("onmousewheel",a))return false;if(currentMode!=null&&currentMode==threeDMode)return false;if(panning||zooming||mouseZoomDisabled)return false;var g=GetMouseScrollDelta(a);if(g===0)return false;var c=g>0;if(mousewheelZoomToCenter||IsMapViewOblique()||!IsOnscreen(lastmouseX,lastmouseY))if(c){ZoomIn();$VE_A.Log($VE_A.PgName.Map,"Zoom in","Mouse")}else{ZoomOut();$VE_A.Log($VE_A.PgName.Map,"Zoom out","Mouse")}else{var b=c?currentView.zoomLevel+1:currentView.zoomLevel-1;if(b<=GetCurrentViewMaxZoomLevel(currentView)){UpdateFromParent();var h=lastmouseX-x,i=lastmouseY-y,e=originX+offsetX+h,f=originY+offsetY+i,d=preferredView.MakeCopy();e=currentView.ScaleCoord(e,b);f=currentView.ScaleCoord(f,b);d.SetZoomLevel(b);if(c)$VE_A.Log($VE_A.PgName.Map,"Zoom in","Mouse");else $VE_A.Log($VE_A.PgName.Map,"Zoom out","Mouse");d.SetCenter(new VEPixel(e-h+width/2,f-i+height/2));SetView(d)}}return false}function ContextMenu(a){if(mouseZoomDisabled)return false;a=GetEvent(a);CancelEvent(a);if(currentMode!=threeDMode&&FireCustomEvent("onclick",a))return false;var e=g(p_elSource).getPagePosition();x=e.x;y=e.y;var c,d,b=Gimme.Screen.getMousePosition(a);if(currentMode==threeDMode){c=b.x-x;d=b.y-y}else{c=originX+offsetX+b.x-x;d=originY+offsetY+b.y-y}var f=currentMode.PixelToLatLong(new VEPixel(c,d),currentView.zoomLevel);if(f!=null){if(currentMode==threeDMode&&Get3DControl().UIHasFocus())return false;var h=CreateEvent(f);FireDefaultEvent("oncontextmenu",h)}return false}function MouseClick(a){a=GetEvent(a);CancelEvent(a);if(!isLastButtonMiddle)if(currentMode!=threeDMode&&FireCustomEvent("onclick",a))return false}function MouseOut(a){a=GetEvent(a);if(currentMode!=threeDMode&&g(GetTarget(a)).hasClass("MSVE_Shape")&&FireCustomEvent("onmouseout",a)){CancelEvent(a);return false}}function MouseOver(a){a=GetEvent(a);if(currentMode!=threeDMode&&g(GetTarget(a)).hasClass("MSVE_Shape")&&FireCustomEvent("onmouseover",a)){CancelEvent(a);return false}}function MouseEnter(a){a=GetEvent(a);var b=a.relatedTarget||a.fromElement;if(currentMode!=threeDMode&&b!=null&&FireCustomEvent("onmouseover",a)){CancelEvent(a);return false}if(!hijackMouseMove&&!hijackMouseCursor)p_this.SetCursor(cssCursors.Grab)}function MouseLeave(a){a=GetEvent(a);if(currentMode!=threeDMode&&FireCustomEvent("onmouseout",a)){CancelEvent(a);return false}}var obliqueLoop=0,panningTargetPixel=null,panningCurrentPixel=null;function PanMap(c,d){if(c==0&&d==0||isNaN(c)||isNaN(d))return false;if(currentMode!=threeDMode){var a=ShiftView(currentView,currentBounds,c,d);if(typeof a!="undefined"&&a!=null){var f=g(map).getComputedPosition(),e=f.x-a.x,h=f.y-a.y;map.style.left=e+"px";map.style.top=h+"px";offsetX=-e;offsetY=-h;var b=new VEPixel(width/2+originX+offsetX,height/2+originY+offsetY);if(keyboardPan&&(c!=0&&a.x==0||d!=0&&a.y==0)){if(typeof currentMode.RequestPending!="undefined"&&!currentMode.RequestPending()){b.x+=c;b.y+=d;var i=PixelToLatLong(b);targetTool.centeringTrigger=true;SetCenter(i.latitude,i.longitude)}}else{currentView.SetCenter(b);preferredView.SetCenter(new VEPixel(b.x,b.y));tileLayerManager.PanView()}Fire("onpan")}}else return false;if(copyright)copyright.Update();return true}function ContinuousPan(a,b,c,d){if(zooming)return;if(!c)c=-1;panningX=a;panningY=b;panCounter=c;if(!a&&!b){StopContinuousPan();return}keyboardPan=d;if(view3DCreated){spacecontrol.ContinuousPan(a,b);Fire("onstartpan")}else if(!panning){panning=true;StepPan();Fire("onstartpan")}}function StepPan(){if(panning){var a=panningX,b=panningY;if(panningCurrentPixel!=null&&panningTargetPixel!=null){var c=panningTargetPixel.x-panningCurrentPixel.x;if(Math.abs(c)<Math.abs(a))a=c;var d=panningTargetPixel.y-panningCurrentPixel.y;if(Math.abs(d)<Math.abs(b))b=d;panningCurrentPixel.x+=a;panningCurrentPixel.y+=b}PanMap(a,b);if(panCounter>0)panCounter--;if(panCounter!=0&&(panningCurrentPixel==null||panningTargetPixel==null||panningTargetPixel.x!=panningCurrentPixel.x||panningTargetPixel.y!=panningCurrentPixel.y))window.setTimeout(StepPan,10);else StopContinuousPan()}}function StopContinuousPan(){panningX=0;panningY=0;panningTargetPixel=null;panningCurrentPixel=null;panning=false;keyboardPan=false;if(currentMode!=threeDMode)if(panLatitude!=null&&panLongitude!=null){var b=new Msn.VE.LatLong(panLatitude,panLongitude),a=LatLongToPixel(b),c=a.x-width/2,d=a.y-height/2;PanMap(c,d);currentView.latlong.latitude=panLatitude;currentView.latlong.longitude=panLongitude;preferredView.Copy(currentView);panLatitude=null;panLongitude=null;if(obliqueMode)obliqueMode.UpdateAvailability()}else ComputeCenterPoint(true);else if(view3DCreated)spacecontrol.ContinuousPan(0,0);Fire("onendpan");Fire("onchangeview");if(resizeInProgress)resizeInProgress=false}function PanToLatLong(b,a,c){if(currentMode==threeDMode)SetCenter(b,a);else{panLatitude=b;panLongitude=a;if(Msn.VE.MapStyle.IsViewOblique(currentView.mapStyle)&&PanInOblique(new Msn.VE.LatLong(b,a),null,c));else PanToPixel(LatLongToPixel(new Msn.VE.LatLong(b,a)),c)}}function PanByPixel(a,b){a.x=width/2+a.x;a.y=height/2+a.y;PanToPixel(a,b)}function PanToView(a){var b=a.center.x-(originX+offsetX),c=a.center.y-(originY+offsetY);PanToPixel(new VEPixel(b,c))}function PanToPixel(a,e){if(Msn.VE.MapStyle.IsViewOblique(currentView.mapStyle)&&PanInOblique(null,a,e))return;var b=a.x-width/2,c=a.y-height/2;panningTargetPixel=a;panningCurrentPixel=new VEPixel(width/2,height/2);var d=Math.sqrt(b*b+c*c);if(!e&&(!IsAnimationEnabled()||MathAbs(b)>2*width||MathAbs(c)>2*height||d>1.5*Math.sqrt(width*width+height*height))){var h=preferredView.MakeCopy(),j=a.x+(originX+offsetX),k=a.y+(originY+offsetY);h.SetCenter(new VEPixel(j,k));SetView(h);if(resizeInProgress)resizeInProgress=false;return}var f=Math.atan2(c,b),i=MathCeil(d/panToLatLongSpeed),g=MathRound(d/i);b=MathRound(Math.cos(f)*g);c=MathRound(Math.sin(f)*g);ContinuousPan(b,c)}function PanInOblique(a,d){obliqueLoop++;if(obliqueLoop>30){obliqueLoop=0;return false}var c=obliqueMode.GetScene();if(!a)a=PixelToLatLong(d);if(!c||!c.ContainsLatLong(a,currentView.zoomLevel)){var b=preferredView.MakeCopy();b.sceneId=null;b.SetCenterLatLong(a);SetView(b);if(resizeInProgress)resizeInProgress=false;return true}else return false}function PushPinOffset(a,b){this.x=a;this.y=b}function getPushPinOffset(c){var a=Msn.VE.PushPinTypes,b;switch(c){case a.Annotation:b=new PushPinOffset(-2,-29/2-5);break;case a.Overlay:case a.SearchResultPrecise:case a.SearchResultNonprecise:case a.Collection:case a.AdSponsor:b=new PushPinOffset(0,-29/2+3);break;case a.Direction:b=new PushPinOffset(-3,-26/2-3);break;case a.DirectionTemp:b=new PushPinOffset(2,-26/2+3);break;case a.TrafficLight:b=new PushPinOffset(0,-26/2);break;case a.TrafficOthers:b=new PushPinOffset(0,-29/2);break;case a.YouAreHere:b=new PushPinOffset(0,-26/2);break;case a.AdStandard:b=new PushPinOffset(0,-42/2+2);break;case a.AdWide:b=new PushPinOffset(0,-27/2);break;case a.AdCategory:b=new PushPinOffset(0,-16/2);break;case a.Default:default:b=new PushPinOffset(0,0)}return b}function GetPushpins(){return pushpins}function AddPushpin(m,k,l,j,h,e,f,i,g,b,c,d){var a=new Pushpin;a.Init(m,k,l,j,h,e,f,i,g,d);if(typeof b=="undefined"||b==false||b==null){if(IsModeEnabled(Msn.VE.MapActionMode.Mode3D)){if(!(typeof c!="undefined"&&c==false))View3DAddPushpin(a);map.appendChild(a.pin);a.Hide()}else map.appendChild(a.pin);pushpins.push(a)}return a.pin}function GetPushpinIndex(b){for(var a=0;a<pushpins.length;a++)if(pushpins[a].id==b)return a;return -1}function RemovePushpin(b){var a=GetPushpinIndex(b);if(a>=0){var c=pushpins[a];pushpins.splice(a,1);if(IsModeEnabled(Msn.VE.MapActionMode.Mode3D))View3DRemovePushpin(b);c.Destroy()}}function ClearPushpins(){while(pushpins.length>0){var a=pushpins.pop();if(IsModeEnabled(Msn.VE.MapActionMode.Mode3D))View3DRemovePushpin(a.id);a.Destroy()}}function Relay3DPushpins(){for(var b=0;b<pushpins.length;b++){var a=pushpins[b];if(a.id&&a.id.constructor==String&&a.id.indexOf("Layer")==-1)View3DAddPushpin(a)}}function NeedToPlaceAccurately(a){switch(a.pinType){case Msn.VE.PushPinTypes.SearchResultPrecise:case Msn.VE.PushPinTypes.AdStandard:case Msn.VE.PushPinTypes.AdCategory:case Msn.VE.PushPinTypes.AdWide:case Msn.VE.PushPinTypes.AdSponsor:return true;default:return false}}function _RepositionPushpins(){for(var a=0;a<pushpins.length;a++){pushpins[a].pin.style.display="";pushpins[a].Reposition()}}function RepositionPushpins(){var d=[],h,i=function(b){if(currentMode!=obliqueMode||null==currentMode.GetScene()||h!=currentMode.GetScene().GetID())return;if(b)for(var a=0;a<d.length;a++){var c=GetPushpinIndex(d[a]);if(c>=0)if(b[a])pushpins[c].SetAccuratePixel(b[a])}_RepositionPushpins()};if(pushpins&&pushpins.length>0){if(null==Msn.VE.API&&currentMode==obliqueMode){var c=currentMode.GetScene(),f=[],a=0;if(c){h=c.GetID();for(var e=0;e<pushpins.length;e++){var b=pushpins[e],g=new Msn.VE.LatLong(b.GetLatitude(),b.GetLongitude());if(NeedToPlaceAccurately(b)&&c.ContainsLatLong(g)){f[a]=g;d[a]=b.id;a++}}if(a>0){currentMode.LatLongToPixelAsync(f,currentView.GetZoomLevel(),i);return}}}_RepositionPushpins()}}function HidePins(){for(var a=0;a<pushpins.length;a++)pushpins[a].Hide()}function UnHidePins(){for(var a=0;a<pushpins.length;a++)pushpins[a].UnHide()}function GetPushpinPixel(b,c,d,e){var a=currentMode.LatLongToPixel(b,c);if(a){a.x=MathRound(a.x-d);a.y=MathRound(a.y-e)}return a}function GetPushpinMapPixel(a,b){return GetPushpinPixel(a,b,originX,originY)}function Pushpin(){var a=this;this.visible=true;this.pin=document.createElement("a");this.img=document.createElement("img");this.img.className="VE_PushpinImage";this.pin.href="javascript://pushin hover";this.pin.onclick=function(){return ParseShiftKeyForLinks(event)};this.pin.vePushpin=this;this.x1=0;this.y1=0;this.x2=0;this.y2=0;this.center=null;this.w=0;this.h=0;this.n=zoomTotalSteps+1;this.xs=new Array(this.n);this.ys=new Array(this.n);this.Offset=0;this.beLatLongOffset=null;this.Destroy=function(){a.RemoveFromMap();a.pin.onclick=null;a.pin.vePushpin=null;a.pin=null;while(a.xs.length>0)a.xs.pop();while(a.ys.length>0)a.ys.pop();a=null}}Pushpin.prototype.Init=function(i,g,h,f,e,c,d,j,a,b){this.id=i;this.lat=g;this.lon=h;this.width=f;this.height=e;this.className=c;this.innerHtml=d;this.zIndex=j;this.pinType=a;this.pin.id=i;this.pin.className=c;this.pin.style.position="absolute";this.pin.innerHTML=d;this.pin.pinType=a||Msn.VE.PushPinTypes.Default;this.Offset=getPushPinOffset(this.pin.pinType);if(a==Msn.VE.PushPinTypes.SearchResultPrecise){this.img.src=GetUrlPrefix()+"i/bin/"+window.buildVersion+"/pins/poi_search.gif";this.pin.appendChild(this.img)}else if(a==Msn.VE.PushPinTypes.SearchResultNonprecise){this.img.src=GetUrlPrefix()+"i/bin/"+window.buildVersion+"/pins/poi_search_nonprecise.gif";this.pin.appendChild(this.img)}else if(a==Msn.VE.PushPinTypes.AdSponsor){this.img.src=GetUrlPrefix()+"i/bin/"+window.buildVersion+"/pins/poi_search.gif";this.pin.appendChild(this.img)}this.pin.unselectable="on";this.center=new Msn.VE.LatLong(g,h);this.w=f;this.h=e;if(b)this.SetAccuratePixel(b);var k=this.LatLongToPixelWithAccuracyOffset(currentView.zoomLevel,originX,originY);this.SetPixelLocation(k)};Pushpin.prototype.SetAccuratePixel=function(b){var a=currentMode.PixelToLatLong(b,currentView.zoomLevel);this.beLatLongOffset=new Msn.VE.LatLong(a.latitude-this.center.latitude,a.longitude-this.center.longitude)};Pushpin.prototype.LatLongToPixelWithAccuracyOffset=function(b,c,d){var a=this.center;if(this.beLatLongOffset&&IsMapViewOblique())a=new Msn.VE.LatLong(this.center.latitude+this.beLatLongOffset.latitude,this.center.longitude+this.beLatLongOffset.longitude);return GetPushpinPixel(a,b,c,d)};Pushpin.prototype.GetLatitude=function(){return this.center.latitude};Pushpin.prototype.GetLongitude=function(){return this.center.longitude};Pushpin.prototype.ClearSteps=function(){var b=zoomTotalSteps;for(var a=0;a<=b;a++){this.xs[a]=this.x1-this.w/2+this.Offset.x+"px";this.ys[a]=this.y1-this.h/2+this.Offset.y+"px"}};Pushpin.prototype.PrecomputeSteps=function(){var d=zoomTotalSteps;for(var a=0;a<=d;a++){var b=a/d,c=1-b;this.xs[a]=MathFloor(c*this.x1+b*this.x2-this.w/2+this.Offset.x)+"px";this.ys[a]=MathFloor(c*this.y1+b*this.y2-this.h/2+this.Offset.y)+"px"}};Pushpin.prototype.SetFactor=function(a){this.pin.style.left=this.xs[a];this.pin.style.top=this.ys[a]};Pushpin.prototype.SetPixelLocation=function(a){if(a&&this.visible){this.x1=a.x;this.y1=a.y;this.x2=this.x1;this.y2=this.y1;this.PrecomputeSteps();this.SetFactor(0);this.pin.style.display="block"}else this.pin.style.display="none"};Pushpin.prototype.SwapStates=function(){var a=0;a=this.x1;this.x1=this.x2;this.x2=a;a=this.y1;this.y1=this.y2;this.y2=a};Pushpin.prototype.Reposition=function(){var a=this.LatLongToPixelWithAccuracyOffset(currentView.zoomLevel,originX,originY);if(a){this.x1=a.x;this.y1=a.y;this.ClearSteps();this.SetFactor(0);if(this.pin.style.display!="none"&&this.visible)this.pin.style.display="block"}else this.pin.style.display="none"};Pushpin.prototype.UnHide=function(){if(!this.visible){this.pin.style.display="block";this.visible=true}};Pushpin.prototype.Hide=function(){if(this.visible){this.pin.style.display="none";this.visible=false}};Pushpin.prototype.UnHide3D=function(){if(IsModeEnabled(Msn.VE.MapActionMode.Mode3D))View3DAddPushpin(this)};Pushpin.prototype.Hide3D=function(){if(IsModeEnabled(Msn.VE.MapActionMode.Mode3D))View3DRemovePushpin(this.id)};Pushpin.prototype.PrepareForZoom=function(b,c,d){this.x1-=offsetX;this.y1-=offsetY;var a=this.LatLongToPixelWithAccuracyOffset(d,b,c);if(a){this.x2=a.x;this.y2=a.y;this.PrecomputeSteps();if(this.pin.style.display!="none"&&this.visible)this.pin.style.display="block"}else this.pin.style.display="none"};Pushpin.prototype.RemoveFromMap=function(){if(this.pin.parentNode==map)map.removeChild(this.pin)};Pushpin.prototype.Move=function(a){this.MoveToLatLon(PixelToLatLong(a))};Pushpin.prototype.MoveToLatLon=function(a){this.center=a;this.Reposition()};function ScaleBar(c){var e=null,j=null,a=g(document.createElement("div")),b=g(document.createElement("div")),m=false,d=document.createElement("div"),f=document.createElement("div"),i=150;this.Init=function(){a.addClass("MSVE_ScaleBarLabel MSVE_ScaleBarLabelBg");b.addClass("MSVE_ScaleBarLabel MSVE_ScaleBarLabelFg");d.className="MSVE_ScaleBar MSVE_ScaleBarBg";f.className="MSVE_ScaleBar MSVE_ScaleBarFg";n();k()};this.Show=function(){c.appendChild(a.element());c.appendChild(b.element());c.appendChild(d);c.appendChild(f)};this.Hide=function(){try{c.removeChild(a.element());c.removeChild(b.element());c.removeChild(d);c.removeChild(f)}catch(e){}};this.Destroy=function(){this.Hide();e=null;a=b=d=BarFg=null};function k(){var c=0;if(e&&e.style.display!=="none"){var i=parseInt(g(e).getStyle("height")),h=parseInt(e.style.bottom);c+=(isNaN(i)?0:i)+(isNaN(h)?0:h)}if(a){a.setStyle("bottom",c+"px");b.setStyle("bottom",1+c+"px")}if(d){d.style.bottom=c+"px";f.style.bottom=1+c+"px"}}function o(a){return a*.001}function q(a){return a*.000621371192}function r(a){return a*1.0936133}function t(a){i=a}function p(a){j=a}function n(){try{var f=GetMetersPerPixel(),c=f*i,e;if(j==null)e=$MVEM.IsEnabled(MapControl.Features.ScaleBarKilometers);else e=j==Msn.VE.DistanceUnit.Kilometers;if(e){var d=L_ScaleBarKilometers_Text,b=o(c),a=h(b);if(a<.5){d=L_ScaleBarMeters_Text;b=c;a=h(b)}l("metric",d,a,Math.round(a/b*i))}else{var d=L_ScaleBarMiles_Text,b=q(c),a=h(b);if(a<.5){d=L_ScaleBarYards_Text;b=r(c);a=h(b)}l("us",d,a,Math.round(a/b*i))}}catch(g){}}function h(d){var g=Math.log(d)/Math.log(10),e=Math.floor(g),a=Math.pow(10,e),c=d/a,b=Math.floor(c);if(b>=3)return b*a;var f=Math.floor(c*2)*.5;return f*a}function l(j,i,c,g){if(c<1)c=c.toFixed(1);var e=GetMapStyle()!=roadStyle;if(e!=m){if(e){a.swapClass("MSVE_ScaleBarLabelBg","MSVE_ScaleBarLabelBgInv");b.swapClass("MSVE_ScaleBarLabelFg","MSVE_ScaleBarLabelFgInv")}else{a.swapClass("MSVE_ScaleBarLabelBgInv","MSVE_ScaleBarLabelBg");b.swapClass("MSVE_ScaleBarLabelFgInv","MSVE_ScaleBarLabelFg")}m=e}var h=c+" "+i;a.setHTML(h);b.setHTML(h);d.style.width=4+g+"px";f.style.width=g+"px"}function s(a){e=a;k()}this.SetBarWidth=t;this.SetDistanceUnit=p;this.Update=n;this.Reposition=k;this.SetPinElement=s}function MapLegend(h){var q=this,g=h,a=null,e=null,b=null,d=null,c=null;h=null;this.Init=function(){a=document.createElement("div");a.id="MSVE_MapLegend";a.style.display="none";g.appendChild(a);e=document.createElement("div");e.className="MSVE_LegendGroup";a.appendChild(e);a.attachEvent("onmousedown",IgnoreEvent);a.attachEvent("onmouseup",IgnoreEvent);a.attachEvent("onmousemove",IgnoreEvent);a.attachEvent("onmousewheel",IgnoreEvent);a.attachEvent("ondblclick",IgnoreEvent);a.attachEvent("oncontextmenu",IgnoreEvent);a.attachEvent("onkeydown",IgnoreEvent);a.attachEvent("onkeyup",IgnoreEvent)};this.Destroy=function(){if(a){a.detachEvent("onmousedown",IgnoreEvent);a.detachEvent("onmouseup",IgnoreEvent);a.detachEvent("onmousemove",IgnoreEvent);a.detachEvent("onmousewheel",IgnoreEvent);a.detachEvent("ondblclick",IgnoreEvent);a.detachEvent("oncontextmenu",IgnoreEvent);a.detachEvent("onkeydown",IgnoreEvent);a.detachEvent("onkeyup",IgnoreEvent);g.removeChild(a);a=null}g=null;e=null;d=null;c=null};function k(d){if(d&&!b)i();a.style.display=d?"":"none";if(c)window.setTimeout(c.Reposition,1);f()}function i(){if(e&&!b){b=document.createElement("div");b.className="MSVE_LegendGroup";b.id="MSVE_TrafficLegend";e.appendChild(b);var a=document.createElement("span");a.id="MSVE_TL_Slow";a.appendChild(document.createTextNode(L_MapLegendTrafficSlow_Text));b.appendChild(a);a=document.createElement("span");a.id="MSVE_TL_Fast";a.appendChild(document.createTextNode(L_MapLegendTrafficFast_Text));b.appendChild(a);a=document.createElement("img");a.id="MSVE_TL_Key";var c=GetUrlPrefix(),f=window.buildVersion;if(Msn.VE.API!=null){c=Msn.VE.API.Globals.vecurrentdomain+"/";f=Msn.VE.API.Globals.vecurrentversion}a.src=c+"i/bin/"+f+"/traffic/tf_legend.gif";a.alt="";b.appendChild(a);d=document.createElement("div");d.className="MSVE_LegendGroup";d.id="MSVE_TrafficMsg";e.appendChild(d)}}function l(a){while(a.hasChildNodes())a.removeChild(a.childNodes[0])}function j(a){if(d){l(d);d.appendChild(document.createTextNode(a));f()}}function o(b){c=b;if(c)c.SetPinElement(a)}function p(){if(c){c.SetPinElement(null);c=null}}function n(b,c){if(a){a.style.left=b+"px";a.style.top=c+"px";a.style.bottom="auto";a.style.right="auto";f()}}function f(){if(a)mvcViewFacade.UpdateShimIfSupported(a)}function m(){if(a)destroyIFrameShim(a.id)}this.ShowTrafficLegend=k;this.SetTrafficLegendMsg=j;this.UnPin=p;this.PinTo=o;this.MoveTo=n;this.UpdateShim=f;this.RemoveShim=m}var totalRequestTime=0,totalRequestCount=0,totalFailureCount=0,responseRangeCeilings=[];responseRangeCeilings[roadStyle]=[325,975];responseRangeCeilings[shadedStyle]=responseRangeCeilings[roadStyle];responseRangeCeilings[aerialStyle]=[350,1050];responseRangeCeilings[hybridStyle]=[425,1275];responseRangeCeilings[obliqueStyle]=[450,1350];responseRangeCeilings[obliqueHybridStyle]=responseRangeCeilings[obliqueStyle];var responseRangeCounts=[0,0,0];function RequestTile(b,c,i,h,d,g,e,f){var a=new Tile;a.Init(b,c,i,h,b*tileSize-originX,c*tileSize-originY,d,g,e,f);return a}function ClearTiles(a){while(a.length>0){var b=a.pop();b.Destroy();b=null}}function GetResponseRangeCounts(){var b=0;for(var a=0;a<responseRangeCounts.length;a++)b+=responseRangeCounts[a];if(b==0)return responseRangeCounts;var c=new Array(responseRangeCounts.length);for(var a=0;a<responseRangeCounts.length;a++)c[a]=responseRangeCounts[a]/b;return c}function ResetResponseRangeCounts(){for(var a=0;a<responseRangeCounts.length;a++)responseRangeCounts[a]=0}function GetFailureRate(){return totalFailureCount/totalRequestCount}function Tile(){var a=null,b=null,c=null,i=null,D=null,e=null,p=0,q=0,v=0,B=0,f=0,d=1,x=zoomTotalSteps+1,m=new Array(x),o=new Array(x),u=new Array(x),s=new Array(x),A=false,g=0,h=0,k=0,j=0,l=0,n=0,t=0,r=0,z=null,C=0;this.Init=function(k,l,m,j,c,e,g,a,h,i){p=k;q=l;v=m;B=j;f=i;d=h;if(!currentMode.IsValidTile(p,q,v))return;y(c,e,tileSize,tileSize);I(c,e,tileSize,tileSize);w();if(a==mapTiles||a==trafficTiles)C=0;else C=1;b=document.createElement("img");b.className="MSVE_ImageTile";if(a!=null)b.className+=" msve_"+a+"_tile";b.onload=T;b.onerror=S;z=new Date;D=currentMode.GetFilename(p,q,v,g,a);b.src=D};function H(){if(!e&&a!=null)e=graphicCanvas.AddPrintTile(D,q*tileSize-originY,p*tileSize-originX,tileSize,tileSize,d,f)}this.AddPrintTile=H;function O(){if(e){graphicCanvas.RemovePrintTile(e);e=null}}this.RemovePrintTile=O;function L(){if(e)graphicCanvas.RePositionPrintTile(e,q*tileSize-originY,p*tileSize-originX)}this.RePositionPrintTile=L;this.Destroy=function(){if(a)a.onmousedown=null;G();while(m.length>0)m.pop();while(o.length>0)o.pop();while(u.length>0)u.pop();while(s.length>0)s.pop();m=o=u=s=null};function y(c,d,b,a){g=c;h=d;k=b;j=a}this.SetCurrentState=y;function I(c,d,b,a){l=c;n=d;t=b;r=a}this.SetNextState=I;function Q(){for(var a=0;a<=zoomTotalSteps;a++){m[a]=g+"px";o[a]=h+"px";u[a]=k+"px";s[a]=j+"px"}}this.ClearSteps=Q;function w(){for(var a=0;a<=zoomTotalSteps;a++){var b=a/zoomTotalSteps,c=1-b;m[a]=MathFloor(c*g+b*l)+"px";o[a]=MathFloor(c*h+b*n)+"px";u[a]=MathCeil(c*k+b*t)+"px";s[a]=MathCeil(c*j+b*r)+"px"}}this.PrecomputeSteps=w;function K(e){if(a==null||zooming&&!A)return;var b=a.style;b.left=m[e];b.top=o[e];b.width=u[e];b.height=s[e];if(debug&&e==0){if(!c)F();var g=c.style;b.border="1px dashed red";g.left=m[e];g.top=o[e]}if(a.parentNode!=map){b.position="absolute";b.zIndex=f;if(C>0)if(b&&typeof b.filter!="undefined")if(Msn.VE.Environment.BrowserInfo.MajorVersion<=6){if(!i){i=document.createElement("div");i.className="MSVE_ImageTile";var b=i.style;b.left=m[e];b.top=o[e];b.width=u[e];b.height=s[e];b.position="absolute";b.zIndex=f;if(d!=1)b.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+a.src+"',sizingMethod='scale'), alpha(opacity="+d*100+")";else b.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+a.src+"',sizingMethod='scale')";map.appendChild(i)}}else{b.zIndex=f;if(d<1)b.filter="alpha(opacity="+d*100+");opacity:"+d+";";map.appendChild(a)}else{b.zIndex=f;b.opacity=d;map.appendChild(a)}else{if(b&&typeof b.filter!="undefined"){if(d<1)b.filter="alpha(opacity="+d*100+");opacity:"+d}else b.opacity=d;map.appendChild(a)}if(debug&&c&&c.parentNode!=map){var h=a.src;c.innerHTML=h.substring(h.lastIndexOf("/")+1,h.lastIndexOf("."));g.position="absolute";g.zIndex=f+1;map.appendChild(c)}}}this.SetFactor=K;function J(){var a=0;a=g;g=l;l=a;a=h;h=n;n=a;a=k;k=t;t=a;a=j;j=r;r=a}this.SwapStates=J;function G(){if(b){b.onload=null;b.onerror=null;b=null}if(a){if(a.parentNode==map)map.removeChild(a);a=null}if(c){if(c.parentNode==map)map.removeChild(c);c=null}if(i){if(i.parentNode==map)map.removeChild(i);i=null}if(e){graphicCanvas.RemovePrintTile(e);e=null}}this.RemoveFromMap=G;function T(){if(currentView&&v!=currentView.zoomLevel||b==null)return;var d=new Date,c=d.getTime()-z.getTime();E(c);totalRequestTime+=c;totalRequestCount++;if(debug)window.status="last="+c+", average="+totalRequestTime/totalRequestCount;b.onload=null;b.onerror=null;a=b;a.onmousedown=function(){return false};b=null;if(!zooming)K(zoomCounter);if(graphicCanvas&&graphicCanvas._printable)H()}function S(){if(v!=currentView.zoomLevel||b==null)return;var c=new Date,a=c.getTime()-z.getTime();E(a);totalRequestTime+=a;totalRequestCount++;totalFailureCount++;b.onload=null;b.onerror=null;b=null}function E(b){for(var a=0;a<responseRangeCeilings[B].length;a++)if(b<responseRangeCeilings[B][a]){responseRangeCounts[a]++;return}responseRangeCounts[responseRangeCounts.length-1]++}function M(e,i,p,c,d,o){y(g-offsetX,h-offsetY,k,j);var m=o-p,b=Math.pow(2,m);l=MathFloor((e+g)*b-c);n=MathFloor((i+h)*b-d);t=MathCeil((e+g+k)*b-c)-l;r=MathCeil((i+h+j)*b-d)-n;A=true;w();f=baseZIndex;if(a!=null)a.style.zIndex=f}this.PrepareBaseTile=M;function N(i,m,s,d,e,o){var u=s-o,a=Math.pow(2,u);l=MathFloor((d+g)*a-i);n=MathFloor((e+h)*a-m);t=MathCeil((d+g+k)*a-i)-l;r=MathCeil((e+h+j)*a-m)-n;var c=MathCeil(tileViewportWidth*.25),b=MathCeil(tileViewportHeight*.25);A=o<s&&(p<tileViewportX1+c||p>tileViewportX2-c||q<tileViewportY1+b||q>tileViewportY2-b);J();w();f=swapZIndex}this.PrepareSwapTile=N;function R(b){if(!c)F();if(a!=null)a.style.border=b?"1px dashed red":"0px";c.style.display=b?"block":"none"}this.Debug=R;function P(){t=k;r=j}this.ClearStates=P;function F(){c=document.createElement("div");c.style.font="7pt Verdana, sans-serif";c.style.color="Red";c.style.backgroundColor="White"}}var tileMarket=Msn.VE.API?Msn.VE.API.Globals.locale:window.locale,orthoTileSpec=new VETileSourceSpecification;orthoTileSpec.ID=mapTiles;orthoTileSpec.SourceName=Msn.VE.API?Msn.VE.API.Constants.orthotileserver:"http://r%2.ortho.tiles.mapindia.live.net/tiles/%3%4.%5?g=%6&mkt={21}";orthoTileSpec.SourceName=orthoTileSpec.SourceName.replace(/\{21\}/g,tileMarket);orthoTileSpec.NumServers=4;var shadedTileSpec=new VETileSourceSpecification;shadedTileSpec.ID=mapTiles;shadedTileSpec.SourceName=Msn.VE.API?Msn.VE.API.Constants.shadedtileserver:"http://r%2.ortho.tiles.mapindia.live.net/tiles/%3%4.%5?g=%6&mkt={21}";shadedTileSpec.SourceName=shadedTileSpec.SourceName.replace(/%1/g,"r").replace(/%3/g,"r").replace(/%5/g,"png").replace(/%6/g,generations["r"]).replace(/\{21\}/g,tileMarket);shadedTileSpec.NumServers=4;function SetBaseTileSource(a){if(!a)a=currentView;var c=a&&shadedTileSpec&&shadedTileSpec.SourceName&&(a.mapStyle==Msn.VE.MapStyle.Road&&$MVEM.IsEnabled(MapControl.Features.MapStyle.Shaded)&&currentView.doRoadShading)||a.mapStyle==Msn.VE.MapStyle.Shaded,b=c?shadedTileSpec:orthoTileSpec;b.LoadTiles=loadBaseTiles;tileLayerManager.AddTileSource(b)}function SetView(a){if(currentMode!=null&&currentMode==threeDMode)return SetView3DSpecialized(a);if(a==null)return CreateNewView();if(zooming||dragging)return true;if(panning)StopContinuousPan();var b=a.latlong;if(a.GetViewType()==Msn.VE.MapViewType.LatLongRect)b=a.latlongRect.Center();if(Msn.VE.MapStyle.IsViewOblique(a.mapStyle))return SetViewOblique(a,b);else return SetViewOrtho(a,b)}function SetView3DSpecialized(a){var b=false;if(a==null){a=new Msn.VE.MapView;a.Copy(currentView);b=true}if(!view3DCreated)b=true;return SetView3D(a,b)}function SetViewOblique(a,c){if(obliqueMode==null)return true;preferredView.Copy(a);currentMode=obliqueMode;if(Msn.VE.API)p_elSource.style.background='#000 url("'+Msn.VE.API.Globals.vecurrentdomain+"/i/bin/"+Msn.VE.API.Globals.vecurrentversion+'/oblique/oblique_bg.gif") repeat';else p_elSource.style.background='#000 url("./i/bin/'+window.buildVersion+'/oblique/oblique_bg.gif") repeat';function b(){var b=HandleSetViewObliqueResolve(a,c,preferredView);if(!b&&typeof a.callback=="function")a.callback(obliqueMode.GetScene())}a.Resolve(currentMode,width,height,b)}function HandleSetViewObliqueResolve(a,c,i){if(targetTool.centeringTrigger){targetTool.centeringTrigger=false;obliqueMode.RequestSceneAtLatLong(c,a.sceneOrientation,true,null,null,null,null,a.mapStyle);return true}var b=obliqueMode.GetScene(),e=b&&b.ContainsLatLong(c,a.zoomLevel);if(a.bySceneId){if(!b||b.GetID()!=a.sceneId){obliqueMode.RequestScene(a.sceneId);return true}else if(!e){var l=b.GetBounds();a.SetCenterLatLong(b.PixelToLatLong(new VEPixel(b.GetWidth()/4,b.GetHeight()/4),1));a.Resolve(currentMode,width,height);e=true}}else if(!b||!e||b.GetOrientation()!=a.sceneOrientation||b.GetMapStyle()!=a.mapStyle){obliqueMode.RequestSceneAtLatLong(c,a.sceneOrientation,true,null,a.callback,a.spinDirection,a.preserveScene,a.mapStyle);return true}c=a.latlong;i.Copy(a);SetBaseTileSource(a);currentMode.ValidateZoomLevel(a);currentBounds=currentMode.GetBounds(a);ClipView(a,currentBounds);if(a.Equals(currentView)&&!resizeInProgress)return false;var g=a.GetX(currentView.zoomLevel)-currentView.center.x,h=a.GetY(currentView.zoomLevel)-currentView.center.y,d=Math.sqrt(g*g+h*h);previousCenter=currentView.latlong;var f=0;if(!previousCenter.Equals(a.latlong))f+=Msn.VE.ViewChangeType.Pan;if(currentView.zoomLevel!=a.zoomLevel)f+=Msn.VE.ViewChangeType.Zoom;SetLastViewChangeType(f);var k=d<width&&d<height&&a.zoomLevel==currentView.zoomLevel&&IsAnimationEnabled()&&a.mapStyle==currentView.mapStyle&&(a.sceneId==null||a.sceneId==currentView.sceneId);if(k){PanToPixel(new VEPixel(a.center.x-originX-offsetX,a.center.y-originY-offsetY),true);return false}previousZoomLevel=currentView.zoomLevel;if(currentView.zoomLevel!=a.zoomLevel){Fire("onstartzoom",CreateEvent(null,null,null,a));zooming=true}var j=d<width&&d<height&&(a.zoomLevel==currentView.zoomLevel-1||a.zoomLevel==currentView.zoomLevel+1)&&IsAnimationEnabled()&&a.mapStyle==currentView.mapStyle&&(a.sceneId==null||a.sceneId==currentView.sceneId);if(j){tileLayerManager.zoomView(a);return false}UpdateTiles(a);return false}function SetViewOrtho(a,f){currentMode=orthoMode;p_elSource.style.backgroundImage="none";if(a.mapStyle==Msn.VE.MapStyle.Road||a.mapStyle==Msn.VE.MapStyle.Shaded)p_elSource.style.backgroundColor="#e9e7d4";else p_elSource.style.backgroundColor="black";a.Resolve(currentMode,width,height);f=a.latlong;preferredView.Copy(a);SetBaseTileSource(a);currentMode.ValidateZoomLevel(a);currentBounds=currentMode.GetBounds(a);ClipView(a,currentBounds);a.Resolve(currentMode,width,height);if(a.Equals(currentView)&&!resizeInProgress)return false;if(!currentView.center)currentView.center=a.center;var d=a.GetX(currentView.zoomLevel)-currentView.center.x,e=a.GetY(currentView.zoomLevel)-currentView.center.y,b=Math.sqrt(d*d+e*e);previousCenter=currentView.GetCenterLatLong();var c=0;if(!previousCenter.Equals(a.GetCenterLatLong()))c+=Msn.VE.ViewChangeType.Pan;if(currentView.zoomLevel!=a.zoomLevel)c+=Msn.VE.ViewChangeType.Zoom;SetLastViewChangeType(c);var h=b<width&&b<height&&a.zoomLevel==currentView.zoomLevel&&IsAnimationEnabled()&&a.mapStyle==currentView.mapStyle&&(a.sceneId==null||a.sceneId==currentView.sceneId);if(h){PanToLatLong(a.latlong.latitude,a.latlong.longitude,true);return true}previousZoomLevel=currentView.zoomLevel;if(currentView.zoomLevel!=a.zoomLevel){Fire("onstartzoom",CreateEvent(null,null,null,a));zooming=true}var g=b<width&&b<height&&(a.zoomLevel==currentView.zoomLevel-1||a.zoomLevel==currentView.zoomLevel+1)&&IsAnimationEnabled()&&a.mapStyle==currentView.mapStyle&&(a.sceneId==null||a.sceneId==currentView.sceneId);if(g){tileLayerManager.zoomView(a);return true}UpdateTiles(a);return true}function CreateNewView(){var a=new Msn.VE.MapView;a.Copy(currentView);a.SetAltitude(-1000);a.SetTilt(-90);a.SetDirection(0);var b=a.latlong,c=ClipLatitude(b.latitude);if(b.latitude!=c){a.SetCenterLatLong(new Msn.VE.LatLong(c,b.longitude));a.Resolve(currentMode,width,height)}if(Msn.VE.MapStyle.IsViewOblique(a.mapStyle))currentMode=obliqueMode;else currentMode=orthoMode;SetBaseTileSource(a);currentMode.ValidateZoomLevel(a);UpdateTiles(a);return true}function UpdateTiles(a){currentView.Destroy();currentView=a;tileLayerManager.SetViewPort();tileLayerManager.LoadBaseLayer("Road",mapTiles,1,1);tileLayerManager.RefreshTileLayers();tileLayerManager.FinalizeView();RepositionPushpins()}function SetLastViewChangeType(a){if(Msn.VE.ViewChangeType.IsValid(a))lastViewChangeType=a}_VERegisterNamespaces("Msn.VE.Geometry");Msn.VE.Geometry.Point=function(c,d){var a=this,b=Msn.VE.Geometry;this.x=c;this.y=d;this.add=function(c,d){var e=new b.Point(a.x+c,a.y+d);return e};this.getDistanceFrom=function(b){var c=Math.pow(b.x-a.x,2)+Math.pow(b.y-a.y,2),d=Math.sqrt(c);return d}};Msn.VE.Geometry.Overlap={Range:{GreaterThanX:1,LessThanX:2,GreaterThanY:4,LessThanY:8,InXRange:16,InYRange:32,InRange:48},getInstance:function(f,g){var d=Msn.VE.Geometry.Overlap,a=f,b=g,c=0;e();function e(){if(b.getP2().x>a.getP2().x)c+=d.Range.GreaterThanX;if(b.getP1().x<a.getP1().x)c+=d.Range.LessThanX;if(b.getP2().y>a.getP2().y)c+=d.Range.GreaterThanY;if(b.getP1().y<a.getP1().y)c+=d.Range.LessThanY;if(a.getP1().x<=b.getP1().x&&b.getP2().x<=a.getP2().x)c+=d.Range.InXRange;if(a.getP1().y<=b.getP1().y&&b.getP2().y<=a.getP2().y)c+=d.Range.InYRange}this.getRange=function(){return c};this.getLeftXBleed=function(){if(c&d.Range.LessThanX)return Math.abs(a.getP1().x-b.getP1().x);else return 0};this.getRightXBleed=function(){if(c&d.Range.GreaterThanX)return b.getP2().x-a.getP2().x;else return 0};this.getTopYBleed=function(){if(c&d.Range.LessThanY)return Math.abs(a.getP1().y-b.getP1().y);else return 0};this.getBottomYBleed=function(){if(c&d.Range.GreaterThanY)return b.getP2().y-a.getP2().y;else return 0}}};Msn.VE.Geometry.Rectangle=function(h,i){var g=this,a=h,b=i,d,e;f();function f(){c()}this.move=function(c){a.x=c.x;a.y=c.y;b.x=c.x+e;b.y=c.y+d};this.getP1=function(){return a};this.getP2=function(){return b};this.setP1=function(b){a=b;c()};this.setP2=function(a){b=a;c()};this.getWidth=function(){return e};this.getHeight=function(){return d};this.containsPoint=function(c){return c.x>=a.x&&c.x<=b.x&&c.y>=a.y&&c.y<=b.y};this.scale=function(d){a.x-=d;a.y-=d;b.x+=d;b.y+=d;c()};this.getOverlap=function(a){var b=Msn.VE.Geometry;return new b.Overlap.getInstance(g,a)};function c(){d=b.y-a.y;e=b.x-a.x}};Msn.VE.Geometry.Functions={getSlope:function(a,b){return (b.y-a.y)/(b.x-a.x)},getYIntercept:function(b,a){return a.y-b*a.x},getBestBoundingPoint:function(f,b,c){var a=Msn.VE.Geometry;if(!b)b=g(f).getScreenPosition();var e=new a.Rectangle(b,new a.Point(b.x+f.offsetWidth,b.y+f.offsetHeight)),j=c.getOverlap(e),d=j.getRange();if((d&a.Overlap.Range.InRange)==a.Overlap.Range.InRange)return b;var h=b.x,i=b.y;if(d&a.Overlap.Range.GreaterThanX)h=c.getP2().x-e.getWidth();if(d&a.Overlap.Range.LessThanX)h=c.getP1().x;if(d&a.Overlap.Range.GreaterThanY)i=c.getP2().y-e.getHeight();if(d&a.Overlap.Range.LessThanY)i=c.getP1().y;return new a.Point(h,i)}};view3DMode=false;var sentinel3D,setStyle;function View3DAddPushpin(a){if(g(a.pin).hasClass("inactiveAbbreviationPin"))return;var d=parseInt(a.pinType),h=TranslatePushpinURL(a.className,a.innerHtml,d),c=Msn.VE.PushPinTypes,e=parseFloat(a.lat),f=parseFloat(a.lon),b='zindex="'+a.zIndex+'"';switch(d){case c.DirectionStep:case c.SearchResultNonprecise:b+=' textoffset="50%, 50%"';case c.Direction:case c.SearchResultPrecise:case c.AdSponsor:b+=' text="'+extractText(a.innerHtml)+'"';break;case c.Collection:if(a.className.indexOf("point")==-1)b+=' textoffset="50%, 60%"';b+=' text="'+extractText(a.innerHtml)+'"';break;case c.Overlay:b+=' textoffset="50%, 50%"';b+=' text="'+extractText(a.innerHtml)+'"'}spacecontrol.AddPointWithProperties(0,a.id,e,f,h,b)}function extractText(b){var a=document.createElement("div");a.innerHTML=b;var c=a.textContent||a.innerText;a=null;return c}function View3DRemovePushpin(a){spacecontrol.DeleteGeometry(0,a)}function AddView3DParameter(d,c,b){var a=document.createElement("param");a.name=c;a.value=b;d.appendChild(a)}function Get3DUpdatedUrl(a){var b=Get3dInstallMarket();return "http://maps.live.com/Help/VE3DInstall/"+"VersionUpdated.aspx?version="+a+"&mkt="+b}function GetScriptVersion(){var a=null;if(typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null&&Msn.VE.API.Globals.vecurrentversion){var b=Msn.VE.API.Globals.vecurrentversion.split(".");a="";if(b.length>0)a+=b[0];if(b.length>1)a+="."+b[1]}else if(typeof window.spacelandScriptVersion!="undefined")a=window.spacelandScriptVersion;return a}function CreateView3DControl(a){if(!BrowserSupports3D()){View3DUnavailable();return false}initial3dView=new Msn.VE.MapView;initial3dView.Copy(a);if(sentinel3D==null)sentinel3D=GetSentinel();if(null==sentinel3D){View3DUnavailable();return false}if(sentinel3D!=null&&sentinel3D.CurrentVersion<3.0){var d=sentinel3D.CurrentVersion;sentinel3D=null;if(d>0)View3DUpgrade(d);return false}try{sentinel3D.InitializeRuntime()}catch(h){}spacediv=document.createElement("div");spacediv.id="MSVE_spacediv";spacediv.className="MSVE_SLMap";spacediv.style.position="relative";spacediv.style.height="100%";spacediv.style.overflow="hidden";spacecontrol=document.createElement("object");var b=a.cameraLatlong==null?a.latlong:a.cameraLatlong;AddView3DParameter(spacecontrol,"StartLongitude",b.longitude);AddView3DParameter(spacecontrol,"StartLatitude",b.latitude);AddView3DParameter(spacecontrol,"StartPitch",a.GetTilt());AddView3DParameter(spacecontrol,"StartHeading",-a.GetDirection());var f=Get3dMarket();if(f)AddView3DParameter(spacecontrol,"CurrentLocale",f);var e=a.GetAltitude();if(e>-1000)AddView3DParameter(spacecontrol,"StartAltitude",e);else AddView3DParameter(spacecontrol,"StartZoomLevel",a.zoomLevel);spacediv.appendChild(spacecontrol);try{if(window.navigator.userAgent.indexOf("MSIE")!=-1)spacecontrol.classid="clsid:68BFC611-B963-4e8c-B0FE-0DD4FB832796";else spacecontrol.type="application/x-virtual-earth-3d"}catch(h){View3DUnavailable();spacecontrol=false;return false}var c=GetScriptVersion();spacecontrol.ControlId=init3dparam;spacecontrol.ScriptVersion=c;AttachEvent("onresize",ResizeControl);p_elSource.appendChild(spacediv);ResizeControl();setStyle=false;var g=ValidateControl();if(g){IterativeCameraRefinement();spacecontrol.ControlId=init3dparam;spacecontrol.ScriptVersion=c;if((typeof Msn.VE.API=="undefined"||Msn.VE.API==null)&&spacecontrol.VersionUpdated)VE_Help.OpenSized(L_VE3D_VersionUpgradedDialogTitle,Get3DUpdatedUrl(sentinel3D.CurrentVersion),550,280)}if(typeof state!="undefined"&&state!=null)state.Set3DViewInstallInProgress("");return g}function View3DUnavailable(){if(IsEventAttached("onmodenotavailable"))Fire("onmodenotavailable",Msn.VE.MapActionMode.Mode3D);else if(typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null)if(sentinel3D!=null)window.open(Get3dHelpUrl("View3DUnavailable.htm"),"_blank","width=600,height=550,menubar=0,resizeable=0,status=0,titlebar=0,toolbar=0,scrollbars=0");else if(window.navigator.userAgent.indexOf("MSIE")!=-1)window.open(Get3dInstallUrl(),"_blank","width=650,height=520,menubar=0,resizeable=0,status=0,titlebar=0,toolbar=0,scrollbars=0");else if(window.navigator.userAgent.indexOf("Windows")!=-1)window.open(Get3dInstallUrl(),"_blank","width=760,height=580,menubar=0,resizeable=0,status=0,titlebar=0,toolbar=0,scrollbars=0")}function CallIterativeCameraRefinement(){var a=GetMapControlInstance(null);if(a)a.IterativeCameraRefinement()}function IterativeCameraRefinement(){if(cameraUpdateCount>0)return;if(IsModeEnabled(Msn.VE.MapActionMode.Mode3D)&&spacecontrol)if(!spacecontrol.AllTilesLoaded)setTimeout(CallIterativeCameraRefinement,1000);else{var a=false,c=currentView.GetAltitude(),d=initial3dView.GetAltitude();if(d>-1000&&c>-1000)a=Math.abs(c-d)>1;else a=currentView.GetZoomLevel()!=initial3dView.GetZoomLevel();if(a){var b=initial3dView.MakeCopy();b.SetMapStyle(currentView.mapStyle);SetView3D(b,true)}}}function ValidateControl(){if(typeof Msn.VE.API=="undefined"||Msn.VE.API==null)if(0==spacecontrol.HardwareClassificationLevel)setStyle=true;var a=false,b=300;if(spacecontrol.Created){while(!spacecontrol.FirstFrameRendered&&!spacecontrol.LoadFailed&&!spacecontrol.AlreadyLoaded&&b>0){b--;spacecontrol.ProcessEvents()}a=spacecontrol.FirstFrameRendered}if(spacecontrol.Created&&!spacecontrol.HardwareAccelerationEnabled&&spacecontrol.LoadFailed){if(typeof Msn.VE.API=="undefined"||Msn.VE.API==null){window.setTimeout(DelayedHWDialog,2759);window.setTimeout(OnHardwareAccelHelpFired,4000)}else if(IsEventAttached("onmodenotavailable"))Fire("onmodenotavailable",Msn.VE.MapActionMode.Mode3D);if(mode==Msn.VE.MapActionMode.Mode3D)EnableMode(Msn.VE.MapActionMode.Mode2D);return false}else if(!spacecontrol.Created||!spacecontrol.Enabled||!spacecontrol.IsHandleCreated||!a&&!spacecontrol.AlreadyLoaded){View3DUnavailable();spacecontrol=false;return false}else{spacecontrol.focus();view3DCreated=true;return true}}function ResizeControl(){if(spacecontrol){spacecontrol.style.height=spacediv.offsetHeight+"px";spacecontrol.style.width=spacediv.offsetWidth+"px"}RepositionShims()}function SetView3D(a,g){currentMode.ValidateZoomLevel(a);a.Resolve(orthoMode,width,height);preferredView.Copy(a);if(!view3DCreated&&!spacecontrol){var l=CreateView3DControl(a);if(setStyle){a.mapStyle="h";previousMapStyle="h"}if(!l)return false;if(a.GetTilt()!=-90&&a.cameraLatlong==null){a.Resolve(orthoMode,width,height);cameraUpdateCount=-1}else{cameraUpdateCount=0;a._supressFlyToCall=true}p_elSource.style.backgroundColor="#e9e7d4";originX=0;originY=0;offsetX=0;offsetY=0;UpdateFromParent()}if(!g&&a.Equals(currentView)){if(!spaceCameraIsFlying)ProcessQueuedRequest(null,null);return false}var c=false;if(a.GetAltitude()>-1000)c=Math.abs(a.GetAltitude()-currentView.GetAltitude())>1e-4;else c=currentView.zoomLevel!=a.zoomLevel;currentView.Destroy();currentView=a;if(view3DCreated){if(previousMapStyle){if(currentView.mapStyle!=null&&previousMapStyle!=currentView.mapStyle){var b="http://go.microsoft.com/fwlink/?LinkID=98770";if(currentView.mapStyle=="a"){b="http://go.microsoft.com/fwlink/?LinkID=98771";spacecontrol.ShowAtmosphere=true}if(currentView.mapStyle=="h"){b="http://go.microsoft.com/fwlink/?LinkID=98772";spacecontrol.ShowAtmosphere=true}if(currentView.mapStyle=="r"){spacecontrol.TexturesVisible=false;if(spacecontrol.HardwareClassificationLevel<3)b="http://go.microsoft.com/fwlink/?LinkID=98769";spacecontrol.ShowAtmosphere=false}else spacecontrol.TexturesVisible=true;spacecontrol.AddImageSource("Terrain","Texture",GetManifestUrl(b),0,1);Fire("onchangemapstyle");previousMapStyle=currentView.mapStyle}}else previousMapStyle=currentView.mapStyle;var d=a.cameraLatlong,i=a.zoomLevel,j=a.GetAltitude(),k=a.GetTilt(),h=a.GetDirection(),e=a._needsPivotOperation;if(c)Fire("onstartzoom");if(a._supressFlyToCall)a._supressFlyToCall=false;else{var f=spacecontrol.FlyTo(d.latitude,d.longitude,i,j,k,h,e?1:0);if(!f&&!spaceCameraIsFlying)ProcessQueuedRequest(null,null)}if(a.sceneId&&a.sceneId!=-1){ProcessPhotoPluginActionIn3D("PhotosEnabled","enabled=1"+";labels="+(a.mapStyle==Msn.VE.MapStyle.Road||a.mapStyle==Msn.VE.MapStyle.Hybrid||a.mapStyle==Msn.VE.MapStyle.ObliqueHybrid?"1":"0"),spacecontrol);ProcessPhotoPluginActionIn3D("SelectSceneId","SceneId="+a.sceneId+";X="+a.photoX+";Y="+a.photoY+";Scale="+a.photoScale,spacecontrol,null)}if(c)Fire("onendzoom");if(copyright)copyright.Update();return true}return false}var on3DAnimationInterruptedCallback=null;function SetOn3DAnimationInterruptedCallback(a){on3DAnimationInterruptedCallback=a}function GetOn3DAnimationInterruptedCallback(){return on3DAnimationInterruptedCallback}function SetViewport(b,d,c,e){Sync3dView();var a=preferredView.MakeCopy();a.sceneId=null;a.SetLatLongRectangle(new Msn.VE.LatLongRectangle(new Msn.VE.LatLong(ClipLatitude(b),ClipLongitude(d)),new Msn.VE.LatLong(ClipLatitude(c),ClipLongitude(e))));a.SetTilt(-90);a.SetDirection(0);return SetView(a)}function SetBestMapView(b){var a=GetBestMapViewBounds(b);if(!a||a.constructor!=Array)return false;if(a.length==4)return SetViewport(a[0],a[1],a[2],a[3])}function GetBestMapViewBounds(a){var b=[];if(!a||a.constructor!=Array)return null;var c=a[0].latitude,d=a[0].longitude,f=c,g=d;for(var e=1;e<a.length;e++){c=MathMin(c,a[e].latitude);d=MathMin(d,a[e].longitude);f=MathMax(f,a[e].latitude);g=MathMax(g,a[e].longitude)}var h=(f-c)*.1,i=(g-d)*.1;c-=h;d-=i;f+=h;g+=i;if(!b||b.constructor!=Array)return null;else{b.push(ClipLatitude(c));b.push(ClipLongitude(d));b.push(ClipLatitude(f));b.push(ClipLongitude(g));return b}}function IncludePointInViewport(d,c){var a=new Msn.VE.LatLong(d,c);if(Msn.VE.MapStyle.IsViewOblique(currentView.mapStyle)){var b=obliqueMode.GetScene();if(!b||!b.ContainsLatLong(a))SetMapStyle(lastOrthoMapStyle)}SetBestMapView([currentView.latlong,a])}function ClipLatitude(a){return Clip(a,minLatitude,maxLatitude)}function ClipLongitude(a){return Clip(a,minLongitude,maxLongitude)}function Clip(a,c,b){if(a<c)return c;if(a>b)return b;return a}function SetZoom(b){Sync3dView();var a=preferredView.MakeCopy();a.SetZoomLevel(b);SetView(a)}function ZoomIn(){Sync3dView();var a=preferredView.MakeCopy();a.SetZoomLevel(currentView.zoomLevel+1);SetView(a)}function ZoomOut(){Sync3dView();var a=preferredView.MakeCopy();a.SetZoomLevel(currentView.zoomLevel-1);SetView(a)}function SetCenterAndZoom(d,b,c){Sync3dView();var a=preferredView.MakeCopy();a.sceneId=null;a.SetCenterLatLong(new Msn.VE.LatLong(d,b));a.SetZoomLevel(c);SetView(a)}function GetCurrentViewMaxZoomLevel(b){var a=b;if(typeof a=="undefined"||a==null)a=preferredView;if(!currentMode)return tileLayerManager.GetMaxTileZoom();return currentMode.GetCurrentMaxZoomLevel(a)}function ObliqueMode(){var q=false,a=null,s=null,b=false,h=false,x=null,y=null,l=false,n=false,k=null,c=null,g=-1,e=null,m=null,r=null,f=[],i=false,d=[];this.Init=function(a){x=a+"/GetBirdsEyeSceneByLocation";y=a+"/GetBirdsEyeSceneById";q=true};this.SetClientToken=function(b){e=b;if(a)a.SetClientToken(e)};this.SetGUID=function(b){m=b;if(a)a.SetGUID(m);if(typeof VEMap!="undefined")r=VEMap._GetMapFromGUID(m)};this.Destroy=function(){e=null;q=false};this.RequestPending=function(){return i};function O(c,d,b){return a.IsValidTile(c,d,b)}function M(b,c,d){return a.GetTileFilename(b,c,d,currentView.mapStyle)}this.GetMiddleTileFilename=function(){return a.GetMiddleTileFilename()};function H(e){if(!a)return 0;var b=new VEPixel(MathRound(originX+offsetX+width/2),MathRound(originY+offsetY+height/2)),f=a.PixelToLatLong(b,e);b.x++;var g=a.PixelToLatLong(b,e),h=Math.sin(DegToRad(f.latitude)),i=Math.sin(DegToRad(g.latitude)),c=earthRadius/2*MathAbs(Math.log((1+h)/(1-h))-Math.log((1+i)/(1-i))),d=earthRadius*MathAbs(DegToRad(f.longitude)-DegToRad(g.longitude));return Math.sqrt(d*d+c*c)}function I(c,b){return a?a.PixelToLatLong(c,b):null}function D(c,d,b){if(a)a.PixelToLatLongAsync(c,d,b);else b(null)}function G(c,b){return a?a.LatLongToPixel(c,b):null}function C(c,d,b){if(a)a.LatLongToPixelAsync(c,d,b);else b(null)}function A(){return 2}function F(a){if(a.zoomLevel>=2)tileLayerManager.SetMarketMaxZoom(2);if(a.zoomLevel<1)a.SetZoomLevel(1);else if(a.zoomLevel>2)a.SetZoomLevel(2)}function Q(){return a}function P(){return a.GetBounds()}function N(){return b}function J(){if(!b)return null;var a={};return a}function E(){if(currentView!=null&&!Msn.VE.MapStyle.IsViewOblique(currentView.mapStyle)&&currentView.zoomLevel>0)if(currentView.zoomLevel<MapControl.Features.BirdsEyeAtZoomLevel){a=null;h=b;b=false;p()}else u(currentView.latlong,"North",false,500)}var w=false;function u(e,i,u,o,m,f,r,s,q){j();l=u;w=r;n=q;if(!R(e)){a=null;h=b;b=false;p(m);return}k=x;c=[];c.push(new VEParameter("latitude",e.latitude));c.push(new VEParameter("longitude",e.longitude));c.push(new VEParameter("level",20));var d="NoSpin";if(f==Msn.VE.BirdsEyeSearchSpinDirection.ClockwiseSpin)d="CounterclockwiseSpin";else if(f==Msn.VE.BirdsEyeSearchSpinDirection.CounterclockwiseSpin)d="ClockwiseSpin";c.push(new VEParameter("spinDirection",'"'+d+'"'));if(i)c.push(new VEParameter("orientation",'"'+i+'"'));else c.push(new VEParameter("orientation",'"'+Msn.VE.Orientation.North+'"'));if(o)g=window.setTimeout(t,o);else{t(m,s);g=-1}}function K(b){if(a&&a.GetID()==b)return;j();l=true;k=y;c=[];c.push(new VEParameter("sceneId",b));t()}function j(){try{if(g!=-1)window.clearTimeout(g)}catch(a){}g=-1}function t(b,d){j();if(!k)return;i=true;if(e)c.push(new VEParameter(Msn.VE.API.Constants.clienttoken,e));function a(a){if(typeof v=="function"&&q)v(a,b,d)}JSONRequestInvoke(k,c,a)}function v(c,f,d){if(r)r.__HandleAuthentication(c);h=b;s=a;a=null;b=false;if(c!=null)if(c.Scene){a=L(c.Scene,d);if(Msn.VE.API&&e)a.SetClientToken(e);a.SetGUID(m);b=true}p(f,d)}function L(a,b){switch(a.O){case 0:a.O=Msn.VE.Orientation.North;break;case 2:a.O=Msn.VE.Orientation.East;break;case 4:a.O=Msn.VE.Orientation.South;break;case 6:a.O=Msn.VE.Orientation.West}return new Msn.VE.ObliqueScene(a.S,a.Q,a.RI,a.O,a.L,null,a.Fcx,a.Fcy,[[a.QA,a.QB,a.QC],[a.QD,a.QE,a.QF],[a.QG,a.QH,a.QI]],[[a.XA,a.XB,a.XC],[a.XD,a.XE,a.XF],[a.XG,a.XH,a.XI]],b)}function p(e){i=false;if(typeof e=="function")if(b)e(a);else e(null);if(l){l=false;if(b){var c=preferredView.MakeCopy();if(!Msn.VE.MapStyle.IsViewOblique(c.mapStyle)){c.SetZoomLevel(1);c.SetCenterLatLong((new Msn.VE.LatLong).Copy(preferredView.latlong))}var f=Msn.VE.MapStyle.IsViewOblique(c.mapStyle)?c.mapStyle:obliqueStyle;c.SetMapStyle(f,a.GetID(),a.GetOrientation());SetView(c);Fire("onobliquechange")}else if(w&&s){a=s;b=true;Fire("obliquerequestunavailable")}else{var c=preferredView.MakeCopy();c.SetMapStyle(lastOrthoMapStyle);if(c.GetViewType()!="latlongRect")c.SetZoomLevel(lastOrthoZoomLevel);SetView(c);Fire("onendmapstyleoblique");Fire("onerror",CreateEvent(currentView.latlong,currentView.zoomLevel,L_ObliqueModeImageNotAvailable_Text))}}if(!n){if(h!=b)if(b)Fire("onobliqueenter");else Fire("onobliqueleave");if(d.length>0)z(b)}n=false}function R(a){if(!a||!f||f.length==0)return false;var c=orthoMode.LatLongToPixel(a,f[0].length),b=VEPixelToQuadKey(c,f[0].length);return o(b,0,f.length-1)}function o(a,d,c){if(c<d)return false;var b=MathFloor((d+c)/2);if(f[b]==a)return true;if(a<f[b])return o(a,d,b-1);return o(a,b+1,c)}function B(a,c){if(i){if(d[a]!=true){var e=d.push({callbackName:a,callback:c});d[a]=true}}else if(typeof c=="function")c(b)}function z(c){var e=d.length;for(var b=0;b<e;b++){var a=d.shift();delete d[a.callbackName];if(typeof a.callback=="function")a.callback(c)}}this.IsValidTile=O;this.GetFilename=M;this.MetersPerPixel=H;this.PixelToLatLong=I;this.PixelToLatLongAsync=D;this.LatLongToPixel=G;this.LatLongToPixelAsync=C;this.GetBounds=P;this.ValidateZoomLevel=F;this.IsAvailable=N;this.UpdateAvailability=E;this.CancelRequest=j;this.GetEventInfo=J;this.GetScene=Q;this.RequestSceneAtLatLong=u;this.RequestScene=K;this.GetCurrentMaxZoomLevel=A;this.GetObliqueAvailability=B}function OrthoMode(){var a=[new Msn.VE.Bounds(1, 17, 0, 0, 2, 2),new Msn.VE.Bounds(18, 19, 35680, 82915, 83740, 113061),new Msn.VE.Bounds(18, 19, 122880, 53248, 155649, 103425),new Msn.VE.Bounds(18, 19, 12379, 112260, 20388, 119266),new Msn.VE.Bounds(18, 19, 80099, 115425, 85051, 119645),new Msn.VE.Bounds(18, 19, 220032, 93184, 240640, 113792)];this.Init=function(){};this.Destroy=function(){};function j(a,b,d){var c=1<<d;return a>=0&&b>=0&&a<c&&b<c}function i(c,d,f,b){var a=new VETileContext;a.XPos=c;a.YPos=d;a.ZoomLevel=f;a.MapStyle=currentView.mapStyle;var e=b.GetTilePath(a);return e}function b(a){return earthCircumference/((1<<a)*tileSize)}function h(d,e){var c=b(e),f=d.x*c-projectionOffset,g=projectionOffset-d.y*c,a=new Msn.VE.LatLong;a.latitude=RadToDeg(Math.PI/2-2*Math.atan(Math.exp(-g/earthRadius)));a.longitude=RadToDeg(f/earthRadius);return a}function e(d,g,e){var b=[];for(var a=0;a<d.length;++a){var c=this.PixelToLatLong(d[a],g);if(Msn.VE.API!=null){var f=new VELatLong(c.latitude,c.longitude);b[a]=f}else b[a]=c}if(e)e(b)}function g(d,f){var e=Math.sin(DegToRad(d.latitude)),g=earthRadius*DegToRad(d.longitude),h=earthRadius/2*Math.log((1+e)/(1-e)),c=b(f),a=new VEPixel;a.x=(projectionOffset+g)/c;a.y=(projectionOffset-h)/c;return a}function d(b,e,d){var c=[];for(var a=0;a<b.length;++a)c[a]=this.LatLongToPixel(b[a],e);if(d)d(c)}function k(c){if(c==undefined)c=currentView;var d=c.zoomLevel,f=c.center.x+mapCenterOffset.x,g=c.center.y+mapCenterOffset.y;for(var b=0;b<a.length;b++){var h=d-a[b].z1,e=tileSize*Math.pow(2,h),k=a[b].x1*e,i=a[b].x2*e,l=a[b].y1*e,j=a[b].y2*e;if(f>=k&&f<=i&&g>=l&&g<=j)if(d>=a[b].z1&&d<=a[b].z2||d<=tileLayerManager.GetMaxTileZoom())return a[b]}return a[0]}function c(e){var f=e.center.x+mapCenterOffset.x,g=e.center.y+mapCenterOffset.y,c=0;for(var b=0;b<a.length;b++){var d=tileSize*Math.pow(2,e.zoomLevel-a[b].z1),j=a[b].x1*d,h=a[b].x2*d,k=a[b].y1*d,i=a[b].y2*d;if(f>=j&&f<=h&&g>=k&&g<=i)c=Math.max(c,a[b].z2)}c=Math.max(c,tileLayerManager.GetMaxTileZoom());return c}function f(d){var f=d.center.x+mapCenterOffset.x,g=d.center.y+mapCenterOffset.y,c=0;for(var b=0;b<a.length;b++){var e=tileSize*Math.pow(2,d.zoomLevel-a[b].z1),j=a[b].x1*e,h=a[b].x2*e,k=a[b].y1*e,i=a[b].y2*e;if(f>=j&&f<=h&&g>=k&&g<=i){c=0;if(a[b].z2>=d.zoomLevel){tileLayerManager.SetMarketMaxZoom(a[b].z2);return}else if(a[b].z2>c){tileLayerManager.SetMarketMaxZoom(a[b].z2);c=a[b].z2;if(c<tileLayerManager.GetMaxTileZoom())if(d.zoomLevel<=tileLayerManager.GetMaxTileZoom())c=d.zoomLevel;else c=tileLayerManager.GetMaxTileZoom()}}}d.SetZoomLevel(c)}this.IsValidTile=j;this.GetFilename=i;this.MetersPerPixel=b;this.PixelToLatLong=h;this.PixelToLatLongAsync=e;this.LatLongToPixel=g;this.LatLongToPixelAsync=d;this.GetBounds=k;this.ValidateZoomLevel=f;this.GetCurrentMaxZoomLevel=c}function ThreeDMode(){var internalOrthoMode=new OrthoMode,bounds=[new Msn.VE.Bounds(1, 17, 0, 0, 2, 2),new Msn.VE.Bounds(18, 19, 35680, 82915, 83740, 113061),new Msn.VE.Bounds(18, 19, 122880, 53248, 155649, 103425),new Msn.VE.Bounds(18, 19, 12379, 112260, 20388, 119266),new Msn.VE.Bounds(18, 19, 80099, 115425, 85051, 119645),new Msn.VE.Bounds(18, 19, 220032, 93184, 240640, 113792)];this.Init=function(){};this.Destroy=function(){};function IsValidTile(b,c,a){return internalOrthoMode.IsValidTile(b,c,a)}function GetFilename(a,b,d,c){return internalOrthoMode.GetFilename(a,b,d,c)}function MetersPerPixel(a){return internalOrthoMode.MetersPerPixel(a)}function PixelToLatLong(pixel){if(!view3DCreated)return null;var lat,lon,latlonvalid,result=spacecontrol.PixelToLatLong(pixel.x,pixel.y);eval(result);if(latlonvalid!=0){var latlong=new Msn.VE.LatLong;latlong.latitude=RadToDeg(lat);latlong.longitude=RadToDeg(lon);return latlong}return null}function PixelToLatLongAsync(d,g,e){var b=[];for(var a=0;a<d.length;++a){var c=this.PixelToLatLong(d[a],g);if(Msn.VE.API!=null){var f=new VELatLong(c.latitude,c.longitude);b[a]=f}else b[a]=c}if(e)e(b)}function LatLongToPixel(latlong){if(!view3DCreated)return null;var x,y,xyvalid=0,result=spacecontrol.LatLongToPixel(parseFloat(latlong.latitude),parseFloat(latlong.longitude));eval(result);if(xyvalid!=0){var pixel=new VEPixel(x,y);return pixel}return null}function LatLongToPixelAsync(b,e,d){var c=[];for(var a=0;a<b.length;++a)c[a]=this.LatLongToPixel(b[a],e);if(d)d(c)}function GetBounds(){return null}function GetCurrentMaxZoomLevel(){return 19}function ValidateZoomLevel(a){if(a.zoomLevel<1)a.SetZoomLevel(1);if(a.zoomLevel>19)a.SetZoomLevel(19)}function _InternalOrthoMode(){return internalOrthoMode}this._InternalOrthoMode=_InternalOrthoMode;this.IsValidTile=IsValidTile;this.GetFilename=GetFilename;this.MetersPerPixel=MetersPerPixel;this.PixelToLatLong=PixelToLatLong;this.PixelToLatLongAsync=PixelToLatLongAsync;this.LatLongToPixel=LatLongToPixel;this.LatLongToPixelAsync=LatLongToPixelAsync;this.GetBounds=GetBounds;this.ValidateZoomLevel=ValidateZoomLevel;this.GetCurrentMaxZoomLevel=GetCurrentMaxZoomLevel}function BoxTool(){var b=document.createElement("div"),a=document.createElement("div"),h,c=0,d=0,e=0,f=0;this.Init=function(){b.className="MSVE_ZoomBox_bg";a.className="MSVE_ZoomBox_fg";b.attachEvent("onmouseup",MouseUp);a.attachEvent("onmouseup",MouseUp);if(map!=null){map.appendChild(b);map.appendChild(a)}};this.Destroy=function(){b.detachEvent("onmouseup",MouseUp);a.detachEvent("onmouseup",MouseUp);if(map!=null){map.removeChild(b);map.removeChild(a)}};function k(i){if(typeof VE_ContextMenu!="undefined"&&VE_ContextMenu!=null){VE_ContextMenu.RemoveContextPin();VE_ContextMenu.CloseMenu()}var b=Gimme.Screen.getMousePosition(i);h=g(p_elSource).getPagePosition();c=e=b.x-h.x+offsetX;d=f=b.y-h.y+offsetY;j(c,d,1,1);o();if(a.setCapture)a.setCapture()}function l(i){var a=Gimme.Screen.getMousePosition(i);e=a.x-h.x+offsetX;f=a.y-h.y+offsetY;var g=e-c,b=f-d;j(Math.min(c,c+g),Math.min(d,d+b),Math.abs(g),Math.abs(b))}function m(j){if(MathAbs(c-e)>1&&MathAbs(d-f)>1){var b=preferredView.MakeCopy();b.SetZoomLevel(currentView.zoomLevel);if(!j.shiftKey)b.SetPixelRectangle(new Msn.VE.PixelRectangle(new VEPixel(originX+c,originY+d),new VEPixel(originX+e,originY+f)));else{var h=width/MathAbs(e-c),i=height/MathAbs(f-d),g=h<i?h:i;b.SetPixelRectangle(new Msn.VE.PixelRectangle(new VEPixel(originX-Math.floor(width*(g-1)/2),originY-Math.floor(height*(g-1)/2)),new VEPixel(originX+Math.floor(width*(g+1)/2),originY+Math.floor(height*(g+1)/2))))}SetView(b)}setTimeout(n,250);if(a.releaseCapture)a.releaseCapture()}function j(e,f,d,c){i(b,e+1,f+1,d,c);i(a,e,f,d,c)}function i(a,d,e,c,b){a.style.left=d+"px";a.style.top=e+"px";a.style.width=c+"px";a.style.height=b+"px"}function o(){b.style.display="block";a.style.display="block"}function n(){b.style.display="none";a.style.display="none"}this.OnMouseDown=k;this.OnMouseMove=l;this.OnMouseUp=m}function PanTool(){var b=false,a=null,c=500;this.Init=function(){};this.Destroy=function(){};function e(a){b=false;var d=Gimme.Screen.getMousePosition(a);lastMouseX=d.x;lastMouseY=d.y;if(p_elSource.setCapture)p_elSource.setCapture();var e=g(p_elSource).getPagePosition();x=e.x;y=e.y;var f=originX+offsetX+lastMouseX-x,h=originY+offsetY+lastMouseY-y,c=CreateEvent(currentMode.PixelToLatLong(new VEPixel(f,h),currentView.zoomLevel),currentView.zoomLevel,null,null,null,a.button,0,a);Fire("onstartpan",c);FireDefaultEvent("onmousedown",c)}function f(e){var d=Gimme.Screen.getMousePosition(e),a=d.x,c=d.y;PanMap(lastMouseX-a,lastMouseY-c);if(lastMouseX!=a||lastMouseY!=c)b=true;lastMouseX=a;lastMouseY=c}function h(c){ComputeCenterPoint(true);if(p_elSource.releaseCapture)p_elSource.releaseCapture();if(b){Fire("onendpan");Fire("onchangeview");b=false;d()}var e=Gimme.Screen.getMousePosition(c),f=originX+offsetX+e.x-x,g=originY+offsetY+e.y-y,a=CreateEvent(currentMode.PixelToLatLong(new VEPixel(f,g),currentView.zoomLevel),currentView.zoomLevel,null,null,null,c.button,0,c);FireDefaultEvent("onmouseup",a);FireDefaultEvent("onclick",a);return a}function d(){if(a!=null)window.clearTimeout(a);a=window.setTimeout(i,c)}function i(){a=null;$VE_A.Log($VE_A.PgName.Map,"Pan","Mouse")}this.OnMouseDown=e;this.OnMouseMove=f;this.OnMouseUp=h}function TargetTool(){var b=this,f=Msn.VE.Geometry,d,a,e,c;this.centeringTrigger=false;g();function g(){d=false;a=false;e=null;c=false;m_dragging=false}this.init=function(){if(Msn.VE.MapStyle.IsViewOblique(currentView.mapStyle))b.trackMovement()};this.destroy=function(){b.ignoreMovement();f=null};this.isOutOfBounds=function(){return a};this.trackMovement=function(){if(!d){p_elSource.attachEvent("onmousemove",b.OnMouseMove);d=true}};this.ignoreMovement=function(){p_elSource.detachEvent("onmousemove",b.OnMouseMove);d=a=b.centeringTrigger=false;p_this.SetCursor(cssCursors.Grab)};this.setBoundingArea=function(a){if(a instanceof f.Rectangle)e=a};this.OnMouseDown=function(){};this.OnMouseMove=function(b){if(e==null)return;if(!dragging){var d=Gimme.Screen.getMousePosition(b);if(!e.containsPoint(d)){if(!hijackMouseMove&&(!c||p_elSource.style.cursor!=cssCursors.Target)){a=c=true;p_this.SetCursor(cssCursors.Target)}}else if(c){a=c=false;p_this.SetCursor(cssCursors.Grab)}}};this.OnMouseUp=function(c){if(typeof VE_ContextMenu!="undefined"&&VE_ContextMenu!=null){VE_ContextMenu.RemoveContextPin();VE_ContextMenu.CloseMenu()}var g=c.which||c.button;if(a&&g==1){c.cancelBubble=true;b.centeringTrigger=true;var e=originX+offsetX+Math.round(GetMapWidth()/2),f=originY+offsetY+Math.round(GetMapHeight()/2),d=currentMode.PixelToLatLong(new VEPixel(e,f),currentView.zoomLevel);SetCenter(d.latitude,d.longitude)}}}function GetTrafficAvailability(){return trafficAvailable}function GetSlidingExpirationForAutoRefresh(){return 1800000}function GetAutoRefreshRate(){return 300000}function GetMarketsFile(){return "http://t1.traffic.virtualearth.net/incidents/markets.js"}function GetIncidentsFile(){return "http://t1.traffic.virtualearth.net/incidents/market"}var setTrafficViewflag=true;function SetTrafficView(){var a=new VETileSourceSpecification;a.ID=trafficTiles;a.SourceName=Msn.VE.API?Msn.VE.API.Constants.traffictileserver:"%0t%2.tiles.virtualearth.net/tiles/t%4";var b="?";if(a.SourceName.match(/\?/))b="&";a.SourceName=a.SourceName+b+"tc="+Math.floor((new Date).getTime()/(GetAutoRefreshRate()*.8));a.NumServers=2;tileLayerManager.AddTileSource(a);var c=typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null;tileLayerManager.LoadTileLayer("Traffic",a.ID,.6,c?2:3)}function VETileLayerManager(){var d=[],b=[],a=[],c={},e={},g={},k=null,i=true,h=19;this.AddTileSource=function(a){d[a.ID]=a;if(g[a.ID])this.SetClientToken(a.ID,g[a.ID])};this.Add3DTileSource=function(e,c,h){if(trafficTiles==e)return;if(1==b[e].zIndex)return;if(typeof b[e].IsVisible!="undefined"&&b[e].IsVisible==false)return;var g=c.MaxZoom==1?21:c.MaxZoom,a='ID="'+c.ID+'" TILESOURCE="'+c.SourceName+'" MINZOOM="'+c.MinZoom+'" MAXZOOM="'+g+'"',d=c.Bounds;if(typeof d!="undefined"&&d!=null){a=a+' Bounds="';for(var f=0;f<d.length;f++){if(f>0)a=a+",";a=a+d[f].TopLeftLatLong.Longitude+","+d[f].BottomRightLatLong.Latitude+","+d[f].BottomRightLatLong.Longitude+","+d[f].TopLeftLatLong.Latitude}a=a+'"'}h.AddImageSource(e,c.ID,a,b[e].zIndex,b[e].opacity)};this.Remove3DTileSource=function(b,a,c){c.RemoveImageSource(b,a.ID)};this.AddAllTileSourcesTo3D=function(d){if(typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null)for(var c=0;c<a.length;c++)this.Add3DTileSource(a[c],b[a[c]],d)};this.AddMapServiceLayersTo3D=function(f){for(var d=0;d<a.length;d++){var e=a[d],c=b[e];if(c!=null&&c.ID.indexOf("VE_MapServiceLayer")==1)tileLayerManager.Add3DTileSource(e,c,f)}};this.DeleteMapServiceLayersFrom3D=function(f,e){for(var c=0;c<e.length;c++){var d=e[c],a=b[d];if(a!=null&&a.ID.indexOf("VE_MapServiceLayer")==1)f.RemoveImageSource(d,a.ID)}};this.LoadBaseLayer=function(c,e,f,g){if(b[c]==null||typeof b[c]=="undefined")a.push(c);b[c]=d[e];b[c].opacity=f;b[c].zIndex=g};this.HideBaseTileLayer=function(){this.SetTileLayerVisibility(mapTiles,false);this.RefreshTileLayer(mapTiles)};this.ShowBaseTileLayer=function(){this.SetTileLayerVisibility(mapTiles,true);this.RefreshTileLayer(mapTiles)};this.SetTileLayerVisibility=function(c,a){if(b[c]!=null&&typeof a!="undefined")b[c].IsVisible=a};this.LoadTileLayer=function(g,h,m,n){if(!i)return;if(b[g]==null||typeof b[g]=="undefined")a.push(g);b[g]=d[h];if(c[g]){ClearTiles(c[g]);if(typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null){var j=f();if(typeof j!="undefined"&&j!=null)tileLayerManager.Remove3DTileSource(g,d[h],j)}}if(typeof b[g].IsVisible!="undefined"&&b[g].IsVisible==false)return;c[g]=[];e[g]=[];if(m!=null&&m!="undefined")b[g].opacity=m;else b[g].opacity=1;if(n!=null&&n!="undefined")b[g].zIndex=n;else b[g].zIndex=1;var l=false;if(typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null){var j=f();if(typeof j!="undefined"&&j!=null)tileLayerManager.Add3DTileSource(g,d[h],j)}var k=d[h].MaxZoom;if(k==1)k=d[mapTiles].MaxZoom;k=19;if(currentView.zoomLevel>=d[h].MinZoom&&currentView.zoomLevel<=k)if(d[h].Bounds!="undefined"&&d[h].Bounds!=null)l=tileLayerManager.CheckTilesAvailability(h,g);else l=true;if(l&&b[g].LoadTiles){b[g].isActive=true;for(var p=tileViewportY1;p<=tileViewportY2;p++)for(var o=tileViewportX1;o<=tileViewportX2;o++){var q=RequestTile(o,p,currentView.zoomLevel,currentView.mapStyle,b[g],h,b[g].opacity,b[g].zIndex);c[g].push(q)}}};this.SetViewPort=function(){map.style.top="0px";map.style.left="0px";originX=MathRound(currentView.center.x-width/2);originY=MathRound(currentView.center.y-height/2);offsetX=0;offsetY=0;var a=this.CalculateTileViewPort(true,originX,originY,originX+width,originY+height);tileViewportX1=a[0];tileViewportY1=a[1];tileViewportX2=a[2];tileViewportY2=a[3];tileViewportWidth=a[4];tileViewportHeight=a[5];Fire("onmapoffsetreset")};this.CalculateTileViewPort=function(f,b,d,c,e){var a=[];b=(b-buffer)/tileSize;d=(d-buffer)/tileSize;c=(c+buffer)/tileSize;e=(e+buffer)/tileSize;if(f){b=MathFloor(b);d=MathFloor(d);c=MathFloor(c);e=MathFloor(e)}a[0]=b;a[1]=d;a[2]=c;a[3]=e;a[4]=a[2]-a[0]+1;a[5]=a[3]-a[1]+1;return a};this.GetViewPort=function(){var a=[];a[0]=tileViewportX1;a[1]=tileViewportY1;a[2]=tileViewportX2;a[3]=tileViewportY2;a[4]=tileViewportWidth;a[5]=tileViewportHeight;return a};this.FinalizeView=function(){zooming=false;for(var b=0;b<a.length;b++){if(e[a[b]]){ClearTiles(e[a[b]]);e[a[b]]=null}for(var d=0;d<c[a[b]].length;d++){var f=c[a[b]];f[d].SwapStates();f[d].ClearSteps();f[d].SetFactor(0);f[d].ClearStates()}}for(var b=0;b<pushpins.length;b++){pushpins[b].SwapStates();pushpins[b].ClearSteps();pushpins[b].SetFactor(0)}if(copyright)copyright.Update();if(previousMapStyle!=currentView.mapStyle){Fire("onchangemapstyle");previousMapStyle=currentView.mapStyle}if(previousZoomLevel!=currentView.zoomLevel)Fire("onendzoom");Fire("onchangeview");try{CollectGarbage()}catch(g){}};this.CheckLayerUpdatability=function(d){var e=false;if(typeof b[a[d]].LoadTiles=="undefined"||b[a[d]].LoadTiles!=false){if(b[a[d]].isActive==false)this.RefreshTileLayer(b[a[d]].ID);if(d>=0)e=b[a[d]].ID==mapTiles||c[a[d]].length>0}return e};this.PanView=function(){if(!i)return;if(zooming)return;var h=originX+offsetX,j=originY+offsetY,k=MathFloor((h-buffer)/tileSize),m=MathFloor((j-buffer)/tileSize),l=MathFloor((h+width+buffer)/tileSize),n=MathFloor((j+height+buffer)/tileSize);while(tileViewportX1<k){for(var e=tileViewportHeight-1;e>=0;e--)for(var d=0;d<a.length;d++)if(tileLayerManager.CheckLayerUpdatability(d)){var g=c[a[d]].splice(e*tileViewportWidth,1)[0];try{g.RemoveFromMap()}catch(o){}}tileViewportX1++;tileViewportWidth--}while(tileViewportX1>k){tileViewportX1--;tileViewportWidth++;for(var e=0;e<tileViewportHeight;e++)for(var d=0;d<a.length;d++)if(tileLayerManager.CheckLayerUpdatability(d)){var g=RequestTile(tileViewportX1,tileViewportY1+e,currentView.zoomLevel,currentView.mapStyle,b[a[d]],a[d],b[a[d]].opacity,b[a[d]].zIndex);c[a[d]].splice(e*tileViewportWidth,0,g)}}while(tileViewportY1<m){for(var f=0;f<tileViewportWidth;f++)for(var d=0;d<a.length;d++)if(tileLayerManager.CheckLayerUpdatability(d)){var g=c[a[d]].shift();try{g.RemoveFromMap()}catch(o){}}tileViewportY1++;tileViewportHeight--}while(tileViewportY1>m){tileViewportY1--;tileViewportHeight++;for(var f=tileViewportWidth-1;f>=0;f--)for(var d=0;d<a.length;d++)if(tileLayerManager.CheckLayerUpdatability(d)){var g=RequestTile(tileViewportX1+f,tileViewportY1,currentView.zoomLevel,currentView.mapStyle,b[a[d]],a[d],b[a[d]].opacity,b[a[d]].zIndex);c[a[d]].unshift(g)}}while(tileViewportX2>l){for(var e=tileViewportHeight-1;e>=0;e--)for(var d=0;d<a.length;d++)if(tileLayerManager.CheckLayerUpdatability(d)){var g=c[a[d]].splice(e*tileViewportWidth+tileViewportWidth-1,1)[0];try{g.RemoveFromMap()}catch(o){}}tileViewportX2--;tileViewportWidth--}while(tileViewportX2<l){tileViewportX2++;tileViewportWidth++;for(var e=0;e<tileViewportHeight;e++)for(var d=0;d<a.length;d++)if(tileLayerManager.CheckLayerUpdatability(d)){var g=RequestTile(tileViewportX2,tileViewportY1+e,currentView.zoomLevel,currentView.mapStyle,b[a[d]],a[d],b[a[d]].opacity,b[a[d]].zIndex);c[a[d]].splice(e*tileViewportWidth+tileViewportWidth-1,0,g)}}while(tileViewportY2>n){for(var f=0;f<tileViewportWidth;f++)for(var d=0;d<a.length;d++)if(tileLayerManager.CheckLayerUpdatability(d)){var g=c[a[d]].pop();try{g.RemoveFromMap()}catch(o){}}tileViewportY2--;tileViewportHeight--}while(tileViewportY2<n){tileViewportY2++;tileViewportHeight++;for(var f=0;f<tileViewportWidth;f++)for(var d=0;d<a.length;d++)if(tileLayerManager.CheckLayerUpdatability(d)){var g=RequestTile(tileViewportX1+f,tileViewportY2,currentView.zoomLevel,currentView.mapStyle,b[a[d]],a[d],b[a[d]].opacity,b[a[d]].zIndex);c[a[d]].push(g)}}};this.StepAnimation=j;this.zoomView=function(g){if(!i)return;var l=originX+offsetX,m=originY+offsetY,o=currentView.zoomLevel,k=g.zoomLevel,h=MathRound(g.center.x-width/2),j=MathRound(g.center.y-height/2);e[mapTiles]=c[mapTiles];for(var d=0;d<a.length;d++)if(b[a[d]].ID==mapTiles)c[a[d]]=[];else ClearTiles(c[a[d]]);for(var f=0;f<e[mapTiles].length;f++)e[mapTiles][f].PrepareBaseTile(l,m,o,h,j,k);for(var d=0;d<pushpins.length;d++)pushpins[d].PrepareForZoom(h,j,k);currentView.Destroy();currentView=g;var n=[];n=e[mapTiles];this.SetViewPort();this.RefreshTileLayers();e[mapTiles]=n;for(var f=0;f<c[mapTiles].length;f++)c[mapTiles][f].PrepareSwapTile(l,m,o,h,j,k);zoomCounter=1;this.StepAnimation()};function j(){if(!zooming)return;for(var a=0;a<e[mapTiles].length;a++)e[mapTiles][a].SetFactor(zoomCounter);for(var a=0;a<c[mapTiles].length;a++)c[mapTiles][a].SetFactor(zoomCounter);for(var b=0;b<pushpins.length;b++)pushpins[b].SetFactor(zoomCounter);if(zoomCounter<zoomTotalSteps){zoomCounter++;window.setTimeout(j,1)}else{zoomCounter=0;tileLayerManager.FinalizeView()}}this.ClearTileLayers=function(){for(var d=0;d<a.length;d++){ClearTiles(c[a[d]]);b[a[d]]=null;delete b[a[d]];a[d]=null}a.length=0};function f(){if(typeof Msn.VE.API.Globals.vemapinstances=="undefined"||Msn.VE.API.Globals.vemapinstances==null)return null;var b=0;for(var a in Msn.VE.API.Globals.vemapinstances)if(Msn.VE.API.Globals.vemapinstances[a]instanceof VEMap&&Msn.VE.API.Globals.vemapinstances[a].vemapcontrol&&Msn.VE.API.Globals.vemapinstances[a].GetMapMode()==VEMapMode.Mode3D)return Msn.VE.API.Globals.vemapinstances[a].vemapcontrol.Get3DControl();return null}this.ClearTileLayer=function(d){if(b[d]!=null&&b[d]!="undefined"){if(typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null){var g=f();if(typeof g!="undefined"&&g!=null)g.RemoveImageSource(d,b[d].ID)}ClearTiles(c[d]);b[d]=null;delete b[d]}for(var e=0;e<a.length;e++)if(a[e]==d){a[e]=null;a.splice(e,1)}};this.RefreshTileLayers=function(){if(a!=null)for(var c=0;c<a.length;c++)this.LoadTileLayer(a[c],b[a[c]].ID,b[a[c]].opacity,b[a[c]].zIndex)};this.RefreshTileLayer=function(a){this.LoadTileLayer(a,b[a].ID,b[a].opacity,b[a].zIndex)};this.SetTileSource=function(a){var b=new VETileSourceSpecification;b.ID=a.ID;b.SourceName=a.TileSource;b.NumServers=a.NumServers;b.Bounds=a.Bounds;if(typeof a.MinZoomLevel!="undefined"&&a.MinZoomLevel!=null)b.MinZoom=a.MinZoomLevel;if(typeof a.MaxZoomLevel!="undefined"&&a.MaxZoomLevel!=null){b.MaxZoom=a.MaxZoomLevel;if(b.MaxZoom>h)h=b.MaxZoom}if(a.GetTilePath!="undefined"&&a.GetTilePath!=null)b.GetTilePath=a.GetTilePath;tileLayerManager.AddTileSource(b)};this.DeleteTileSource=function(f){if(d[f]!=null&&d[f]!="undefined"){d[f]=null;delete d[f]}if(a!=null)for(var e=0;e<a.length;e++)if(b[a[e]]!=null&&b[a[e]]!="undefined"&&b[a[e]].ID==f){ClearTiles(c[a[e]]);b[a[e]]=null;delete b[a[e]];a[e]=null;a.splice(e,1)}};this.CheckTilesAvailability=function(g,n){if(typeof d[g].LoadTiles!="undefined"&&d[g].LoadTiles==false)return false;var k=PixelToLatLong(new VEPixel(0,0)),j=PixelToLatLong(new VEPixel(width,height));if(k==null||j==null)return;var a=k.latitude,c=j.longitude,e=j.latitude,f=k.longitude;if(a<e){var i=a;a=e;e=i}if(c<f){var i=c;c=f;f=i}var l=new Msn.VE.LatLongRectangle(new Msn.VE.LatLong(a,f),new Msn.VE.LatLong(e,c)),o=d[g].Bounds.length;for(var h=0;h<o;h++){a=d[g].Bounds[h].TopLeftLatLong.Latitude;c=d[g].Bounds[h].BottomRightLatLong.Longitude;e=d[g].Bounds[h].BottomRightLatLong.Latitude;f=d[g].Bounds[h].TopLeftLatLong.Longitude;if(a<e){var i=a;a=e;e=i}if(c<f){var i=c;c=f;f=i}var m=new Msn.VE.LatLongRectangle(new Msn.VE.LatLong(a,f),new Msn.VE.LatLong(e,c));if(tileLayerManager.BBOverlap(l,m))return true}b[n].isActive=false;return false};this.BBOverlap=function(a,b){return this.RectInBoundingBox(b,a)};this.RectInBoundingBox=function(a,b){return !(a.southeast.latitude>b.northwest.latitude||a.southeast.longitude<b.northwest.longitude||a.northwest.latitude<b.southeast.latitude||a.northwest.longitude>b.southeast.longitude)};this.ShowTrafficLegend=function(a){k=a;Fire("onapitrafficdisplay")};this.HideTrafficLegend=function(){Fire("onapitraffichide")};this.GetTimeStamp=function(){return k};this.GetMaxTileZoom=function(){return h};this.SetMarketMaxZoom=function(a){marketMaxZoom=a;d[mapTiles].MaxZoom=a};this.SetClientToken=function(a,b){g[a]=b;if(d[a])d[a].SetClientToken(b)};this.SetPrintable=function(f){if(f)for(var b=0;b<a.length;b++){var e=c[a[b]].length;for(var d=0;d<e;d++)c[a[b]][d].AddPrintTile()}else for(var b=0;b<a.length;b++){var e=c[a[b]].length;for(var d=0;d<e;d++)c[a[b]][d].RemovePrintTile()}};this.RePositionPrintTiles=function(){for(var b=0;b<a.length;b++){var e=c[a[b]].length;for(var d=0;d<e;d++)c[a[b]][d].RePositionPrintTile()}}}function VETileSourceSpecification(){this.ID="";this.SourceName="";this.OriginalName=null;this.NumServers=0;this.Bounds=null;this.MinZoom=minZoom;this.MaxZoom=1;this.IsVisible=true;this.LoadTiles=true;this.GetTilePath=function(a){try{if(a!=null&&a!="undefined"){var e="",b=0;for(var c=a.ZoomLevel;c>0;c--){b=0;var d=1<<c-1;if((a.XPos&d)!=0)b++;if((a.YPos&d)!=0)b+=2;e+=b+""}var c=b%this.NumServers;return this.SourceName.replace(/%1/g,a.MapStyle).replace(/%2/g,c).replace(/%3/g,a.MapStyle).replace(/%4/g,e).replace(/%5/g,a.MapStyle==roadStyle?"png":"jpeg").replace(/%6/g,generations[a.MapStyle])}else return ""}catch(f){}};this.SetClientToken=function(b){if(this.OriginalName)this.SourceName=this.OriginalName;else this.OriginalName=this.SourceName;if(b){var a;if(this.SourceName.indexOf("?")>=0)a="&";else a="?";this.SourceName=this.SourceName.concat(a,Msn.VE.API.Constants.clienttoken,"=",b)}else this.OriginalName=null}}function VETileLayerSpecification(){this.ID="";this.ZIndex=0;this.Opacity=1}function VETileContext(){this.XPos=0;this.YPos=0;this.ZoomLevel=0;this.MapStyle=""}VEAuthenticationCode=function(){};VEAuthenticationCode.None=0;VEAuthenticationCode.NoToken=1;VEAuthenticationCode.TokenValid=2;VEAuthenticationCode.TokenInvalid=3;VEAuthenticationCode.TokenExpired=4;VEAuthenticationCode.TokenIPInvalid=5;VEAuthenticationCode.TokenExpiredAndIPInvalid=6;VEAuthenticationCode.TokenValidButNotAuthorized=7;this.__HandleAuthentication=function(a){if(a&&a.ResponseSummary&&a.ResponseSummary.AuthResultCode){var b=a.ResponseSummary.AuthResultCode;switch(b){case VEAuthenticationCode.TokenExpired:case VEAuthenticationCode.TokenExpiredAndIPInvalid:this.Fire("ontokenexpire");break;case VEAuthenticationCode.TokenInvalid:case VEAuthenticationCode.TokenIPInvalid:case VEAuthenticationCode.TokenValidButNotAuthorized:this.Fire("ontokenerror")}}};this.SetCenter=SetCenter;this.SetCenterAccurate=SetCenterAccurate;this.SetMapStyle=SetMapStyle;this.SetScaleBarDistanceUnit=SetScaleBarDistanceUnit;this.SetScaleBarVisibility=SetScaleBarVisibility;this.OnView3DScaleBarPositionUpdate=OnView3DScaleBarPositionUpdate;this.GetCenterLatitude=GetCenterLatitude;this.GetCenterLongitude=GetCenterLongitude;this.GetLatitude=GetLatitude;this.GetLongitude=GetLongitude;this.GetY=GetY;this.GetX=GetX;this.LatLongToPixel=LatLongToPixel;this.LatLongToPixelAsync=LatLongToPixelAsync;this.PixelToLatLong=PixelToLatLong;this.PixelToLatLongAsync=PixelToLatLongAsync;this.GetZoomLevel=GetZoomLevel;this.GetMapStyle=GetMapStyle;this.GetMapMode=GetMapMode;this.GetMode=GetMode;this.GetAltitude=$MVEM.IsEnabled(MapControl.Features.MapStyle.View3D)?GetAltitude:function(){NotSupportedMethod("VEMapControl","GetAltitude")};this.GetDirection=$MVEM.IsEnabled(MapControl.Features.MapStyle.View3D)?GetDirection:function(){NotSupportedMethod("VEMapControl","GetDirection")};this.GetTilt=$MVEM.IsEnabled(MapControl.Features.MapStyle.View3D)?GetTilt:function(){NotSupportedMethod("VEMapControl","GetTilt")};this.GetMetersPerPixel=GetMetersPerPixel;this.Fill=Fill;this.Resize=Resize;this.PanMap=PanMap;this.ContinuousPan=ContinuousPan;this.StopContinuousPan=StopContinuousPan;this.StopKeyboardPan=StopKeyboardPan;this.PanToLatLong=PanToLatLong;this.PanByPixel=PanByPixel;this.GetPushpins=GetPushpins;this.AddPushpin=AddPushpin;this.RemovePushpin=RemovePushpin;this.ClearPushpins=ClearPushpins;this.GetPushpinMapPixel=GetPushpinMapPixel;this.SetViewport=SetViewport;this.SetBestMapView=SetBestMapView;this.ClipLatitude=ClipLatitude;this.ClipLongitude=ClipLongitude;this.GetBestMapViewBounds=GetBestMapViewBounds;this.IncludePointInViewport=IncludePointInViewport;this.SetZoom=SetZoom;this.SetTilt=$MVEM.IsEnabled(MapControl.Features.MapStyle.View3D)?SetTilt:function(){NotSupportedMethod("VEMapControl","SetTilt")};this.SetDirection=$MVEM.IsEnabled(MapControl.Features.MapStyle.View3D)?SetDirection:function(){NotSupportedMethod("VEMapControl","SetDirection")};this.SetAltitude=$MVEM.IsEnabled(MapControl.Features.MapStyle.View3D)?SetAltitude:function(){NotSupportedMethod("VEMapControl","SetAltitude")};this.ZoomIn=ZoomIn;this.ZoomOut=ZoomOut;this.SetCenterAndZoom=SetCenterAndZoom;this.AddLine=AddLine;this.RemoveLine=RemoveLine;this.ClearLines=ClearLines;this.AttachEvent=AttachEvent;this.DetachEvent=DetachEvent;this.AttachCustomEvent=AttachCustomEvent;this.DetachCustomEvent=DetachCustomEvent;this.FireCustomEvent=FireCustomEvent;this.DisposeAllCustomEvent=DisposeAllCustomEvent();this.CreateEvent=CreateEvent;this.Fire=Fire;this.IsObliqueAvailable=IsObliqueAvailable;this.GetObliqueScene=GetObliqueScene;this.SetAnimationEnabled=SetAnimationEnabled;this.IsAnimationEnabled=IsAnimationEnabled;this.SetObliqueScene=$MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye)?SetObliqueScene:function(){NotSupportedMethod("VEMapControl","SetObliqueScene")};this.SetObliqueLocation=$MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye)?SetObliqueLocation:function(){NotSupportedMethod("VEMapControl","SetObliqueLocation")};this.SetObliqueOrientation=$MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye)?SetObliqueOrientation:function(){NotSupportedMethod("VEMapControl","SetObliqueOrientation")};this.SetView=SetView;this.Debug=Debug;this.GetResponseRangeCounts=GetResponseRangeCounts;this.ResetResponseRangeCounts=ResetResponseRangeCounts;this.GetFailureRate=GetFailureRate;this.SetTrafficView=$MVEM.IsEnabled(MapControl.Features.Traffic.Enabled)?SetTrafficView:function(){NotSupportedMethod("VEMapControl","SetTrafficView")};this.GetTrafficAvailability=GetTrafficAvailability;this.GetMarketsFile=GetMarketsFile;this.GetIncidentsFile=GetIncidentsFile;this.GetSlidingExpirationForAutoRefresh=$MVEM.IsEnabled(MapControl.Features.Traffic.Enabled)?GetSlidingExpirationForAutoRefresh:function(){NotSupportedMethod("VEMapControl","GetSlidingExpirationForAutoRefresh")};this.GetAutoRefreshRate=$MVEM.IsEnabled(MapControl.Features.Traffic.Enabled)?GetAutoRefreshRate:function(){NotSupportedMethod("VEMapControl","GetAutoRefreshRate")};this.GetMapLegend=GetMapLegend;this.SetFocus=SetFocus;this.GetCurrentMode=GetCurrentMode;this.GetObliqueMode=GetObliqueMode;this.GetOrthoMode=GetOrthoMode;this.GetMapWidth=GetMapWidth;this.GetMapHeight=GetMapHeight;this.GetCurrentMapView=GetCurrentMapView;this.SetBaseTileSource=SetBaseTileSource;this.SetTileSource=tileLayerManager.SetTileSource;this.SetTileLayerVisibility=tileLayerManager.SetTileLayerVisibility;this.AddMapServiceLayersTo3D=tileLayerManager.AddMapServiceLayersTo3D;this.DeleteMapServiceLayersFrom3D=tileLayerManager.DeleteMapServiceLayersFrom3D;this.LoadTileLayer=tileLayerManager.LoadTileLayer;this.ClearTileLayer=tileLayerManager.ClearTileLayer;this.ClearTileLayers=tileLayerManager.ClearTileLayers;this.DeleteTileSource=tileLayerManager.DeleteTileSource;this.HideBaseTileLayer=tileLayerManager.HideBaseTileLayer;this.ShowBaseTileLayer=tileLayerManager.ShowBaseTileLayer;this.RefreshTileLayer=tileLayerManager.RefreshTileLayer;this.RefreshTileLayers=tileLayerManager.RefreshTileLayers;this.ShowTrafficLegend=$MVEM.IsEnabled(MapControl.Features.Traffic.Enabled)?tileLayerManager.ShowTrafficLegend:function(){NotSupportedMethod("VEMapControl","ShowTrafficLegend")};this.HideTrafficLegend=$MVEM.IsEnabled(MapControl.Features.Traffic.Enabled)?tileLayerManager.HideTrafficLegend:function(){NotSupportedMethod("VEMapControl","HideTrafficLegend")};this.GetTimeStamp=$MVEM.IsEnabled(MapControl.Features.Traffic.Enabled)?tileLayerManager.GetTimeStamp:function(){NotSupportedMethod("VEMapControl","GetTimeStamp")};this.GetMaxTileZoom=tileLayerManager.GetMaxTileZoom;this.PanView=tileLayerManager.PanView;this.LoadBaseLayer=tileLayerManager.LoadBaseLayer;this.GetCurrentViewMaxZoomLevel=GetCurrentViewMaxZoomLevel;this.SetTilePixelBuffer=SetTilePixelBuffer;this.SetClientToken=SetClientToken;this.SetMapHeight=SetMapHeight;this.GetMapSurface=GetMapSurface;this.EnableMode=EnableMode;this._Enable3DMode=$MVEM.IsEnabled(MapControl.Features.MapStyle.View3D)?_Enable3DMode:function(){NotSupportedMethod("VEMapControl","_Enable3DMode")};this._Disable3DMode=_Disable3DMode;this.ControlReady=ControlReady;this.Get3DVisibleArea=$MVEM.IsEnabled(MapControl.Features.MapStyle.View3D)?Get3DVisibleArea:function(){NotSupportedMethod("VEMapControl","Get3DVisibleArea")};this.Get3DControl=$MVEM.IsEnabled(MapControl.Features.MapStyle.View3D)?Get3DControl:function(){NotSupportedMethod("VEMapControl","Get3DControl")};this.IsModeEnabled=IsModeEnabled;this.Sync3dView=$MVEM.IsEnabled(MapControl.Features.MapStyle.View3D)?Sync3dView:function(){NotSupportedMethod("VEMapControl","Sync3dView")};this.OnBeginCameraUpdate=$MVEM.IsEnabled(MapControl.Features.MapStyle.View3D)?OnBeginCameraUpdate:function(){NotSupportedMethod("VEMapControl","OnBeginCameraUpdate")};this.OnEndCameraUpdate=$MVEM.IsEnabled(MapControl.Features.MapStyle.View3D)?OnEndCameraUpdate:function(){NotSupportedMethod("VEMapControl","OnEndCameraUpdate")};this.IsCameraFlying=$MVEM.IsEnabled(MapControl.Features.MapStyle.View3D)?IsCameraFlying:function(){NotSupportedMethod("VEMapControl","IsCameraFlying")};this.Show3DTraffic=$MVEM.IsEnabled(MapControl.Features.MapStyle.View3D)?Show3DTraffic:function(){NotSupportedMethod("VEMapControl","Show3DTraffic")};this.Remove3DTraffic=$MVEM.IsEnabled(MapControl.Features.MapStyle.View3D)?Remove3DTraffic:function(){NotSupportedMethod("VEMapControl","Remove3DTraffic")};this.Show3DBirdseye=$MVEM.IsEnabled(MapControl.Features.MapStyle.View3D)?Show3DBirdseye:function(){NotSupportedMethod("VEMapControl","Show3DBirdseye")};this.IterativeCameraRefinement=$MVEM.IsEnabled(MapControl.Features.MapStyle.View3D)?IterativeCameraRefinement:function(){NotSupportedMethod("VEMapControl","IterativeCameraRefinement")};this.SetChildDiv=SetChildDiv;this.EnableGeoCommunity=EnableGeoCommunity;this.IsGeoCommunityEnabled=IsGeoCommunityEnabled;this.HijackMouseCursor=HijackMouseCursor;this.IsHijackMouseCursor=IsHijackMouseCursor;this.GetOffsetX=GetOffsetX;this.GetOriginY=GetOriginY;this.GetOriginX=GetOriginX;this.GetOffsetY=GetOffsetY;this.GetCenterOffset=GetCenterOffset;this.SetCenterOffset=SetCenterOffset;this.UpdatePreferredView=UpdatePreferredView;this.GetGraphic=GetGraphic;this.GetCurrentTileViewPort=GetCurrentTileViewPort;this.CalculateTileViewPort=CalculateTileViewPort;this.CreateDashboard=CreateDashboard;this.GetLastViewChangeType=GetLastViewChangeType;this.SetOn3DAnimationInterruptedCallback=$MVEM.IsEnabled(MapControl.Features.MapStyle.View3D)?SetOn3DAnimationInterruptedCallback:function(){NotSupportedMethod("VEMapControl","SetOn3DAnimationInterruptedCallback")};this.GetOn3DAnimationInterruptedCallback=$MVEM.IsEnabled(MapControl.Features.MapStyle.View3D)?GetOn3DAnimationInterruptedCallback:function(){NotSupportedMethod("VEMapControl","GetOn3DAnimationInterruptedCallback")};this.SetShowMapModeSwitch=SetShowMapModeSwitch;this.GetObliqueAvailability=GetObliqueAvailability;this.GetTopPx=GetTopPx;this.GetLeftPx=GetLeftPx;this.SetPrintable=SetPrintable;this.CreateMinimap=CreateMinimap;this.IsMapViewOblique=IsMapViewOblique;this.IsMapViewOrtho=IsMapViewOrtho;this.GetTileGeneration=GetTileGeneration;this.IsDragging=function(){return dragging};this.IsZooming=function(){return zooming}};function NotSupportedMethod(a,b){throw new VEException(a,"err_unsupport",L_UnsupportMethod_Text.replace("%1",b))}function NotSupportedClass(a){throw new VEException("","err_unsupport",L_UnsupportClass_Text.replace("%1",a))}Msn.VE.Bounds=function(e,f,a,c,b,d){this.z1=e;this.z2=f;this.x1=a;this.y1=c;this.x2=b;this.y2=d};Msn.VE.DashboardStates=new function(){this.MapMode=new function(){this.Flatland=1;this.View3D=2};this.MapView=new function(){this.Ortho=4;this.Oblique=8;this.StreetSide=16};this.MapStyle=new function(){this.Road=32;this.Shaded=64;this.Aerial=128;this.Hybrid=256}};VEMiniMapSize=function(){};VEMiniMapSize.Small="small";VEMiniMapSize.Large="large";VEMiniMapExpandState=function(){};VEMiniMapExpandState.Collapsed="collapsed";VEMiniMapExpandState.Expanded="expanded";VEMiniMapVersion=function(){};VEMiniMapVersion[5]="MSVE_Minimap_V5";VEMiniMapVersion[6]="MSVE_Minimap_V6";Msn.VE.Minimap=function(bb,m,cb,h){var n=this,db=Msn.VE.Css,U=Msn.VE.Css.Functions,t=Msn.VE.DashboardStates.MapMode.Flatland,e=Msn.VE.DashboardStates.MapView.Ortho,N=false,O=null,A=false,u=false,B=false,k=true,o=null,c=bb,b=null,a=m,i=[];i[VEMiniMapSize.Small]="MSVE_smallMinimap";i[VEMiniMapSize.Large]="MSVE_normalMinimap";var w=[];w[VEMiniMapSize.Small]=L_MinimapLargerToolTip_Text;w[VEMiniMapSize.Large]=L_MinimapSmallerToolTip_Text;var r=[];r[VEMiniMapSize.Small]=138.5;r[VEMiniMapSize.Large]=180.5;if(h!=5&&h!=6)h=5;c.className=VEMiniMapExpandState.Expanded+" "+i[VEMiniMapSize.Small]+" "+VEMiniMapVersion[h];var p=document.createElement("div");p.id="MSVE_minimap_transparency";c.appendChild(p);var f=document.createElement("div");f.id="MSVE_minimap_content";f.title=L_MinimapDragToolTip_Text;p.appendChild(f);var j=document.createElement("span");j.id="MSVE_minimap_glyph";j.title=L_MinimapHideToolTip_Text;if(cb!=false&&Msn.VE.Animation){this.rollInDirection=null;this.rollOutDirection=null;c.appendChild(j);H(this,h)}var d=null,q=false;a.AttachEvent("onchangemapstyle",W);var D=document.createElement("div"),C=document.createElement("div"),l=document.createElement("div");l.id="MSVE_minimap_style_wrapper";f.appendChild(l);switch(h){case 5:var g=document.createElement("div");g.id="MSVE_minimap_resize";g.attachEvent("onclick",L);g.title=L_MinimapLargerToolTip_Text;pseudoHover(g);c.appendChild(g);break;case 6:if($MVEM.IsEnabled(MapControl.Features.Minimap.ShowByDefault))j.title=L_MinimapHideToolTip_Text;else j.title=L_MinimapShowToolTip_Text}function V(){var g={};g.latitude=a.GetCenterLatitude();g.longitude=a.GetCenterLongitude();var h=a.GetZoomLevel()-4;if(h<1)h=1;if(g.latitude==null||g.longitude==null){g.latitude=0;g.longitude=0;h=1}g.zoomlevel=h;g.mapstyle=Msn.VE.MapStyle.Road;g.showScaleBar=false;g.showMapLegend=false;g.showDashboard=false;g.showMinimap=false;g.hideCopyright=true;g.disableLogo=true;g.clientToken=O;b=new Msn.VE.MapControl(f,g);b.Init();b.SetMinimapMode();G(D,"MSVE_minimap_r_style_button","MSVE_minimap_style",L_MinimapRoad_Text,L_MinimapRoadToolTip_Text,J,$MVEM.IsEnabled(MapControl.Features.MapStyle.Road));G(C,"MSVE_minimap_h_style_button","MSVE_minimap_style",L_MinimapHybrid_Text,L_MinimapHybridToolTip_Text,F,$MVEM.IsEnabled(MapControl.Features.MapStyle.Hybrid));K();b.AttachEvent("onendpan",S);b.AttachEvent("onclick",x);a.AttachEvent("onendpan",R);a.AttachEvent("onobliquechange",M);a.AttachEvent("onendzoom",P);a.AttachEvent("onchangeview",I);var i=a.IsModeEnabled(Msn.VE.MapActionMode.Mode3D)?Msn.VE.DashboardStates.MapMode.View3D:Msn.VE.DashboardStates.MapMode.Flatland;e=Msn.VE.DashboardStates.MapView.Ortho;if(a.IsMapViewOblique()){b.SetZoom(14);e=Msn.VE.DashboardStates.MapView.Oblique}d=new Msn.VE.CameraRotator(c,this,f);q=true;T(i);y();s()}this.Init=V;this.Destroy=function(){E(D,J);E(C,F);D=C=null;if(d){d.Destroy();d=null}a.DetachEvent("onendpan",R);a.DetachEvent("onobliquechange",M);a.DetachEvent("onendzoom",P);a.DetachEvent("onchangeview",I);if(b){b.DetachEvent("onendpan",S);b.DetachEvent("onclick",x);b.Destroy();b=null}switch(h){case 5:g.detachEvent("onclick",L)}l=null;p=null;f=null;j=null;g=null;n=null};this.IsInitialized=function(){return q};this.SetClientToken=function(a){O=a;if(b)b.SetClientToken(a)};function T(a){t=a}this.SetMapMode=T;function y(){if(!N&&typeof minimapRoller!="undefined"&&minimapRoller!=null&&t==Msn.VE.DashboardStates.MapMode.Flatland)if(e==Msn.VE.DashboardStates.MapView.Oblique){if(!minimapRoller.isExpanded())minimapRoller.rollOut(n.rollOutDirection)}else if(e==Msn.VE.DashboardStates.MapView.Ortho)if(minimapRoller.isExpanded()&&!$MVEM.IsEnabled(MapControl.Features.Minimap.ShowByDefault))minimapRoller.rollIn(n.rollInDirection)}this.SetRollerState=y;this.ChangeOrientation=function(b){if(t==Msn.VE.DashboardStates.MapMode.Flatland)if(e==Msn.VE.DashboardStates.MapView.Oblique)switch(b){case 0:case 360:a.SetObliqueOrientation("East");break;case 270:a.SetObliqueOrientation("South");break;case 90:a.SetObliqueOrientation("North");break;case 180:a.SetObliqueOrientation("West")}};this.SetKeepRollState=function(){N=true};function s(){if(t==Msn.VE.DashboardStates.MapMode.Flatland)if(e==Msn.VE.DashboardStates.MapView.Oblique){var b=a.GetObliqueScene();if(!b)return;var c=b.GetOrientation();d.SetStyle("oblique");switch(c){case "North":d.SetOrientation(90);break;case "South":d.SetOrientation(270);break;case "East":d.SetOrientation(0);break;case "West":d.SetOrientation(180)}d.Show()}else if(e==Msn.VE.DashboardStates.MapView.Ortho){d.SetStyle("ortho");d.Show()}else d.Hide();else d.Hide()}function Z(){u=true;a.PanToLatLong(b.GetCenterLatitude(),b.GetCenterLongitude())}function z(){var c=a.GetCenterLatitude(),d=a.GetCenterLongitude();A=true;b.PanToLatLong(c,d)}this.Hide=function(){c.style.display="none"};this.Show=function(){c.style.display="block"};this.SetPosition=function(a,b){c.style.left=a+"px";c.style.top=b+"px"};this.SetSize=function(a){var d=this.GetSize();if(a!=d){U.removeClass(c,i[d]);U.addClass(c,i[a]);g.title=w[a];if(c.className.indexOf(VEMiniMapExpandState.Expanded)>=0){B=true;b.Resize(r[a],r[a])}}};this.GetSize=function(){return c.className.indexOf(i[VEMiniMapSize.Large])>-1?VEMiniMapSize.Large:VEMiniMapSize.Small};this.SetDoUpdates=function(a){k=a;if(k)Q()};this.GetContainer=function(){return c};function W(){var b=e;e=Msn.VE.DashboardStates.MapView.Ortho;if(a.IsMapViewOblique()){e=Msn.VE.DashboardStates.MapView.Oblique;if(!q)V()}if(q&&e!=b){y();s()}}function S(){if(B){B=false;return}if(!A)Z();else A=false}function L(){var a=n.GetSize()==VEMiniMapSize.Small?VEMiniMapSize.Large:VEMiniMapSize.Small;n.SetSize(a)}function R(){if(!k)return;if(!u){o=v();z()}else u=false}function I(){if(!k)return;var c=v();if(!a.IsMapViewOblique()&&!c.Equals(o)){b.SetView(c);o=null}}function M(){if(!k)return;z();s()}function P(){if(!k)return;o=v();Q()}function v(){var d=b.GetCurrentMapView().MakeCopy(),e=a.GetCurrentMapView();d.SetCenterLatLong(new Msn.VE.LatLong(e.latlong.latitude,e.latlong.longitude));var c=1;if(Msn.VE.MapStyle.IsViewOblique(e.style))c=14;else c=e.GetZoomLevel()-4;if(c<1)c=1;d.SetZoomLevel(c);d.Resolve(b.GetCurrentMode(),b.GetMapWidth(),b.GetMapHeight());return d}function Q(){var c=0;if(a.IsMapViewOblique())c=14;else c=a.GetZoomLevel()-4;if(c<1)c=1;if(b.GetZoomLevel()==c){z();return}b.SetCenterAndZoom(a.GetCenterLatitude(),a.GetCenterLongitude(),c)}function G(a,g,d,f,e,c,b){a.innerText=f;a.id=g;a.title=e;if(typeof b=="undefined"||b==true){a.className=d;a.attachEvent("onclick",c);a.attachEvent("onmousedown",IgnoreEvent)};pseudoHover(a);l.appendChild(a)}function E(a,b){a.detachEvent("onclick",b);a.detachEvent("onmousedown",IgnoreEvent)}function x(){f.title="";b.DetachEvent("onclick",x)}function J(){K();$VE_A.Log($VE_A.PgName.Map,"MiniMapRoad")}function F(){X();$VE_A.Log($VE_A.PgName.Map,"MiniMapHybrid")}function X(){l.className="MSVE_minimap_hybrid_style";b.SetMapStyle("h")}function K(){l.className="MSVE_minimap_road_style";b.SetMapStyle("r")}function ab(){return h}this.GetVersion=ab;function H(b,g){var f=m.IsMapViewOblique()||$MVEM.IsEnabled(MapControl.Features.Minimap.ShowByDefault),d,e,c=$ID("MSVE_minimap"),a=$ID("MSVE_minimap_glyph");if(!a||!c)return;switch(g){case 5:b.rollInDirection=Msn.VE.Animation.RollDirection.RightLeft;b.rollOutDirection=Msn.VE.Animation.RollDirection.LeftRight;d=8;e=0;break;case 6:b.rollInDirection=Msn.VE.Animation.RollDirection.LeftRight|Msn.VE.Animation.RollDirection.BottomUp;b.rollOutDirection=Msn.VE.Animation.RollDirection.RightLeft|Msn.VE.Animation.RollDirection.TopDown;d=a.offsetWidth+1;e=a.offsetHeight;break;default:return}window.minimapRoller=new Msn.VE.Animation.Roller(c);minimapRoller.setAccelerationFunction(AccelerationFunctions.CrazyElevator);minimapRoller.setXLeave(d);minimapRoller.setYLeave(e);pseudoHover(a);Y(c,minimapRoller,"MSVE_minimap_glyph");if(!f)minimapRoller.collapse(b.rollInDirection);a.onclick=function(){var a=m.GetMinimap();a.SetKeepRollState();if(minimapRoller.isExpanded()){$VE_A.Log($VE_A.PgName.Map,"MiniMapCollapse");minimapRoller.rollIn(a.rollInDirection)}else{$VE_A.Log($VE_A.PgName.Map,"MiniMapExpand");minimapRoller.rollOut(a.rollOutDirection)}};window.attachEvent("onunload",function(){a=c=null;window.detachEvent("onunload",arguments.callee)})}function Y(a,b,c){b.hookEvent("afterrollin",function(){var d=Msn.VE.Css.Functions,b=m.GetMinimap();d.removeClass(a,"expanded");d.addClass(a,"collapsed");if(b&&b.IsInitialized())b.SetDoUpdates(false);$ID(c).title=L_MinimapShowToolTip_Text});b.hookEvent("afterrollout",function(){var d=Msn.VE.Css.Functions,b=m.GetMinimap();d.removeClass(a,"collapsed");d.addClass(a,"expanded");if(b&&b.IsInitialized()){b.SetDoUpdates(true);s()}$ID(c).title=L_MinimapHideToolTip_Text});b.hookEvent("beforerollout",function(){var a=m.GetMinimap();if(a&&!a.IsInitialized())a.Init()})}this.creatMinimapRoller=H;Msn.VE.CameraRotator=function(g,j,d){var n=Msn.VE.Css,m=j,g=g,d=d,e=0,c="ortho",a=document.createElement("div");a.id="MSVE_cameraPosition";d.appendChild(a);b(90);function i(){a=null}function k(){a.style.display="none"}function l(){a.style.display="block"}function f(a){b(a)}function h(a){switch(a){case "oblique":c="MSVE_direction";b(90);break;case "ortho":c="MSVE_ortho";b(90);break;default:c="MSVE_ortho";b(90)}}function b(b){e=MathFloor((b+45+720)/90)%4;a.className=c+e}this.Hide=k;this.Show=l;this.Destroy=i;this.SetStyle=h;this.SetOrientation=f}};Msn.VE.DashboardSize=new function(){this.Normal="normal";this.Small="small";this.Tiny="tiny"};Msn.VE.NavControlFactory=function(g,i,c,b,e,h,f,d){if(typeof c=="undefined"||c==null)c=Msn.VE.DashboardSize.Normal;if(typeof b=="undefined"||b==null)b="MSVE_dashboardId";if(!isFinite(parseInt(d)))d=6;var a;switch(d){case 5:a=new Msn.VE.V5Control(g,i,c,b,e,h,f);break;case 6:default:a=new Msn.VE.V6Control(g,i,c,b,e,h,f)}a.version=d;a.GetVersion=function(){return a.version};return a};Msn.VE.V5Control=function(A,a,j,D,y,B){Msn.VE.DashboardStates=new function(){this.MapMode=new function(){this.Flatland=1;this.View3D=2};this.MapView=new function(){this.Ortho=4;this.Oblique=8;this.StreetSide=16};this.MapStyle=new function(){this.Road=32;this.Shaded=64;this.Aerial=128;this.Hybrid=256}};var t={Style:"MSVE_navAction_mapStyleCell",Road:"MSVE_navAction_RoadMapStyle",Aerial:"MSVE_navAction_AerialMapStyle",Hybrid:"MSVE_navAction_HybridMapStyle",Mode:"MSVE_navAction_modeCell",Mode2D:"MSVE_navAction_FlatlandMapMode",Mode3D:"MSVE_navAction_View3DMapMode",View:"MSVE_navAction_mapViewCellInner",Ortho:"MSVE_navAction_OrthoMapView",Oblique:"MSVE_navAction_ObliqueMapView",StreetSide:"MSVE_navAction_StreetSideMapView",ShowLabels:"MSVE_navAction_showLabels",Pan:"MSVE_navAction_panContainer",PanUp:"MSVE_navAction_panUp",PanDown:"MSVE_navAction_panDown",PanLeft:"MSVE_navAction_panLeft",PanRight:"MSVE_navAction_panRight",TinyZoom:"MSVE_TinyZoomBar",OrthoZoom:"MSVE_OrthoZoomBar",ObliqueZoom:"MSVE_ObliqueZoomBar",ObliqueCompass:"MSVE_compassDiv",ObliqueNotification:"MSVE_obliqueNotification",ThreeDUpdatedNotification:"MSVE_threeDUpdatedNotification",Traffic:"MSVE_navAction_traffic"},f="Nav Bar";Msn.VE.CommonControls=function(c,w){function xb(b){var f=document.createElement("div"),e=document.createElement("div"),a=document.createElement("div"),d=document.createElement("div"),w=0,s=0,j=false;this.Init=function(){d.className="MSVE_ZoomBar_minus";d.id="MSVE_navAction_obliqueZoomBar_minus";d.unselectable="on";d.title=L_ZoomBarMinusToolTip_Text;d.attachEvent("onclick",l);pseudoHover(d);a.className="MSVE_ZoomBar_slider";a.id="MSVE_navAction_obliqueZoomBar_slider";a.unselectable="on";a.attachEvent("onmousedown",o);a.attachEvent("onmousemove",p);a.attachEvent("onmouseup",q);a.attachEvent("onclick",IgnoreEvent);pseudoHover(a);e.className="MSVE_ObliqueZoomBar_bar";e.unselectable="on";e.appendChild(a);e.attachEvent("onclick",r);f.className="MSVE_ZoomBar_plus";f.id="MSVE_navAction_obliqueZoomBar_plus";f.title=L_ZoomBarPlusToolTip_Text;f.unselectable="on";f.attachEvent("onclick",m);pseudoHover(f);b.className="MSVE_ZoomBar";b.id="MSVE_ObliqueZoomBar";b.appendChild(d);b.appendChild(e);b.appendChild(f);b.attachEvent("onmousedown",IgnoreEvent);b.attachEvent("onmouseup",IgnoreEvent);b.attachEvent("onclick",IgnoreEvent);b.attachEvent("ondblclick",IgnoreEvent);i()};function v(){b.style.display="block"}function u(){b.style.display="none"}function r(a){a=GetEvent(a);CancelEvent(a);k();n(h(Gimme.Screen.getMousePosition(a).y));return false}function h(b){b-=s+d.offsetHeight+a.offsetHeight;var c=e.offsetHeight-a.offsetHeight;if(b<0)b=0;else if(b>c)b=c;return b}function l(){c.ZoomOut();$VE_A.Log($VE_A.PgName.Map,"Zoom out","Nav Bar")}function m(){c.ZoomIn();$VE_A.Log($VE_A.PgName.Map,"Zoom in","Nav Bar")}function t(){d.detachEvent("onclick",l);a.detachEvent("onmousedown",o);a.detachEvent("onmousemove",p);a.detachEvent("onmouseup",q);a.detachEvent("onclick",IgnoreEvent);e.detachEvent("onclick",r);f.detachEvent("onclick",m);b.detachEvent("onmousedown",IgnoreEvent);b.detachEvent("onmousedown",IgnoreEvent);b.detachEvent("onclick",IgnoreEvent);b.detachEvent("ondblclick",IgnoreEvent);d=a=e=f=null}function o(b){b=GetEvent(b);CancelEvent(b);k();if(a.setCapture)a.setCapture();j=true;return false}function p(b){b=GetEvent(b);CancelEvent(b);if(j)a.style.top=h(Gimme.Screen.getMousePosition(b).y)+"px";return false}function q(b){b=GetEvent(b);CancelEvent(b);if(a.releaseCapture)a.releaseCapture();j=false;n(h(Gimme.Screen.getMousePosition(b).y));i();return false}function k(){var a=g(b).getScreenPosition();w=a.x;s=a.y}function n(f){var b=e.offsetHeight-a.offsetHeight,d=1+MathRound((b-f)/b*1);c.SetZoom(d);$VE_A.Log($VE_A.PgName.Map,"Zoom")}function i(){if(c.GetZoomLevel()==1)a.style.top=e.offsetHeight-a.offsetHeight+"px";else a.style.top="0px"}this.Destroy=t;this.Show=v;this.Hide=u;this.UpdateFromMap=i}function C(z,x,y){var a=document.createElement("div");a.setAttribute("id",z);a.innerHTML=x;var c="MSVE_obliqueCompassPointOff",g=y;a.attachEvent("onmouseover",f);a.attachEvent("onmouseout",h);a.attachEvent("onclick",i);this.onclick=null;this.onmouseover=null;this.onmouseout=null;var e=25,b=this,d=false,j=new v(a,17,17);function f(e){if(d)return;c=a.className;a.className="MSVE_obliqueCompassPointHover";if(b.onmouseover)b.onmouseover(e)}function i(a){if(d)return;f(a);c="MSVE_obliqueCompassPointOn";if(b.onclick)b.onclick(a)}function h(e){if(d)return;a.className=c;if(b.onmouseout)b.onmouseout(e)}function m(){c="MSVE_obliqueCompassPointOn";a.className="MSVE_obliqueCompassPointOn"}function l(){c="MSVE_obliqueCompassPointOff";a.className="MSVE_obliqueCompassPointOff"}function u(){d=true;l()}function k(){d=false;m()}function q(){return a}function n(){return g}function o(a){g=a}function w(){j.Reset();k()}function p(b){a.style.left=b.left;a.style.top=b.top}function v(r,n,o){var g=r,a=0,b=.3,c=0,l=40,k=Math.PI/2,h=true,p=b+.1;function m(a,b,c){if(b>=c-a&&b<=c+a)return true;return false}function i(){a+=b;if(a>Math.PI*2)a-=Math.PI*2;else if(a<0)a+=Math.PI*2;if(m(p,a,c)){b=.3;a=c;d(a);return}d(a);window.setTimeout(i,l)}function d(a){var b=n+e*Math.sin(a),c=o+e*Math.cos(a);g.style.left=b+"px";g.style.top=c+"px"}function f(a){c=a;i()}function j(a,c){h=c;if(!h)b*=-1;f(k*a)}function q(){a=0}this.RotateTo=f;this.RotateToIndex=j;this.Reset=q}function t(){a.detachEvent("onmouseover",f);a.detachEvent("onmouseout",h);a.detachEvent("onclick",i);a=null}function s(a){e=a}function r(){return e}this.SetRadius=s;this.GetRadius=r;this.GetElement=q;this.GetCurrentPositionIndex=n;this.SetCurrentPositionIndex=o;this.SetCurrentPosition=p;this.On=m;this.Off=l;this.RotateToIndex=j.RotateToIndex;this.Reset=w;this.Disable=u;this.Enable=k;this.Destroy=t}function wb(E){var p=[];p.push({"top":"-8px","left":"17px"});p.push({"top":"17px","left":"42px"});p.push({"top":"42px","left":"17px"});p.push({"top":"17px","left":"-8px"});var g=document.createElement("div");g.setAttribute("id","MSVE_obliqueCompassContainer");g.title=L_ObliqueCompassSelectDirection_Text;var a=new C("MSVE_obliqueCompassPointN","N",0),j=a.GetElement();j.attachEvent("onclick",s);j.attachEvent("onmouseover",v);j.attachEvent("onmouseout",i);var d=new C("MSVE_obliqueCompassPointE","E",1),l=d.GetElement();l.attachEvent("onclick",u);l.attachEvent("onmouseover",y);l.attachEvent("onmouseout",i);var b=new C("MSVE_obliqueCompassPointS","S",2),k=b.GetElement();k.attachEvent("onclick",t);k.attachEvent("onmouseover",w);k.attachEvent("onmouseout",i);var e=new C("MSVE_obliqueCompassPointW","W",3),m=e.GetElement();m.attachEvent("onclick",x);m.attachEvent("onmouseover",z);m.attachEvent("onmouseout",i);var n=document.createElement("div");n.id="MSVE_navAction_obliqueCompassArrow";g.appendChild(j);g.appendChild(l);g.appendChild(k);g.appendChild(m);g.appendChild(n);E.appendChild(g);r();function q(a){if(a<0)a=4-Math.abs(a);return a}function o(l,i,k){var c=l.GetCurrentPositionIndex(),h,f=[];f[a.GetCurrentPositionIndex()]=L_North_Text;f[b.GetCurrentPositionIndex()]=L_South_Text;f[d.GetCurrentPositionIndex()]=L_East_Text;f[e.GetCurrentPositionIndex()]=L_West_Text;if(i){h=i==Msn.VE.BirdsEyeSearchSpinDirection.CounterclockwiseSpin;if(c+i!=2){var g;switch(i){case -1:switch(c){case 0:case 2:g=[3];break;case 1:g=[3,2]}break;case 1:switch(c){case 0:case 2:g=[1];break;case 3:g=[1,2]}}if(g){var j=L_ObliqueSkippingOneDirection_Text;if(c==0)j=L_ObliqueNoImageryInRequestedDirection_Text;if(g.length==2)j=L_ObliqueSkippingTwoDirections_Text;if(typeof ShowMessage!="undefined")ShowMessage(j.replace("%1",f[c]).replace("%2",f[g[0]]).replace("%3",f[g[1]]))}}}else{h=c!=3;if(k)if(c==0){if(typeof ShowMessage!="undefined")ShowMessage(L_ObliqueModeImageNotAvailable_Text)}else if(typeof ShowMessage!="undefined")ShowMessage(L_ObliqueNoImageryInRequestedDirection_Text.replace("%1",f[c]).replace("%2",f[0]))}d.SetCurrentPositionIndex(q(d.GetCurrentPositionIndex()-c));e.SetCurrentPositionIndex(q(e.GetCurrentPositionIndex()-c));a.SetCurrentPositionIndex(q(a.GetCurrentPositionIndex()-c));b.SetCurrentPositionIndex(q(b.GetCurrentPositionIndex()-c));a.RotateToIndex(2-a.GetCurrentPositionIndex()<0?a.GetCurrentPositionIndex():2-a.GetCurrentPositionIndex(),h);d.RotateToIndex(2-d.GetCurrentPositionIndex()<0?d.GetCurrentPositionIndex():2-d.GetCurrentPositionIndex(),h);b.RotateToIndex(2-b.GetCurrentPositionIndex()<0?b.GetCurrentPositionIndex():2-b.GetCurrentPositionIndex(),h);e.RotateToIndex(2-e.GetCurrentPositionIndex()<0?e.GetCurrentPositionIndex():2-e.GetCurrentPositionIndex(),h)}function h(a){switch(a){case 0:i();break;case 1:A();break;case 2:B();break;case 3:D()}}function i(){n.className="MSVE_obliqueCompassArrowU"}function B(){n.className="MSVE_obliqueCompassArrowD"}function A(){n.className="MSVE_obliqueCompassArrowR"}function D(){n.className="MSVE_obliqueCompassArrowL"}function t(){if(c.GetDashboard()&&c.GetDashboard().SetLastRotationDirection)c.GetDashboard().SetLastRotationDirection(Msn.VE.BirdsEyeSearchSpinDirection.NoSpin);o(b);h(0);var a=c.GetObliqueScene();if(a)if(a.GetOrientation()!=Msn.VE.Orientation.South)c.SetObliqueOrientation("South",null,true);$VE_A.Log($VE_A.PgName.Map,"Rotate - South",f)}function s(){if(c.GetDashboard()&&c.GetDashboard().SetLastRotationDirection)c.GetDashboard().SetLastRotationDirection(Msn.VE.BirdsEyeSearchSpinDirection.NoSpin);o(a);h(0);var b=c.GetObliqueScene();if(b)if(b.GetOrientation()!=Msn.VE.Orientation.North)c.SetObliqueOrientation("North",null,true);$VE_A.Log($VE_A.PgName.Map,"Rotate - North",f)}function u(){if(c.GetDashboard()&&c.GetDashboard().SetLastRotationDirection)c.GetDashboard().SetLastRotationDirection(Msn.VE.BirdsEyeSearchSpinDirection.NoSpin);o(d);h(0);var a=c.GetObliqueScene();if(a)if(a.GetOrientation()!=Msn.VE.Orientation.East)c.SetObliqueOrientation("East",null,true);$VE_A.Log($VE_A.PgName.Map,"Rotate - East",f)}function x(){if(c.GetDashboard()&&c.GetDashboard().SetLastRotationDirection)c.GetDashboard().SetLastRotationDirection(Msn.VE.BirdsEyeSearchSpinDirection.NoSpin);o(e);h(0);var a=c.GetObliqueScene();if(a)if(a.GetOrientation()!=Msn.VE.Orientation.West)c.SetObliqueOrientation("West",null,true);$VE_A.Log($VE_A.PgName.Map,"Rotate - West",f)}function w(){h(b.GetCurrentPositionIndex())}function y(){h(d.GetCurrentPositionIndex())}function z(){h(e.GetCurrentPositionIndex())}function v(){h(a.GetCurrentPositionIndex())}function I(){g.style.display="none"}function J(){g.style.display="block"}function r(k,j){var i=c.GetObliqueScene();if(!i)return;var f=i.GetOrientation(),g;switch(f){case "North":g=a;break;case "South":g=b;break;case "East":g=d;break;case "West":g=e}o(g,k,j);h(0);if(f!=Msn.VE.Orientation.North)a.Enable();else a.Disable();if(f!=Msn.VE.Orientation.South)b.Enable();else b.Disable();if(f!=Msn.VE.Orientation.East)d.Enable();else d.Disable();if(f!=Msn.VE.Orientation.West)e.Enable();else e.Disable()}function H(){a.Destroy();d.Destroy();b.Destroy();e.Destroy();j.detachEvent("onclick",s);j.detachEvent("onmouseover",v);j.detachEvent("onmouseout",i);l.detachEvent("onclick",u);l.detachEvent("onmouseover",y);l.detachEvent("onmouseout",i);k.detachEvent("onclick",t);k.detachEvent("onmouseover",w);k.detachEvent("onmouseout",i);m.detachEvent("onclick",x);m.detachEvent("onmouseover",z);m.detachEvent("onmouseout",i);g=null}function G(c){a.SetRadius(c);b.SetRadius(c);d.SetRadius(c);e.SetRadius(c)}function F(){return a.GetRadius()}this.Hide=I;this.Show=J;this.UpdateFromMap=r;this.SetRadius=G;this.GetRadius=F;this.Destroy=H}function Ab(b){var f=document.createElement("div"),e=document.createElement("div"),a=document.createElement("div"),d=document.createElement("div"),v=0,s=0,j=false;this.Init=function(){d.className="MSVE_ZoomBar_minus";d.id="MSVE_navAction_orthoZoomBar_minus";d.title=L_ZoomBarMinusToolTip_Text;d.unselectable="on";d.attachEvent("onclick",l);pseudoHover(d);a.className="MSVE_ZoomBar_slider";a.id="MSVE_navAction_orthoZoomBar_slider";a.title=L_ZoomBarSliderToolTip_Text;a.unselectable="on";a.attachEvent("onmousedown",o);a.attachEvent("onmousemove",p);a.attachEvent("onmouseup",q);a.attachEvent("onclick",IgnoreEvent);pseudoHover(a);e.className="MSVE_OrthoZoomBar_bar";e.unselectable="on";e.appendChild(a);e.attachEvent("onclick",r);f.className="MSVE_ZoomBar_plus";f.id="MSVE_navAction_orthoZoomBar_plus";f.title=L_ZoomBarPlusToolTip_Text;f.unselectable="on";f.attachEvent("onclick",m);pseudoHover(f);b.className="MSVE_ZoomBar";b.id="MSVE_OrthoZoomBar";b.appendChild(d);b.appendChild(e);b.appendChild(f);b.attachEvent("onmousedown",IgnoreEvent);b.attachEvent("onmouseup",IgnoreEvent);b.attachEvent("onclick",IgnoreEvent);b.attachEvent("ondblclick",IgnoreEvent);i()};this.Destroy=function(){d.detachEvent("onclick",l);a.detachEvent("onmousedown",o);a.detachEvent("onmousemove",p);a.detachEvent("onmouseup",q);a.detachEvent("onclick",IgnoreEvent);e.detachEvent("onclick",r);f.detachEvent("onclick",m);b.detachEvent("onmousedown",IgnoreEvent);b.detachEvent("onmousedown",IgnoreEvent);b.detachEvent("onclick",IgnoreEvent);b.detachEvent("ondblclick",IgnoreEvent);d=a=e=f=null};function u(){b.style.display="block"}function t(){b.style.display="none"}function k(){var a=g(b).getScreenPosition();v=a.x;s=a.y}function o(b){b=GetEvent(b);CancelEvent(b);k();if(a.setCapture)a.setCapture();j=true;return false}function p(b){b=GetEvent(b);CancelEvent(b);if(j)a.style.top=h(Gimme.Screen.getMousePosition(b).y)+"px";return false}function q(b){b=GetEvent(b);CancelEvent(b);if(a.releaseCapture)a.releaseCapture();j=false;n(h(Gimme.Screen.getMousePosition(b).y));i();return false}function m(){c.ZoomIn();$VE_A.Log($VE_A.PgName.Map,"Zoom in","Nav Bar")}function l(){c.ZoomOut();$VE_A.Log($VE_A.PgName.Map,"Zoom out","Nav Bar")}function r(a){a=GetEvent(a);CancelEvent(a);k();n(h(Gimme.Screen.getMousePosition(a).y));return false}function h(b){b-=s+d.offsetHeight+a.offsetHeight;var c=e.offsetHeight-a.offsetHeight;if(b<0)b=0;else if(b>c)b=c;return b}function n(f){var b=e.offsetHeight-a.offsetHeight,d=1+MathRound((b-f)/b*18);c.SetZoom(d);$VE_A.Log($VE_A.PgName.Map,"Zoom")}function i(){var b=e.offsetHeight-a.offsetHeight,d=b-(c.GetZoomLevel()-1)/18*b;a.style.top=d+"px"}this.UpdateFromMap=i;this.Show=u;this.Hide=t}function Db(){var h=document.createElement("div"),g=document.createElement("div"),f=document.createElement("div"),a=false,d=g,b=f;this.Init=function(){g.className="MSVE_ZoomBar_plus";g.id="MSVE_navAction_tinyZoomBar_plus";g.title=L_ZoomBarPlusToolTip_Text;g.unselectable="on";f.className="MSVE_ZoomBar_minus";f.id="MSVE_navAction_tinyZoomBar_minus";f.title=L_ZoomBarMinusToolTip_Text;f.unselectable="on";c.AttachEvent("onendzoom",i);h.className="MSVE_ZoomBar";h.id="MSVE_TinyZoomBar";h.appendChild(g);h.appendChild(f);return h};this.HookupPlusMinusEvents=function(b,a){m(b);j(a)};function m(a){if(a)d=a;d.attachEvent("onmousedown",o);d.attachEvent("onmouseup",e);d.attachEvent("onmouseout",e)}this.HookupPlusEvents=m;function j(a){if(a)b=a;b.attachEvent("onmousedown",l);b.attachEvent("onmouseup",e);b.attachEvent("onmouseout",e)}this.HookupMinusEvents=j;function n(){if(d!=null){d.detachEvent("onmousedown",o);d.detachEvent("onmouseup",e);d.detachEvent("onmouseout",e)}if(a=="in")a=false}this.UnhookPlusEvents=n;function k(){if(b!=null){b.detachEvent("onmousedown",l);b.detachEvent("onmouseup",e);b.detachEvent("onmouseout",e)}if(a=="out")a=false}this.UnhookMinusEvents=k;this.Destroy=function(){n();k();c.DetachEvent("onendzoom",i);g=f=d=b=null};function q(){if(c.GetMapMode()==Msn.VE.MapActionMode.Mode3D)return true;else return c.IsAnimationEnabled()}function o(b){a="in";c.ZoomIn();if(b!==false)$VE_A.Log($VE_A.PgName.Map,"Zoom in","Nav Bar")}function i(){window.setTimeout(p,q()?1:500)}function p(){if(a=="in"&&c.GetZoomLevel()<21)c.ZoomIn(false);else if(a=="out"&&c.GetZoomLevel()>1)c.ZoomOut(false)}function l(b){a="out";c.ZoomOut();if(b!==false)$VE_A.Log($VE_A.PgName.Map,"Zoom out","Nav Bar")}function e(){a=false}this.GetPlus=function(){return g};this.GetMinus=function(){return f}}var a=t,l=[];l[a.Style]={Id:a.Style,InitialClass:null,OnClickFunction:null,StyleUpdateEvent:null,StyleUpdateFunction:null,Enabled:true,Title:null,Children:[a.Road,a.Aerial,a.Hybrid],Text:null};l[a.Road]={Id:a.Road,InitialClass:"MSVE_MapStyle",OnClickFunction:rb,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:u,Enabled:MapControl.Features.MapStyle.Road,Title:L_NavActionRoadToolTip_Text,Children:null,Text:L_NavActionRoad_Text};l[a.Aerial]={Id:a.Aerial,InitialClass:"MSVE_MapStyle",OnClickFunction:lb,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:u,Enabled:MapControl.Features.MapStyle.Aerial,Title:L_NavActionAerialToolTip_Text,Children:null,Text:L_NavActionAerial_Text};l[a.Hybrid]={Id:a.Hybrid,InitialClass:"MSVE_MapStyle",OnClickFunction:mb,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:u,Enabled:MapControl.Features.MapStyle.Hybrid,Title:L_NavActionHybridToolTip_Text,Children:null,Text:L_NavActionHybrid_Text};l[a.Mode]={Id:a.Mode,InitialClass:"MSVE_modeCell",OnClickFunction:null,StyleUpdateEvent:null,StyleUpdateFunction:null,Enabled:true,Title:null,Children:[a.Mode2D,a.Mode3D],Text:null};l[a.Mode2D]={Id:a.Mode2D,InitialClass:"MSVE_MapMode",OnClickFunction:jb,StyleUpdateEvent:"oninitmode",StyleUpdateFunction:Y,Enabled:true,Title:L_NavActionFlatlandToolTip_Text,Children:null,Text:L_NavActionFlatland_Text};l[a.Mode3D]={Id:a.Mode3D,InitialClass:"MSVE_MapMode",OnClickFunction:pb,StyleUpdateEvent:"oninitmode",StyleUpdateFunction:Y,Enabled:MapControl.Features.MapStyle.View3D,Title:L_NavActionView3DToolTip_Text,Children:null,Text:L_NavActionView3D_Text};l[a.View]={Id:a.View,InitialClass:null,OnClickFunction:null,StyleUpdateEvent:null,StyleUpdateFunction:null,Enabled:true,Title:null,Children:[a.Ortho,a.Oblique,a.StreetSide],Text:null};l[a.Ortho]={Id:a.Ortho,InitialClass:"MSVE_MapStyle",OnClickFunction:v,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:u,Enabled:true,Title:L_NavActionOrthoToolTip_Text,Children:null,Text:null};l[a.Oblique]={Id:a.Oblique,InitialClass:"MSVE_MapStyle",OnClickFunction:H,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:u,Enabled:false,Title:L_NavActionObliqueToolTip_Text,Children:null,Text:null};l[a.StreetSide]={Id:a.StreetSide,InitialClass:"MSVE_MapStyle",OnClickFunction:gb,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:u,Enabled:false,Title:L_NavActionStreetSideToolTip_Text,Children:null,Text:null};l[a.ShowLabels]={Id:a.ShowLabels,InitialClass:"MSVE_MapStyle",OnClickFunction:ub,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:u,Enabled:true,Title:L_NavActionShowLabels_Text,Children:null,Text:L_NavActionLabels_Text};l[a.Traffic]={Id:a.Traffic,InitialClass:"MSVE_MapStyle",OnClickFunction:zb,StyleUpdateEvent:null,StyleUpdateFunction:null,Enabled:true,Title:L_NavActionShowTrafficToolTip_Text,Children:null,Text:L_NavActionTraffic_Text};this.ObliqueFunctions=[];this.ObliqueFunctions.ObliqueImageryIn3D={ObliqueClickFunction:eb,Title:L_NavActionShowObliqueToolTip_Text,DependsOnObliqueAvailability:true};this.ObliqueFunctions.ObliqueTiltIn3D={ObliqueClickFunction:kb,Title:L_NavAction3DObliqueToolTip_Text,DependsOnObliqueAvailability:false};var e=this,b=[],i=Msn.VE.DashboardStates.MapMode.Flatland,d=Msn.VE.DashboardStates.MapView.Ortho,h=Msn.VE.DashboardStates.MapStyle.Road;this.orthoZoom=null;var m;this.obliqueCompass=null;this.obliqueZoom=null;this.displaying3DNotification=false;var A=null;this.Oblique3DFunctionality=this.ObliqueFunctions.ObliqueImageryIn3D;var r=document.createElement("div");r.id="MSVE_navAction_palette";document.body.appendChild(r);var J=false,Z=false,k=true,R=false,s=Msn.VE.BirdsEyeSearchSpinDirection.NoSpin,O;for(O in w)if(w.hasOwnProperty(O))N(w[O]);function Hb(){var d=$MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye)&&(c.IsObliqueAvailable()||c.IsMapViewOblique());if(d){j(a.Oblique,true);if(b[a.ObliqueNotification]&&!c.IsMapViewOblique()&&!g(b[a.Oblique]).hasClass("MSVE_selected"))y()}else{j(a.Oblique,false);if(b[a.ObliqueNotification])q()}V();if(c.IsModeEnabled(Msn.VE.MapActionMode.Mode3D))T();else S()}function Gb(){var a;for(a in w)if(w.hasOwnProperty(a))K(w[a]);document.body.removeChild(r);r=null}function N(f){switch(f){case a.OrthoZoom:b[f]=document.createElement("div");e.orthoZoom=new Ab(b[f]);e.orthoZoom.Init();c.AttachEvent("onendzoom",x);r.appendChild(b[f]);x();return;case a.ObliqueZoom:b[f]=document.createElement("div");Z=true;b[f].id=f;r.appendChild(b[f]);return;case a.TinyZoom:m=new Db;b[f]=m.Init();c.AttachEvent("onendzoom",x);x();return;case a.ObliqueCompass:b[f]=document.createElement("div");b[f].id=f;J=true;return;case a.ObliqueNotification:cb();return;case a.ThreeDUpdatedNotification:bb();return;case a.Oblique:c.AttachEvent("onve3dphotostatechanged",qb)}var d=l[f],g=document.createElement("div");b[d.Id]=g;g.id=d.Id;g.enabled=d.Enabled;g.classRecipients=[g];if(d.Text!=null)g.innerText=d.Text;if(d.OnClickFunction!=null&&d.Enabled==true)g.attachEvent("onclick",d.OnClickFunction);if(d.StyleUpdateEvent!=null&&d.StyleUpdateFunction!=null)c.AttachEvent(d.StyleUpdateEvent,d.StyleUpdateFunction);if(d.InitialClass){g.className=d.InitialClass;if(!g.enabled)g.className+="_disabled"}if(d.Children!=null){var h;for(h in d.Children)if(d.Children.hasOwnProperty(h))g.appendChild(N(d.Children[h]))}else pseudoHover(g);switch(f){case a.Oblique:case a.ObliqueCompass:c.AttachEvent("onobliqueenter",yb);c.AttachEvent("onobliqueleave",L);c.AttachEvent("onendmapstyleoblique",ob);c.AttachEvent("onobliquechange",vb);c.AttachEvent("obliquerequestunavailable",db);break;case a.Traffic:c.AttachEvent("onchangetraffic",D);D()}return g}function K(f){switch(f){case a.OrthoZoom:e.orthoZoom.Destroy();b[f]=null;c.DetachEvent("onendzoom",x);try{r.removeChild(b[f])}catch(j){}return;case a.ObliqueZoom:try{r.removeChild(b[f])}catch(j){}if(e.obliqueZoom){e.obliqueZoom.Destroy();e.obliqueZoom=null}case a.TinyZoom:m.Destroy();b[f]=null;return;case a.ObliqueCompass:if(J&&e.obliqueCompass){e.obliqueCompass.onclick=null;e.obliqueCompass.Destroy();e.obliqueCompass=null}return;case a.ObliqueNotification:b[a.ObliqueNotification].detachEvent("onclick",Q);return;case a.ThreeDUpdatedNotification:b[a.ThreeDUpdatedNotification]=null;return;case a.Traffic:c.DetachEvent("onchangetraffic",D)}var i=b[f];if(i==null)return;var d=l[f];if(d.Children!=null){var g,h;for(h in d.Children)if(d.Children.hasOwnProperty(h)){g=d.Children[h];try{i.removeChild(b[g])}catch(j){}K(g)}}if(d.OnClickFunction!=null)i.detachEvent("onclick",d.OnClickFunction);try{if(c&&d.StyleUpdateEvent!=null&&d.StyleUpdateFunction!=null)c.DetachEvent(d.StyleUpdateEvent,d.StyleUpdateFunction)}catch(j){}b[d.Id]=null}function cb(){b[a.ObliqueNotification]=document.createElement("div");b[a.ObliqueNotification].id=a.ObliqueNotification;b[a.ObliqueNotification].attachEvent("onclick",Q);b[a.ObliqueNotification].innerHTML+='<div id="MSVE_obliqueNotifyBeak" ></div> '+'<div id="MSVE_obliqueNotifyContent"> '+'<div id="MSVE_obliqueNotifyText" >'+L_DashboardBirdsEyeText_Text+"</div>"+'<img id="MSVE_obliqueNotifyImg" />'+"</div>"}function bb(){b[a.ThreeDUpdatedNotification]=document.createElement("div");b[a.ThreeDUpdatedNotification].id=a.ThreeDUpdatedNotification;b[a.ThreeDUpdatedNotification].innerHTML+='<div id="MSVE_threeDNotifyIcon">&nbsp;</div> <div id="MSVE_threeDNotifyText">'+L_Dashboard3DInstalled_Text+"</div>"}function rb(){B();$VE_A.Log($VE_A.PgName.Map,"MapStyleRoad",f)}function B(){if(h==Msn.VE.DashboardStates.MapStyle.Road&&d==Msn.VE.DashboardStates.MapView.Ortho)return;h=Msn.VE.DashboardStates.MapStyle.Road;d=Msn.VE.DashboardStates.MapView.Ortho;n(i+d+h)}function lb(){if(b[a.ShowLabels]){j(a.ShowLabels,true);if(k)X();else W();var c=k?"LabelsOn":"LabelsOff";$VE_A.Log($VE_A.PgName.Map,"MapStyleAerial-"+c,f)}else{W();$VE_A.Log($VE_A.PgName.Map,"MapStyleAerial",f)}}function W(){if(h==Msn.VE.DashboardStates.MapStyle.Aerial&&d==Msn.VE.DashboardStates.MapView.Ortho)return;h=Msn.VE.DashboardStates.MapStyle.Aerial;d=Msn.VE.DashboardStates.MapView.Ortho;n(i+d+h)}function mb(){X();$VE_A.Log($VE_A.PgName.Map,"MapStyleHybrid",f)}function X(){if(h==Msn.VE.DashboardStates.MapStyle.Hybrid&&d==Msn.VE.DashboardStates.MapView.Ortho)return;h=Msn.VE.DashboardStates.MapStyle.Hybrid;d=Msn.VE.DashboardStates.MapView.Ortho;n(i+d+h)}function v(){if(d==Msn.VE.DashboardStates.MapView.Ortho&&i==Msn.VE.DashboardStates.MapMode.Flatland)return;d=Msn.VE.DashboardStates.MapView.Ortho;if(i==Msn.VE.DashboardStates.MapMode.Flatland)switch(h){case Msn.VE.DashboardStates.MapStyle.Aerial:if($MVEM.IsEnabled(MapControl.Features.MapStyle.Aerial))n(i+d+h);else B();break;case Msn.VE.DashboardStates.MapStyle.Hybrid:if($MVEM.IsEnabled(MapControl.Features.MapStyle.Hybrid))n(i+d+h);else B();break;default:n(i+d+h)}else n(i+d);p()}function Q(c){if(i==Msn.VE.DashboardStates.MapMode.View3D&&g(b[a.Oblique]).hasClass("MSVE_selected")){q();c.cancelBubble=true;return}H()}function H(){if(typeof b[a.ObliqueNotification]!="undefined"&&b[a.ObliqueNotification])q();if(i==Msn.VE.DashboardStates.MapMode.View3D)e.Oblique3DFunctionality.ObliqueClickFunction();else sb()}var M=null;function eb(){var e=new Date;if(M!=null)if(e.getTime()-M.getTime()<1000)return;M=e;var d=!g(b[a.Oblique]).hasClass("MSVE_selected");c.Show3DBirdseye(d,h==Msn.VE.DashboardStates.MapStyle.Road||k);var i=d?"RequestLayerBirdsEyeOn":"RequestLayerBirdsEyeOff";$VE_A.Log($VE_A.PgName.Map,i,f)}var o;function sb(){if(d===Msn.VE.DashboardStates.MapView.Oblique)return;d=Msn.VE.DashboardStates.MapView.Oblique;z();if(k)h=Msn.VE.DashboardStates.MapStyle.Hybrid;else h=Msn.VE.DashboardStates.MapStyle.Aerial;if(typeof Msn.VE.API=="undefined")nb();else G()}function nb(){if(!o){var a=$ID("msve_mapContainer");o=document.createElement("div");o.id="animator";a.appendChild(o)}o.style.display="block";o.className="zoom_animation";window.setTimeout(G,2000)}function G(){if(o){o.parentNode.removeChild(o);o=null}if(c.IsDragging()||c.IsZooming()){window.setTimeout(G,250);return}n(i+d+h);var a=k?"LabelsOn":"LabelsOff";$VE_A.Log($VE_A.PgName.Map,"MapStyleOblique-"+a,f)}function kb(){Fb(Msn.VE.DashboardStates.MapMode.View3D+Msn.VE.DashboardStates.MapView.Oblique)}function gb(){if(d==Msn.VE.DashboardStates.MapView.StreetSide&&i==Msn.VE.DashboardStates.MapMode.Flatland)return;d=Msn.VE.DashboardStates.MapView.StreetSide;n(i+d);ib()}function ub(){if(h==Msn.VE.DashboardStates.MapStyle.Aerial){k=true;h=Msn.VE.DashboardStates.MapStyle.Hybrid}else if(h==Msn.VE.DashboardStates.MapStyle.Hybrid){k=false;h=Msn.VE.DashboardStates.MapStyle.Aerial}n(i+d+h);var a=k?"LabelsOn":"LabelsOff",b=d==Msn.VE.DashboardStates.MapView.Oblique?"MapStyleOblique":"MapStyleAerial";$VE_A.Log($VE_A.PgName.Map,a+"-"+b,f)}function jb(){c.EnableMode(Msn.VE.MapActionMode.Mode2D);$VE_A.Log($VE_A.PgName.Map,"Mode2D",f)}function pb(){if(typeof b[a.ThreeDUpdatedNotification]!="undefined"&&b[a.ThreeDUpdatedNotification])F();if(!c.IsModeEnabled(Msn.VE.MapActionMode.Mode3D)){if(typeof ShowMessage!="undefined"){ShowMessage(L_3DLoading_Text);window.setTimeout(View3DSwitch,200)}else c.EnableMode(Msn.VE.MapActionMode.Mode3D);$VE_A.Log($VE_A.PgName.Map,"Mode3D",f)}}function D(){if(VE_TrafficManager.turnedOn){g(b[a.Traffic]).addClass("MSVE_selected");b[a.Traffic].title=L_NavActionHideTrafficToolTip_Text}else{g(b[a.Traffic]).removeClass("MSVE_selected");b[a.Traffic].title=L_NavActionShowTrafficToolTip_Text}}function zb(){if(VE_TrafficManager.turnedOn)VE_TrafficManager.ClearTraffic();else{$VE_A.LogTrafficActivation($VE_A.PgName.Map);VE_TrafficManager.GetTrafficInfo(true)}}function qb(c){if(c.enabled=="1"){g(b[a.Oblique]).addClass("MSVE_selected");b[a.Oblique].title=L_NavActionHideObliqueToolTip_Text}else{g(b[a.Oblique]).removeClass("MSVE_selected");b[a.Oblique].title=L_NavActionShowObliqueToolTip_Text}var e=c.enabled=="1"?"LayerBirdsEyeOn":"LayerBirdsEyeOff",d=h==Msn.VE.DashboardStates.MapStyle.Road||k?"LabelsOn":"LabelsOff";$VE_A.Log($VE_A.PgName.Map,e+"-"+d,f)}function u(a){V(a.view.mapStyle)}function Y(a){if(a==Msn.VE.MapActionMode.Mode3D)T();else S()}function T(){if(i==Msn.VE.DashboardStates.MapMode.View3D)return;i=Msn.VE.DashboardStates.MapMode.View3D;if(typeof b[a.Mode]!="undefined"&&b[a.Mode]!=null)g(b[a.Mode].classRecipients).swapClass("MSVE_FlatlandMapMode","MSVE_View3DMapMode");j(a.StreetSide,true);j(a.Road,true);j(a.Aerial,true);j(a.Hybrid,true);if(!e.Oblique3DFunctionality.DependsOnObliqueAvailability)j(a.Oblique,true);else{if(b[a.ObliqueNotification]!=null&&b[a.ObliqueNotification].enabled&&!g(b[a.Oblique]).hasClass("MSVE_selected"))y();p()}if(typeof b[a.Ortho]!="undefined"&&b[a.Ortho]!=null)b[a.Ortho].title=L_NavAction3DOrthoToolTip_Text;if(typeof b[a.Oblique]!="undefined"&&b[a.Oblique]!=null){b[a.Oblique].title=e.Oblique3DFunctionality.Title;if(b[a.Oblique].enabled&&!g(b[a.Oblique]).hasClass("MSVE_selected"))y()}if(typeof b[a.StreetSide]!="undefined"&&b[a.StreetSide]!=null)b[a.StreetSide].title=L_NavAction3DStreetSideToolTip_Text;var f=c.GetDashboard().GetShimmedElements(),d;for(d=0;d<f.length;d++)mvcViewFacade.UpdateShimIfSupported(f[d])}function S(){i=Msn.VE.DashboardStates.MapMode.Flatland;if(typeof b[a.Mode]!="undefined"&&b[a.Mode]!=null)g(b[a.Mode].classRecipients).swapClass("MSVE_View3DMapMode","MSVE_FlatlandMapMode");if(typeof b[a.Ortho]!="undefined"&&b[a.Ortho]!=null)b[a.Ortho].title=L_NavActionOrthoToolTip_Text;if(typeof b[a.Oblique]!="undefined"&&b[a.Oblique]!=null)b[a.Oblique].title=L_NavActionObliqueToolTip_Text;g(b[a.Oblique]).removeClass("MSVE_selected");photoState=0;if($MVEM.IsEnabled(MapControl.Features.MapStyle.Road))j(a.Road,true);else j(a.Road,false);if($MVEM.IsEnabled(MapControl.Features.MapStyle.Aerial))j(a.Aerial,true);else j(a.Aerial,false);if($MVEM.IsEnabled(MapControl.Features.MapStyle.Hybrid))j(a.Hybrid,true);else j(a.Hybrid,false);if($MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye)){c.GetObliqueAvailability("OnFlatlandModeUpdateUIObliqueReturned",P);return}else P(false)}function P(b){if(b){j(a.Oblique,true);if(e.obliqueZoom!=null)e.obliqueZoom.UpdateFromMap()}else{j(a.Oblique,false);d=Msn.VE.DashboardStates.MapView.Ortho;p()}switch(d){case Msn.VE.DashboardStates.MapView.Oblique:if(b&&$MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye))n(i+d);else v();break;case Msn.VE.DashboardStates.MapView.StreetSide:v();break;case Msn.VE.DashboardStates.MapView.Ortho:switch(h){case Msn.VE.DashboardStates.MapStyle.Aerial:if($MVEM.IsEnabled(MapControl.Features.MapStyle.Aerial))n(i+d+h);else B();break;case Msn.VE.DashboardStates.MapStyle.Hybrid:if($MVEM.IsEnabled(MapControl.Features.MapStyle.Hybrid))n(i+d+h);else B();break;default:n(i+d+h)}break;default:v()}}function x(){if(e.orthoZoom)e.orthoZoom.UpdateFromMap();if(e.obliqueZoom)e.obliqueZoom.UpdateFromMap();var b=null,a=null;if(m){var f=m.GetPlus();if(f)b=g([f]);var d=m.GetMinus();if(d)a=g([d])}if(c.IsMapViewOrtho()&&c.GetZoomLevel()==19||c.IsMapViewOblique()&&c.GetZoomLevel()==2){if(b)b.addClass("MSVE_ZoomBar_plus_disabled");if(m)m.UnhookPlusEvents()}else if(c.GetZoomLevel()==1){if(a)a.addClass("MSVE_ZoomBar_minus_disabled");if(m)m.UnhookMinusEvents()}if(c.IsMapViewOrtho()&&c.GetZoomLevel()!=19||c.IsMapViewOblique()&&c.GetZoomLevel()!=2)if(b&&b.hasClass("MSVE_ZoomBar_plus_disabled")){b.removeClass("MSVE_ZoomBar_plus_disabled");if(m)m.HookupPlusEvents()}if(c.GetZoomLevel()!=1)if(a&&a.hasClass("MSVE_ZoomBar_minus_disabled")){a.removeClass("MSVE_ZoomBar_minus_disabled");if(m)m.HookupMinusEvents()}}function yb(){if(c.IsMapViewOblique())d=Msn.VE.DashboardStates.MapView.Oblique;if(i==Msn.VE.DashboardStates.MapMode.Flatland||i==Msn.VE.DashboardStates.MapMode.View3D&&e.Oblique3DFunctionality.DependsOnObliqueAvailability){j(a.Oblique,true);if(b[a.ObliqueNotification]&&!c.IsMapViewOblique()&&!g(b[a.Oblique]).hasClass("MSVE_selected"))y()}}function L(){d=Msn.VE.DashboardStates.MapView.Ortho;p();if(i==Msn.VE.DashboardStates.MapMode.Flatland||i==Msn.VE.DashboardStates.MapMode.View3D&&e.Oblique3DFunctionality.DependsOnObliqueAvailability){j(a.Oblique,false);q()}}function db(){if(c.IsObliqueAvailable())e.obliqueCompass.UpdateFromMap(s,true);else L()}function ob(){if(c.IsObliqueAvailable()){d=Msn.VE.DashboardStates.MapView.Ortho;p()}else L()}function vb(){if($MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye)){if(d!=Msn.VE.DashboardStates.MapView.Oblique){d=Msn.VE.DashboardStates.MapView.Oblique;j(a.Oblique,true);z()}}else{d=Msn.VE.DashboardStates.MapView.Oblique;v()}if(b[a.ObliqueNotification])q();if(typeof e.obliqueCompass!="undefined"&&e.obliqueCompass!=null){e.obliqueCompass.UpdateFromMap(s);s=Msn.VE.BirdsEyeSearchSpinDirection.NoSpin}}function V(e){if(!e)e=c.GetMapStyle();switch(e){case Msn.VE.MapStyle.Shaded:case Msn.VE.MapStyle.Road:d=Msn.VE.DashboardStates.MapView.Ortho;p();h=Msn.VE.DashboardStates.MapStyle.Road;tb();if(b[a.ShowLabels]){j(a.ShowLabels,false);g(b[a.ShowLabels]).addClass("MSVE_selected")}break;case Msn.VE.MapStyle.Aerial:d=Msn.VE.DashboardStates.MapView.Ortho;p();h=Msn.VE.DashboardStates.MapStyle.Aerial;I();k=false;if(b[a.ShowLabels]){j(a.ShowLabels,true);g(b[a.ShowLabels]).removeClass("MSVE_selected")}break;case Msn.VE.MapStyle.Hybrid:d=Msn.VE.DashboardStates.MapView.Ortho;p();h=Msn.VE.DashboardStates.MapStyle.Hybrid;if(b[a.ShowLabels]){k=true;I();j(a.ShowLabels,true);g(b[a.ShowLabels]).addClass("MSVE_selected")}else U();break;case Msn.VE.MapStyle.Oblique:d=Msn.VE.DashboardStates.MapView.Oblique;z();h=Msn.VE.DashboardStates.MapStyle.Aerial;if(b[a.ShowLabels]){I();k=false;j(a.ShowLabels,true);g(b[a.ShowLabels]).removeClass("MSVE_selected")}j(a.Oblique,true);break;case Msn.VE.MapStyle.ObliqueHybrid:d=Msn.VE.DashboardStates.MapView.Oblique;z();h=Msn.VE.DashboardStates.MapStyle.Hybrid;if(b[a.ShowLabels]){U();k=true;j(a.ShowLabels,true);g(b[a.ShowLabels]).addClass("MSVE_selected")}j(a.Oblique,true)}if(i==Msn.VE.DashboardStates.MapMode.View3D&&g(b[a.Oblique]).hasClass("MSVE_selected"))if(h==Msn.VE.DashboardStates.MapStyle.Road)c.Show3DBirdseye(true,true);else c.Show3DBirdseye(true,k);if(b[a.ShowLabels])if(k||h==Msn.VE.DashboardStates.MapStyle.Road)b[a.ShowLabels].title=L_NavActionHideLabels_Text;else b[a.ShowLabels].title=L_NavActionShowLabels_Text}function tb(){if(typeof b[a.Style]!="undefined"&&b[a.Style]!=null){var c;for(c=0;c<b[a.Style].classRecipients.length;c++)b[a.Style].classRecipients[c].className="MSVE_RoadMapStyle"}}function I(){if(typeof b[a.Style]!="undefined"&&b[a.Style]!=null){var c;for(c=0;c<b[a.Style].classRecipients.length;c++)b[a.Style].classRecipients[c].className="MSVE_AerialMapStyle"}}function U(){if(typeof b[a.Style]!="undefined"&&b[a.Style]!=null){var c;for(c=0;c<b[a.Style].classRecipients.length;c++)b[a.Style].classRecipients[c].className="MSVE_HybridMapStyle"}}function p(){if(typeof b[a.View]!="undefined"&&b[a.View]!=null){var c=g(b[a.View].classRecipients);c.removeClass("MSVE_StreetSideView");c.removeClass("MSVE_ObliqueView");c.addClass("MSVE_OrthoView")}if(b[a.Traffic]!=null){j(a.Traffic,true);D()}s=Msn.VE.BirdsEyeSearchSpinDirection.NoSpin}function z(){if(typeof b[a.View]!="undefined"&&b[a.View]!=null){var c=g(b[a.View].classRecipients);c.removeClass("MSVE_StreetSideView");c.removeClass("MSVE_OrthoView");c.addClass("MSVE_ObliqueView")}if(J){if(e.obliqueCompass==null){e.obliqueCompass=new wb(b[a.ObliqueCompass]);if(b[a.ObliqueCompass].radius)e.obliqueCompass.SetRadius(b[a.ObliqueCompass].radius);e.obliqueCompass.onclick=function(){s=Msn.VE.BirdsEyeSearchSpinDirection.NoSpin}}e.obliqueCompass.UpdateFromMap()}if(Z){if(e.obliqueZoom==null){e.obliqueZoom=new xb(b[a.ObliqueZoom]);e.obliqueZoom.Init()}e.obliqueZoom.UpdateFromMap()}if(b[a.Traffic]!=null&&i==Msn.VE.DashboardStates.MapMode.Flatland)j(a.Traffic,false)}function ib(){if(typeof b[a.View]!="undefined"&&b[a.View]!=null){var c=g(b[a.View].classRecipients);c.removeClass("MSVE_OrthoView");c.removeClass("MSVE_ObliqueView");c.addClass("MSVE_StreetSideView")}}function y(){if(!b[a.ObliqueNotification])return;if(R)return;R=true;if(!e.displaying3DNotification)if(d!=Msn.VE.DashboardStates.MapView.Oblique){if(!A){var o=g(b[a.ObliqueNotification]),k=o.select("img");for(var i=0;i<k.length&&!A;i++){var j=k.element(i);if(j.id=="MSVE_obliqueNotifyImg")A=j}}if(A)A.src=c.GetObliqueMode().GetMiddleTileFilename();var f=b[a.Oblique];b[a.ObliqueNotification].style.display="block";var m=f.offsetLeft+f.offsetWidth/2-b[a.ObliqueNotification].offsetWidth/2,n=f.offsetTop+f.offsetHeight+4;g(b[a.ObliqueNotification]).setStyle("top",n+"px").setStyle("left",m+"px");var l=E(),h;for(h=0;h<l.length;++h)mvcViewFacade.UpdateShimIfSupported(l[h]);m=n=f=null;window.setTimeout(q,6000)}}function ab(){if(!b[a.ThreeDUpdatedNotification])return;q();if(!e.displaying3DNotification){e.displaying3DNotification=true;var c=b[a.Mode3D];b[a.ThreeDUpdatedNotification].style.display="block";var d=c.offsetLeft-6,f=c.offsetTop+c.offsetHeight+4;g(b[a.ThreeDUpdatedNotification]).setStyle("top",f+"px").setStyle("left",d+"px");mvcViewFacade.UpdateShimIfSupported(b[a.ThreeDUpdatedNotification]);c=null;window.setTimeout(F,6000)}}function q(){b[a.ObliqueNotification].style.display="none";var d=E(),c;for(c=0;c<d.length;++c)mvcViewFacade.UpdateShimIfSupported(d[c])}function F(){e.displaying3DNotification=false;b[a.ThreeDUpdatedNotification].style.display="none";mvcViewFacade.UpdateShimIfSupported(b[a.ThreeDUpdatedNotification])}function j(c,d){if(b[c]==null)return;if(b[c].enabled==d)return;b[c].enabled=d;var a=l[c];if(a.InitialClass)if(d)g(b[c]).swapClass(a.InitialClass+"_disabled",a.InitialClass);else g(b[c]).swapClass(a.InitialClass,a.InitialClass+"_disabled");if(a.Title)b[c].title=a.Title;if(a.OnClickFunction)if(d)b[c].attachEvent("onclick",a.OnClickFunction);else b[c].detachEvent("onclick",a.OnClickFunction)}function n(d){if(d&Msn.VE.DashboardStates.MapView.Ortho||d&Msn.VE.DashboardStates.MapMode.View3D)if(d&Msn.VE.DashboardStates.MapStyle.Road)c.SetMapStyle("r");else if(d&Msn.VE.DashboardStates.MapStyle.Aerial)c.SetMapStyle("a");else if(d&Msn.VE.DashboardStates.MapStyle.Hybrid)c.SetMapStyle("h");if(d&Msn.VE.DashboardStates.MapMode.Flatland&&d&Msn.VE.DashboardStates.MapView.Oblique)if(d&Msn.VE.DashboardStates.MapStyle.Aerial&&c.GetMapStyle()!=Msn.VE.MapStyle.Oblique){k=false;if(b[a.ShowLabels]){j(a.ShowLabels,true);g(b[a.ShowLabels]).removeClass("MSVE_selected")}c.SetMapStyle(Msn.VE.MapStyle.Oblique)}else if(d&Msn.VE.DashboardStates.MapStyle.Hybrid&&c.GetMapStyle()!=Msn.VE.MapStyle.ObliqueHybrid){k=true;if(b[a.ShowLabels]){j(a.ShowLabels,true);g(b[a.ShowLabels]).addClass("MSVE_selected")}c.SetMapStyle(Msn.VE.MapStyle.ObliqueHybrid)}}function Fb(a){if(a&Msn.VE.DashboardStates.MapMode.View3D)if(a&Msn.VE.DashboardStates.MapView.Ortho)c.SetTilt(-90);else if(a&Msn.VE.DashboardStates.MapView.Oblique)c.SetTilt(-45);else if(a&Msn.VE.DashboardStates.MapView.StreetSide)c.SetTilt(-25)}function E(){return [b[a.ObliqueNotification]]}function Eb(a){return b[a]}function Bb(){return b}function Cb(){return m}function fb(){return s}function hb(a){s=a}this.SetMapViewState=function(a){d=a};this.GetMapViewState=function(){return d};this.SetMapModeState=function(a){i=a};this.GetMapModeState=function(){return i};this.SetLabelsState=function(a){k=a};this.GetLabelsState=function(){return k};this.GetLastRotationDirection=fb;this.SetLastRotationDirection=hb;this.GetObliqueNotifierShimmedElements=E;this.Init=Hb;this.Create=N;this.Destroy=Gb;this.DestroyControl=K;this.GetControl=Eb;this.GetControls=Bb;this.GetTinyZoom=Cb;this.OnOrthoMapViewClick=v;this.OnObliqueMapViewClick=H;this.UpdateZoom=x;this.SelectObliqueMapView=z;this.SelectOrthoMapView=p;this.DisplayObliqueNotification=y;this.HideObliqueNotification=q;this.DisplayThreeDUpdatedNotification=ab;this.HideThreeDUpdatedNotification=F};var c=document.createElement("div");c.id=D;A.appendChild(c);c.attachEvent("onmousedown",IgnoreEvent);c.attachEvent("onmouseup",IgnoreEvent);c.attachEvent("onmousemove",DashboardContainerMouseMoveEvent);c.attachEvent("onmousewheel",IgnoreEvent);c.attachEvent("ondblclick",IgnoreEvent);c.attachEvent("oncontextmenu",IgnoreEvent);c.attachEvent("onkeydown",IgnoreEvent);c.attachEvent("onkeyup",IgnoreEvent);c.className="MSVE_Dashboard MSVE_Dashboard_V5 MSVE_FlatlandMapMode";if(j==Msn.VE.DashboardSize.Normal)c.className+=" MSVE_Dashboard_Normal";else if(j==Msn.VE.DashboardSize.Small)c.className+=" MSVE_Dashboard_Small";else if(j==Msn.VE.DashboardSize.Tiny)c.className+=" MSVE_Dashboard_Tiny";var i=null,h=document.createElement("div");h.className="MSVE_header";h.id="MSVE_navAction_header";var e,d,b=t,p=document.createElement("div");p.id="MSVE_dashboardContainer";var r=document.createElement("div");r.id="MSVE_mapViewRow";p.appendChild(r);var n=document.createElement("div");n.id="MSVE_zoomDiv";var q=document.createElement("div");q.id="MSVE_navAction_mapViewCell";q.className="MSVE_dashboardMapModeContainer";r.appendChild(n);r.appendChild(q);var m=document.createElement("div");m.id="MSVE_mapStyleRow";p.appendChild(m);var k=document.createElement("div");k.id="MSVE_threeDNotification";var o=document.createElement("div");o.id="MSVE_lowerContainer";o.appendChild(p);c.className+=" expanded";c.appendChild(h);c.appendChild(o);var l=false;function F(){if(j==Msn.VE.DashboardSize.Normal){controlsNeeded=[b.Mode,b.View,b.Style,b.OrthoZoom,b.ObliqueCompass,b.ObliqueZoom];e=new Msn.VE.CommonControls(a,controlsNeeded);d=e.GetControls();e.displaying3DNotification=false;d[b.View].classRecipients=[p];d[b.Mode].classRecipients=[c];e.Oblique3DFunctionality=e.ObliqueFunctions.ObliqueTiltIn3D;e.Init();C(y);this.HideToggleGlyph();q.appendChild(d[b.View]);m.appendChild(d[b.Style]);m.appendChild(d[b.ObliqueCompass]);n.appendChild(d[b.OrthoZoom]);n.appendChild(d[b.ObliqueZoom]);if(B&&$MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye)){e.Create(b.ObliqueNotification);o.appendChild(d[b.ObliqueNotification])}if(Msn.VE.Animation)u()}if(j==Msn.VE.DashboardSize.Small){controlsNeeded=[b.Style];e=new Msn.VE.CommonControls(a,controlsNeeded);d=e.GetControls();m.appendChild(d[b.Style]);e.Init()}if(j==Msn.VE.DashboardSize.Small||j==Msn.VE.DashboardSize.Tiny){controlsNeeded=[b.TinyZoom];e=new Msn.VE.CommonControls(a,controlsNeeded);d=e.GetControls();n.appendChild(d[b.TinyZoom]);var f=e.GetTinyZoom(),h=f.GetPlus(),g=f.GetMinus();if(h&&g)f.HookupPlusMinusEvents(h,g)}}function E(){if(j==Msn.VE.DashboardSize.Normal){e.DestroyControl(d[b.OrthoZoom]);e.DestroyControl(d[b.ObliqueZoom]);e.DestroyControl(d[b.ObliqueCompass]);z();if(a){try{a.DetachEvent("onobliquechange",OnObliqueChange);if($MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye)){a.DetachEvent("onobliqueenter",OnObliqueEnter);a.DetachEvent("onobliqueleave",OnObliqueLeave)}}catch(c){}a=null}}if(j==Msn.VE.DashboardSize.Normal||j==Msn.VE.DashboardSize.Small){e.DestroyControl(d[b.Style]);m.removeChild(d[b.Style])}if(j==Msn.VE.DashboardSize.Small||j==Msn.VE.DashboardSize.Tiny){e.DestroyControl(d[b.TinyZoom]);n.removeChild(d[b.TinyZoom])}m=e.obliqueCompass=null;q=r=null;o=null;k=null;d[b.ObliqueNotification]=n=d[b.ObliqueCompass]=null}function w(){if(!a.IsModeEnabled(Msn.VE.MapActionMode.Mode3D)&&!a.IsMapViewOblique()){o.appendChild(k);k.style.top=-(h.offsetHeight/2+6)+"px";k.innerHTML+='<div id="MSVE_threeDNotifyIcon">&nbsp;</div> <div id="MSVE_threeDNotifyText">'+L_Dashboard3DText_Text+"</div>";k.attachEvent("onclick",v);window.setTimeout(x,6000);e.displaying3DNotification=true}else k.style.display="none"}function C(a){s(a);i=document.createElement("a");i.className="MSVE_toggleGlyph";i.title=L_NavActionHideToolTip_Text;h.appendChild(i)}function s(a){if($MVEM.IsEnabled(MapControl.Features.MapStyle.View3D)&&a!=false){if(!l){e.Create(b.Mode);h.appendChild(d[b.Mode]);w();l=true}h.className="MSVE_header MSVE_with3D"}else{h.className="MSVE_header MSVE_no3D";l=false}}function z(){if(l){e.DestroyControl(b.Mode);if(d[b.Mode]!=null)h.removeChild(d[b.Mode]);l=false}h.removeChild(i);c.removeChild(h);i=h=null}function v(){k.style.display="none";e.displaying3DNotification=false;if(!a.IsModeEnabled(Msn.VE.MapActionMode.Mode3D))if(typeof ShowMessage!="undefined"){ShowMessage(L_3DLoading_Text);window.setTimeout(View3DSwitch,200)}else a.EnableMode(Msn.VE.MapActionMode.Mode3D)}function x(){if(k){k.style.display="none";e.displaying3DNotification=false}if(a!=null&&!a.IsModeEnabled(Msn.VE.MapActionMode.Mode3D))if(a.IsObliqueAvailable()&&$MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye))e.DisplayObliqueNotification()}this.SetX=function(a){c.style.left=a+"px"};this.GetElement=function(){return c};this.GetShimmedElements=function(){return [c]};this.GetHeader=function(){return h};this.GetY=function(){return g(c).getScreenPosition().y};this.GetHeight=function(){return c.offsetHeight};this.ShowToggleGlyph=function(){if(i!=null&&i!="undefined")i.style.display="block"};this.HideToggleGlyph=function(){if(i!=null&&i!="undefined")i.style.display="none"};this.SetShowMapModeSwitch=function(a){if(a!=l){if(!a){e.DestroyControl(b.Mode);h.removeChild(d[b.Mode]);l=false}s(a)}};function u(){var b=a.GetDashboard().GetHeader().lastChild;a.GetDashboard().ShowToggleGlyph();window.dbRoller=new Msn.VE.Animation.Roller(a.GetDashboard().GetElement());dbRoller.setAccelerationFunction(AccelerationFunctions.CrazyElevator);dbRoller.setYLeave(32);dbRoller.hookEvent("beforerollin",function(){dbRoller.setYLeave(a.GetDashboard().GetHeader().offsetHeight);if(a.GetMinimap()){a.GetMinimap().Hide();if(a.GetMinimap().IsInitialized())a.GetMinimap().SetDoUpdates(false)}});dbRoller.hookEvent("afterrollin",function(){a.GetDashboard().GetElement().className=a.GetDashboard().GetElement().className.replace(/\s*expanded/g,"");a.GetDashboard().GetElement().className+=" collapsed";a.GetDashboard().GetHeader().lastChild.title=L_NavActionShowToolTip_Text});dbRoller.hookEvent("beforerollout",function(){a.GetDashboard().GetElement().className=a.GetDashboard().GetElement().className.replace(/\s*collapsed/g,"");a.GetDashboard().GetElement().className+=" expanded"});dbRoller.hookEvent("afterrollout",function(){if(a.GetMinimap()){a.GetMinimap().Show();if(minimapRoller&&minimapRoller.isExpanded()&&a.GetMinimap().IsInitialized())a.GetMinimap().SetDoUpdates(true)}a.GetDashboard().GetHeader().lastChild.title=L_NavActionHideToolTip_Text});dbRoller.hookEvent("roll",RollShim);b.onclick=function(){if(dbRoller.isExpanded())dbRoller.rollIn(Msn.VE.Animation.RollDirection.BottomUp);else dbRoller.rollOut(Msn.VE.Animation.RollDirection.TopDown);return false};b=null}this.Hide=function(){if(c)c.style.display="none"};this.Show=function(){if(c)c.style.display="block"};this.Init=F;this.Destroy=E;this.createRoller=u};function DashboardContainerMouseMoveEvent(a){a=GetEvent(a);return false}Msn.VE.V6Control=function(L,e,lb,jb,E,ab,W){Msn.VE.DashboardStates=new function(){this.MapMode=new function(){this.Flatland=1;this.View3D=2};this.MapView=new function(){this.Ortho=4;this.Oblique=8;this.StreetSide=16};this.MapStyle=new function(){this.Road=32;this.Shaded=64;this.Aerial=128;this.Hybrid=256}};var H={Style:"MSVE_navAction_mapStyleCell",Road:"MSVE_navAction_RoadMapStyle",Aerial:"MSVE_navAction_AerialMapStyle",Hybrid:"MSVE_navAction_HybridMapStyle",Mode:"MSVE_navAction_modeCell",Mode2D:"MSVE_navAction_FlatlandMapMode",Mode3D:"MSVE_navAction_View3DMapMode",View:"MSVE_navAction_mapViewCellInner",Ortho:"MSVE_navAction_OrthoMapView",Oblique:"MSVE_navAction_ObliqueMapView",StreetSide:"MSVE_navAction_StreetSideMapView",ShowLabels:"MSVE_navAction_showLabels",Pan:"MSVE_navAction_panContainer",PanUp:"MSVE_navAction_panUp",PanDown:"MSVE_navAction_panDown",PanLeft:"MSVE_navAction_panLeft",PanRight:"MSVE_navAction_panRight",TinyZoom:"MSVE_TinyZoomBar",OrthoZoom:"MSVE_OrthoZoomBar",ObliqueZoom:"MSVE_ObliqueZoomBar",ObliqueCompass:"MSVE_compassDiv",ObliqueNotification:"MSVE_obliqueNotification",ThreeDUpdatedNotification:"MSVE_threeDUpdatedNotification",Traffic:"MSVE_navAction_traffic"},f="Nav Bar";Msn.VE.CommonControls=function(c,v){function xb(b){var f=document.createElement("div"),e=document.createElement("div"),a=document.createElement("div"),d=document.createElement("div"),w=0,s=0,j=false;this.Init=function(){d.className="MSVE_ZoomBar_minus";d.id="MSVE_navAction_obliqueZoomBar_minus";d.unselectable="on";d.title=L_ZoomBarMinusToolTip_Text;d.attachEvent("onclick",l);pseudoHover(d);a.className="MSVE_ZoomBar_slider";a.id="MSVE_navAction_obliqueZoomBar_slider";a.unselectable="on";a.attachEvent("onmousedown",o);a.attachEvent("onmousemove",p);a.attachEvent("onmouseup",q);a.attachEvent("onclick",IgnoreEvent);pseudoHover(a);e.className="MSVE_ObliqueZoomBar_bar";e.unselectable="on";e.appendChild(a);e.attachEvent("onclick",r);f.className="MSVE_ZoomBar_plus";f.id="MSVE_navAction_obliqueZoomBar_plus";f.title=L_ZoomBarPlusToolTip_Text;f.unselectable="on";f.attachEvent("onclick",m);pseudoHover(f);b.className="MSVE_ZoomBar";b.id="MSVE_ObliqueZoomBar";b.appendChild(d);b.appendChild(e);b.appendChild(f);b.attachEvent("onmousedown",IgnoreEvent);b.attachEvent("onmouseup",IgnoreEvent);b.attachEvent("onclick",IgnoreEvent);b.attachEvent("ondblclick",IgnoreEvent);i()};function v(){b.style.display="block"}function u(){b.style.display="none"}function r(a){a=GetEvent(a);CancelEvent(a);k();n(h(Gimme.Screen.getMousePosition(a).y));return false}function h(b){b-=s+d.offsetHeight+a.offsetHeight;var c=e.offsetHeight-a.offsetHeight;if(b<0)b=0;else if(b>c)b=c;return b}function l(){c.ZoomOut();$VE_A.Log($VE_A.PgName.Map,"Zoom out","Nav Bar")}function m(){c.ZoomIn();$VE_A.Log($VE_A.PgName.Map,"Zoom in","Nav Bar")}function t(){d.detachEvent("onclick",l);a.detachEvent("onmousedown",o);a.detachEvent("onmousemove",p);a.detachEvent("onmouseup",q);a.detachEvent("onclick",IgnoreEvent);e.detachEvent("onclick",r);f.detachEvent("onclick",m);b.detachEvent("onmousedown",IgnoreEvent);b.detachEvent("onmousedown",IgnoreEvent);b.detachEvent("onclick",IgnoreEvent);b.detachEvent("ondblclick",IgnoreEvent);d=a=e=f=null}function o(b){b=GetEvent(b);CancelEvent(b);k();if(a.setCapture)a.setCapture();j=true;return false}function p(b){b=GetEvent(b);CancelEvent(b);if(j)a.style.top=h(Gimme.Screen.getMousePosition(b).y)+"px";return false}function q(b){b=GetEvent(b);CancelEvent(b);if(a.releaseCapture)a.releaseCapture();j=false;n(h(Gimme.Screen.getMousePosition(b).y));i();return false}function k(){var a=g(b).getScreenPosition();w=a.x;s=a.y}function n(f){var b=e.offsetHeight-a.offsetHeight,d=1+MathRound((b-f)/b*1);c.SetZoom(d);$VE_A.Log($VE_A.PgName.Map,"Zoom")}function i(){if(c.GetZoomLevel()==1)a.style.top=e.offsetHeight-a.offsetHeight+"px";else a.style.top="0px"}this.Destroy=t;this.Show=v;this.Hide=u;this.UpdateFromMap=i}function B(z,x,y){var a=document.createElement("div");a.setAttribute("id",z);a.innerHTML=x;var c="MSVE_obliqueCompassPointOff",g=y;a.attachEvent("onmouseover",f);a.attachEvent("onmouseout",h);a.attachEvent("onclick",i);this.onclick=null;this.onmouseover=null;this.onmouseout=null;var e=25,b=this,d=false,j=new v(a,17,17);function f(e){if(d)return;c=a.className;a.className="MSVE_obliqueCompassPointHover";if(b.onmouseover)b.onmouseover(e)}function i(a){if(d)return;f(a);c="MSVE_obliqueCompassPointOn";if(b.onclick)b.onclick(a)}function h(e){if(d)return;a.className=c;if(b.onmouseout)b.onmouseout(e)}function m(){c="MSVE_obliqueCompassPointOn";a.className="MSVE_obliqueCompassPointOn"}function l(){c="MSVE_obliqueCompassPointOff";a.className="MSVE_obliqueCompassPointOff"}function u(){d=true;l()}function k(){d=false;m()}function q(){return a}function n(){return g}function o(a){g=a}function w(){j.Reset();k()}function p(b){a.style.left=b.left;a.style.top=b.top}function v(r,n,o){var g=r,a=0,b=.3,c=0,l=40,k=Math.PI/2,h=true,p=b+.1;function m(a,b,c){if(b>=c-a&&b<=c+a)return true;return false}function i(){a+=b;if(a>Math.PI*2)a-=Math.PI*2;else if(a<0)a+=Math.PI*2;if(m(p,a,c)){b=.3;a=c;d(a);return}d(a);window.setTimeout(i,l)}function d(a){var b=n+e*Math.sin(a),c=o+e*Math.cos(a);g.style.left=b+"px";g.style.top=c+"px"}function f(a){c=a;i()}function j(a,c){h=c;if(!h)b*=-1;f(k*a)}function q(){a=0}this.RotateTo=f;this.RotateToIndex=j;this.Reset=q}function t(){a.detachEvent("onmouseover",f);a.detachEvent("onmouseout",h);a.detachEvent("onclick",i);a=null}function s(a){e=a}function r(){return e}this.SetRadius=s;this.GetRadius=r;this.GetElement=q;this.GetCurrentPositionIndex=n;this.SetCurrentPositionIndex=o;this.SetCurrentPosition=p;this.On=m;this.Off=l;this.RotateToIndex=j.RotateToIndex;this.Reset=w;this.Disable=u;this.Enable=k;this.Destroy=t}function wb(E){var p=[];p.push({"top":"-8px","left":"17px"});p.push({"top":"17px","left":"42px"});p.push({"top":"42px","left":"17px"});p.push({"top":"17px","left":"-8px"});var g=document.createElement("div");g.setAttribute("id","MSVE_obliqueCompassContainer");g.title=L_ObliqueCompassSelectDirection_Text;var a=new B("MSVE_obliqueCompassPointN","N",0),j=a.GetElement();j.attachEvent("onclick",s);j.attachEvent("onmouseover",v);j.attachEvent("onmouseout",i);var d=new B("MSVE_obliqueCompassPointE","E",1),l=d.GetElement();l.attachEvent("onclick",u);l.attachEvent("onmouseover",y);l.attachEvent("onmouseout",i);var b=new B("MSVE_obliqueCompassPointS","S",2),k=b.GetElement();k.attachEvent("onclick",t);k.attachEvent("onmouseover",w);k.attachEvent("onmouseout",i);var e=new B("MSVE_obliqueCompassPointW","W",3),m=e.GetElement();m.attachEvent("onclick",x);m.attachEvent("onmouseover",z);m.attachEvent("onmouseout",i);var n=document.createElement("div");n.id="MSVE_navAction_obliqueCompassArrow";g.appendChild(j);g.appendChild(l);g.appendChild(k);g.appendChild(m);g.appendChild(n);E.appendChild(g);r();function q(a){if(a<0)a=4-Math.abs(a);return a}function o(l,i,k){var c=l.GetCurrentPositionIndex(),h,f=[];f[a.GetCurrentPositionIndex()]=L_North_Text;f[b.GetCurrentPositionIndex()]=L_South_Text;f[d.GetCurrentPositionIndex()]=L_East_Text;f[e.GetCurrentPositionIndex()]=L_West_Text;if(i){h=i==Msn.VE.BirdsEyeSearchSpinDirection.CounterclockwiseSpin;if(c+i!=2){var g;switch(i){case -1:switch(c){case 0:case 2:g=[3];break;case 1:g=[3,2]}break;case 1:switch(c){case 0:case 2:g=[1];break;case 3:g=[1,2]}}if(g){var j=L_ObliqueSkippingOneDirection_Text;if(c==0)j=L_ObliqueNoImageryInRequestedDirection_Text;if(g.length==2)j=L_ObliqueSkippingTwoDirections_Text;if(typeof ShowMessage!="undefined")ShowMessage(j.replace("%1",f[c]).replace("%2",f[g[0]]).replace("%3",f[g[1]]))}}}else{h=c!=3;if(k)if(c==0){if(typeof ShowMessage!="undefined")ShowMessage(L_ObliqueModeImageNotAvailable_Text)}else if(typeof ShowMessage!="undefined")ShowMessage(L_ObliqueNoImageryInRequestedDirection_Text.replace("%1",f[c]).replace("%2",f[0]))}d.SetCurrentPositionIndex(q(d.GetCurrentPositionIndex()-c));e.SetCurrentPositionIndex(q(e.GetCurrentPositionIndex()-c));a.SetCurrentPositionIndex(q(a.GetCurrentPositionIndex()-c));b.SetCurrentPositionIndex(q(b.GetCurrentPositionIndex()-c));a.RotateToIndex(2-a.GetCurrentPositionIndex()<0?a.GetCurrentPositionIndex():2-a.GetCurrentPositionIndex(),h);d.RotateToIndex(2-d.GetCurrentPositionIndex()<0?d.GetCurrentPositionIndex():2-d.GetCurrentPositionIndex(),h);b.RotateToIndex(2-b.GetCurrentPositionIndex()<0?b.GetCurrentPositionIndex():2-b.GetCurrentPositionIndex(),h);e.RotateToIndex(2-e.GetCurrentPositionIndex()<0?e.GetCurrentPositionIndex():2-e.GetCurrentPositionIndex(),h)}function h(a){switch(a){case 0:i();break;case 1:A();break;case 2:C();break;case 3:D()}}function i(){n.className="MSVE_obliqueCompassArrowU"}function C(){n.className="MSVE_obliqueCompassArrowD"}function A(){n.className="MSVE_obliqueCompassArrowR"}function D(){n.className="MSVE_obliqueCompassArrowL"}function t(){if(c.GetDashboard()&&c.GetDashboard().SetLastRotationDirection)c.GetDashboard().SetLastRotationDirection(Msn.VE.BirdsEyeSearchSpinDirection.NoSpin);o(b);h(0);var a=c.GetObliqueScene();if(a)if(a.GetOrientation()!=Msn.VE.Orientation.South)c.SetObliqueOrientation("South",null,true);$VE_A.Log($VE_A.PgName.Map,"Rotate - South",f)}function s(){if(c.GetDashboard()&&c.GetDashboard().SetLastRotationDirection)c.GetDashboard().SetLastRotationDirection(Msn.VE.BirdsEyeSearchSpinDirection.NoSpin);o(a);h(0);var b=c.GetObliqueScene();if(b)if(b.GetOrientation()!=Msn.VE.Orientation.North)c.SetObliqueOrientation("North",null,true);$VE_A.Log($VE_A.PgName.Map,"Rotate - North",f)}function u(){if(c.GetDashboard()&&c.GetDashboard().SetLastRotationDirection)c.GetDashboard().SetLastRotationDirection(Msn.VE.BirdsEyeSearchSpinDirection.NoSpin);o(d);h(0);var a=c.GetObliqueScene();if(a)if(a.GetOrientation()!=Msn.VE.Orientation.East)c.SetObliqueOrientation("East",null,true);$VE_A.Log($VE_A.PgName.Map,"Rotate - East",f)}function x(){if(c.GetDashboard()&&c.GetDashboard().SetLastRotationDirection)c.GetDashboard().SetLastRotationDirection(Msn.VE.BirdsEyeSearchSpinDirection.NoSpin);o(e);h(0);var a=c.GetObliqueScene();if(a)if(a.GetOrientation()!=Msn.VE.Orientation.West)c.SetObliqueOrientation("West",null,true);$VE_A.Log($VE_A.PgName.Map,"Rotate - West",f)}function w(){h(b.GetCurrentPositionIndex())}function y(){h(d.GetCurrentPositionIndex())}function z(){h(e.GetCurrentPositionIndex())}function v(){h(a.GetCurrentPositionIndex())}function I(){g.style.display="none"}function J(){g.style.display="block"}function r(k,j){var i=c.GetObliqueScene();if(!i)return;var f=i.GetOrientation(),g;switch(f){case "North":g=a;break;case "South":g=b;break;case "East":g=d;break;case "West":g=e}o(g,k,j);h(0);if(f!=Msn.VE.Orientation.North)a.Enable();else a.Disable();if(f!=Msn.VE.Orientation.South)b.Enable();else b.Disable();if(f!=Msn.VE.Orientation.East)d.Enable();else d.Disable();if(f!=Msn.VE.Orientation.West)e.Enable();else e.Disable()}function H(){a.Destroy();d.Destroy();b.Destroy();e.Destroy();j.detachEvent("onclick",s);j.detachEvent("onmouseover",v);j.detachEvent("onmouseout",i);l.detachEvent("onclick",u);l.detachEvent("onmouseover",y);l.detachEvent("onmouseout",i);k.detachEvent("onclick",t);k.detachEvent("onmouseover",w);k.detachEvent("onmouseout",i);m.detachEvent("onclick",x);m.detachEvent("onmouseover",z);m.detachEvent("onmouseout",i);g=null}function G(c){a.SetRadius(c);b.SetRadius(c);d.SetRadius(c);e.SetRadius(c)}function F(){return a.GetRadius()}this.Hide=I;this.Show=J;this.UpdateFromMap=r;this.SetRadius=G;this.GetRadius=F;this.Destroy=H}function Ab(b){var f=document.createElement("div"),e=document.createElement("div"),a=document.createElement("div"),d=document.createElement("div"),v=0,s=0,j=false;this.Init=function(){d.className="MSVE_ZoomBar_minus";d.id="MSVE_navAction_orthoZoomBar_minus";d.title=L_ZoomBarMinusToolTip_Text;d.unselectable="on";d.attachEvent("onclick",l);pseudoHover(d);a.className="MSVE_ZoomBar_slider";a.id="MSVE_navAction_orthoZoomBar_slider";a.title=L_ZoomBarSliderToolTip_Text;a.unselectable="on";a.attachEvent("onmousedown",o);a.attachEvent("onmousemove",p);a.attachEvent("onmouseup",q);a.attachEvent("onclick",IgnoreEvent);pseudoHover(a);e.className="MSVE_OrthoZoomBar_bar";e.unselectable="on";e.appendChild(a);e.attachEvent("onclick",r);f.className="MSVE_ZoomBar_plus";f.id="MSVE_navAction_orthoZoomBar_plus";f.title=L_ZoomBarPlusToolTip_Text;f.unselectable="on";f.attachEvent("onclick",m);pseudoHover(f);b.className="MSVE_ZoomBar";b.id="MSVE_OrthoZoomBar";b.appendChild(d);b.appendChild(e);b.appendChild(f);b.attachEvent("onmousedown",IgnoreEvent);b.attachEvent("onmouseup",IgnoreEvent);b.attachEvent("onclick",IgnoreEvent);b.attachEvent("ondblclick",IgnoreEvent);i()};this.Destroy=function(){d.detachEvent("onclick",l);a.detachEvent("onmousedown",o);a.detachEvent("onmousemove",p);a.detachEvent("onmouseup",q);a.detachEvent("onclick",IgnoreEvent);e.detachEvent("onclick",r);f.detachEvent("onclick",m);b.detachEvent("onmousedown",IgnoreEvent);b.detachEvent("onmousedown",IgnoreEvent);b.detachEvent("onclick",IgnoreEvent);b.detachEvent("ondblclick",IgnoreEvent);d=a=e=f=null};function u(){b.style.display="block"}function t(){b.style.display="none"}function k(){var a=g(b).getScreenPosition();v=a.x;s=a.y}function o(b){b=GetEvent(b);CancelEvent(b);k();if(a.setCapture)a.setCapture();j=true;return false}function p(b){b=GetEvent(b);CancelEvent(b);if(j)a.style.top=h(Gimme.Screen.getMousePosition(b).y)+"px";return false}function q(b){b=GetEvent(b);CancelEvent(b);if(a.releaseCapture)a.releaseCapture();j=false;n(h(Gimme.Screen.getMousePosition(b).y));i();return false}function m(){c.ZoomIn();$VE_A.Log($VE_A.PgName.Map,"Zoom in","Nav Bar")}function l(){c.ZoomOut();$VE_A.Log($VE_A.PgName.Map,"Zoom out","Nav Bar")}function r(a){a=GetEvent(a);CancelEvent(a);k();n(h(Gimme.Screen.getMousePosition(a).y));return false}function h(b){b-=s+d.offsetHeight+a.offsetHeight;var c=e.offsetHeight-a.offsetHeight;if(b<0)b=0;else if(b>c)b=c;return b}function n(f){var b=e.offsetHeight-a.offsetHeight,d=1+MathRound((b-f)/b*18);c.SetZoom(d);$VE_A.Log($VE_A.PgName.Map,"Zoom")}function i(){var b=e.offsetHeight-a.offsetHeight,d=b-(c.GetZoomLevel()-1)/18*b;a.style.top=d+"px"}this.UpdateFromMap=i;this.Show=u;this.Hide=t}function Db(){var h=document.createElement("div"),g=document.createElement("div"),f=document.createElement("div"),a=false,d=g,b=f;this.Init=function(){g.className="MSVE_ZoomBar_plus";g.id="MSVE_navAction_tinyZoomBar_plus";g.title=L_ZoomBarPlusToolTip_Text;g.unselectable="on";f.className="MSVE_ZoomBar_minus";f.id="MSVE_navAction_tinyZoomBar_minus";f.title=L_ZoomBarMinusToolTip_Text;f.unselectable="on";c.AttachEvent("onendzoom",i);h.className="MSVE_ZoomBar";h.id="MSVE_TinyZoomBar";h.appendChild(g);h.appendChild(f);return h};this.HookupPlusMinusEvents=function(b,a){m(b);j(a)};function m(a){if(a)d=a;d.attachEvent("onmousedown",o);d.attachEvent("onmouseup",e);d.attachEvent("onmouseout",e)}this.HookupPlusEvents=m;function j(a){if(a)b=a;b.attachEvent("onmousedown",l);b.attachEvent("onmouseup",e);b.attachEvent("onmouseout",e)}this.HookupMinusEvents=j;function n(){if(d!=null){d.detachEvent("onmousedown",o);d.detachEvent("onmouseup",e);d.detachEvent("onmouseout",e)}if(a=="in")a=false}this.UnhookPlusEvents=n;function k(){if(b!=null){b.detachEvent("onmousedown",l);b.detachEvent("onmouseup",e);b.detachEvent("onmouseout",e)}if(a=="out")a=false}this.UnhookMinusEvents=k;this.Destroy=function(){n();k();c.DetachEvent("onendzoom",i);g=f=d=b=null};function q(){if(c.GetMapMode()==Msn.VE.MapActionMode.Mode3D)return true;else return c.IsAnimationEnabled()}function o(b){a="in";c.ZoomIn();if(b!==false)$VE_A.Log($VE_A.PgName.Map,"Zoom in","Nav Bar")}function i(){window.setTimeout(p,q()?1:500)}function p(){if(a=="in"&&c.GetZoomLevel()<21)c.ZoomIn(false);else if(a=="out"&&c.GetZoomLevel()>1)c.ZoomOut(false)}function l(b){a="out";c.ZoomOut();if(b!==false)$VE_A.Log($VE_A.PgName.Map,"Zoom out","Nav Bar")}function e(){a=false}this.GetPlus=function(){return g};this.GetMinus=function(){return f}}var a=H,l=[];l[a.Style]={Id:a.Style,InitialClass:null,OnClickFunction:null,StyleUpdateEvent:null,StyleUpdateFunction:null,Enabled:true,Title:null,Children:[a.Road,a.Aerial,a.Hybrid],Text:null};l[a.Road]={Id:a.Road,InitialClass:"MSVE_MapStyle",OnClickFunction:rb,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:t,Enabled:MapControl.Features.MapStyle.Road,Title:L_NavActionRoadToolTip_Text,Children:null,Text:L_NavActionRoad_Text};l[a.Aerial]={Id:a.Aerial,InitialClass:"MSVE_MapStyle",OnClickFunction:lb,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:t,Enabled:MapControl.Features.MapStyle.Aerial,Title:L_NavActionAerialToolTip_Text,Children:null,Text:L_NavActionAerial_Text};l[a.Hybrid]={Id:a.Hybrid,InitialClass:"MSVE_MapStyle",OnClickFunction:mb,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:t,Enabled:MapControl.Features.MapStyle.Hybrid,Title:L_NavActionHybridToolTip_Text,Children:null,Text:L_NavActionHybrid_Text};l[a.Mode]={Id:a.Mode,InitialClass:"MSVE_modeCell",OnClickFunction:null,StyleUpdateEvent:null,StyleUpdateFunction:null,Enabled:true,Title:null,Children:[a.Mode2D,a.Mode3D],Text:null};l[a.Mode2D]={Id:a.Mode2D,InitialClass:"MSVE_MapMode",OnClickFunction:jb,StyleUpdateEvent:"oninitmode",StyleUpdateFunction:Y,Enabled:true,Title:L_NavActionFlatlandToolTip_Text,Children:null,Text:L_NavActionFlatland_Text};l[a.Mode3D]={Id:a.Mode3D,InitialClass:"MSVE_MapMode",OnClickFunction:pb,StyleUpdateEvent:"oninitmode",StyleUpdateFunction:Y,Enabled:MapControl.Features.MapStyle.View3D,Title:L_NavActionView3DToolTip_Text,Children:null,Text:L_NavActionView3D_Text};l[a.View]={Id:a.View,InitialClass:null,OnClickFunction:null,StyleUpdateEvent:null,StyleUpdateFunction:null,Enabled:true,Title:null,Children:[a.Ortho,a.Oblique,a.StreetSide],Text:null};l[a.Ortho]={Id:a.Ortho,InitialClass:"MSVE_MapStyle",OnClickFunction:u,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:t,Enabled:true,Title:L_NavActionOrthoToolTip_Text,Children:null,Text:null};l[a.Oblique]={Id:a.Oblique,InitialClass:"MSVE_MapStyle",OnClickFunction:G,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:t,Enabled:false,Title:L_NavActionObliqueToolTip_Text,Children:null,Text:null};l[a.StreetSide]={Id:a.StreetSide,InitialClass:"MSVE_MapStyle",OnClickFunction:gb,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:t,Enabled:false,Title:L_NavActionStreetSideToolTip_Text,Children:null,Text:null};l[a.ShowLabels]={Id:a.ShowLabels,InitialClass:"MSVE_MapStyle",OnClickFunction:ub,StyleUpdateEvent:"onchangemapstyle",StyleUpdateFunction:t,Enabled:true,Title:L_NavActionShowLabels_Text,Children:null,Text:L_NavActionLabels_Text};l[a.Traffic]={Id:a.Traffic,InitialClass:"MSVE_MapStyle",OnClickFunction:zb,StyleUpdateEvent:null,StyleUpdateFunction:null,Enabled:true,Title:L_NavActionShowTrafficToolTip_Text,Children:null,Text:L_NavActionTraffic_Text};this.ObliqueFunctions=[];this.ObliqueFunctions.ObliqueImageryIn3D={ObliqueClickFunction:eb,Title:L_NavActionShowObliqueToolTip_Text,DependsOnObliqueAvailability:true};this.ObliqueFunctions.ObliqueTiltIn3D={ObliqueClickFunction:kb,Title:L_NavAction3DObliqueToolTip_Text,DependsOnObliqueAvailability:false};var e=this,b=[],i=Msn.VE.DashboardStates.MapMode.Flatland,d=Msn.VE.DashboardStates.MapView.Ortho,h=Msn.VE.DashboardStates.MapStyle.Road;this.orthoZoom=null;var m;this.obliqueCompass=null;this.obliqueZoom=null;this.displaying3DNotification=false;var z=null;this.Oblique3DFunctionality=this.ObliqueFunctions.ObliqueImageryIn3D;var r=document.createElement("div");r.id="MSVE_navAction_palette";document.body.appendChild(r);var J=false,Z=false,k=true,R=false,s=Msn.VE.BirdsEyeSearchSpinDirection.NoSpin,O;for(O in v)if(v.hasOwnProperty(O))N(v[O]);function Hb(){var d=$MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye)&&(c.IsObliqueAvailable()||c.IsMapViewOblique());if(d){j(a.Oblique,true);if(b[a.ObliqueNotification]&&!c.IsMapViewOblique()&&!g(b[a.Oblique]).hasClass("MSVE_selected"))x()}else{j(a.Oblique,false);if(b[a.ObliqueNotification])q()}V();if(c.IsModeEnabled(Msn.VE.MapActionMode.Mode3D))T();else S()}function Gb(){var a;for(a in v)if(v.hasOwnProperty(a))K(v[a]);document.body.removeChild(r);r=null}function N(f){switch(f){case a.OrthoZoom:b[f]=document.createElement("div");e.orthoZoom=new Ab(b[f]);e.orthoZoom.Init();c.AttachEvent("onendzoom",w);r.appendChild(b[f]);w();return;case a.ObliqueZoom:b[f]=document.createElement("div");Z=true;b[f].id=f;r.appendChild(b[f]);return;case a.TinyZoom:m=new Db;b[f]=m.Init();c.AttachEvent("onendzoom",w);w();return;case a.ObliqueCompass:b[f]=document.createElement("div");b[f].id=f;J=true;return;case a.ObliqueNotification:cb();return;case a.ThreeDUpdatedNotification:bb();return;case a.Oblique:c.AttachEvent("onve3dphotostatechanged",qb)}var d=l[f],g=document.createElement("div");b[d.Id]=g;g.id=d.Id;g.enabled=d.Enabled;g.classRecipients=[g];if(d.Text!=null)g.innerText=d.Text;if(d.OnClickFunction!=null&&d.Enabled==true)g.attachEvent("onclick",d.OnClickFunction);if(d.StyleUpdateEvent!=null&&d.StyleUpdateFunction!=null)c.AttachEvent(d.StyleUpdateEvent,d.StyleUpdateFunction);if(d.InitialClass){g.className=d.InitialClass;if(!g.enabled)g.className+="_disabled"}if(d.Children!=null){var h;for(h in d.Children)if(d.Children.hasOwnProperty(h))g.appendChild(N(d.Children[h]))}else pseudoHover(g);switch(f){case a.Oblique:case a.ObliqueCompass:c.AttachEvent("onobliqueenter",yb);c.AttachEvent("onobliqueleave",L);c.AttachEvent("onendmapstyleoblique",ob);c.AttachEvent("onobliquechange",vb);c.AttachEvent("obliquerequestunavailable",db);break;case a.Traffic:c.AttachEvent("onchangetraffic",C);C()}return g}function K(f){switch(f){case a.OrthoZoom:e.orthoZoom.Destroy();b[f]=null;c.DetachEvent("onendzoom",w);try{r.removeChild(b[f])}catch(j){}return;case a.ObliqueZoom:try{r.removeChild(b[f])}catch(j){}if(e.obliqueZoom){e.obliqueZoom.Destroy();e.obliqueZoom=null}case a.TinyZoom:m.Destroy();b[f]=null;return;case a.ObliqueCompass:if(J&&e.obliqueCompass){e.obliqueCompass.onclick=null;e.obliqueCompass.Destroy();e.obliqueCompass=null}return;case a.ObliqueNotification:b[a.ObliqueNotification].detachEvent("onclick",Q);return;case a.ThreeDUpdatedNotification:b[a.ThreeDUpdatedNotification]=null;return;case a.Traffic:c.DetachEvent("onchangetraffic",C)}var i=b[f];if(i==null)return;var d=l[f];if(d.Children!=null){var g,h;for(h in d.Children)if(d.Children.hasOwnProperty(h)){g=d.Children[h];try{i.removeChild(b[g])}catch(j){}K(g)}}if(d.OnClickFunction!=null)i.detachEvent("onclick",d.OnClickFunction);try{if(c&&d.StyleUpdateEvent!=null&&d.StyleUpdateFunction!=null)c.DetachEvent(d.StyleUpdateEvent,d.StyleUpdateFunction)}catch(j){}b[d.Id]=null}function cb(){b[a.ObliqueNotification]=document.createElement("div");b[a.ObliqueNotification].id=a.ObliqueNotification;b[a.ObliqueNotification].attachEvent("onclick",Q);b[a.ObliqueNotification].innerHTML+='<div id="MSVE_obliqueNotifyBeak" ></div> '+'<div id="MSVE_obliqueNotifyContent"> '+'<div id="MSVE_obliqueNotifyText" >'+L_DashboardBirdsEyeText_Text+"</div>"+'<img id="MSVE_obliqueNotifyImg" />'+"</div>"}function bb(){b[a.ThreeDUpdatedNotification]=document.createElement("div");b[a.ThreeDUpdatedNotification].id=a.ThreeDUpdatedNotification;b[a.ThreeDUpdatedNotification].innerHTML+='<div id="MSVE_threeDNotifyIcon">&nbsp;</div> <div id="MSVE_threeDNotifyText">'+L_Dashboard3DInstalled_Text+"</div>"}function rb(){A();$VE_A.Log($VE_A.PgName.Map,"MapStyleRoad",f)}function A(){if(h==Msn.VE.DashboardStates.MapStyle.Road&&d==Msn.VE.DashboardStates.MapView.Ortho)return;h=Msn.VE.DashboardStates.MapStyle.Road;d=Msn.VE.DashboardStates.MapView.Ortho;n(i+d+h)}function lb(){if(b[a.ShowLabels]){j(a.ShowLabels,true);if(k)X();else W();var c=k?"LabelsOn":"LabelsOff";$VE_A.Log($VE_A.PgName.Map,"MapStyleAerial-"+c,f)}else{W();$VE_A.Log($VE_A.PgName.Map,"MapStyleAerial",f)}}function W(){if(h==Msn.VE.DashboardStates.MapStyle.Aerial&&d==Msn.VE.DashboardStates.MapView.Ortho)return;h=Msn.VE.DashboardStates.MapStyle.Aerial;d=Msn.VE.DashboardStates.MapView.Ortho;n(i+d+h)}function mb(){X();$VE_A.Log($VE_A.PgName.Map,"MapStyleHybrid",f)}function X(){if(h==Msn.VE.DashboardStates.MapStyle.Hybrid&&d==Msn.VE.DashboardStates.MapView.Ortho)return;h=Msn.VE.DashboardStates.MapStyle.Hybrid;d=Msn.VE.DashboardStates.MapView.Ortho;n(i+d+h)}function u(){if(d==Msn.VE.DashboardStates.MapView.Ortho&&i==Msn.VE.DashboardStates.MapMode.Flatland)return;d=Msn.VE.DashboardStates.MapView.Ortho;if(i==Msn.VE.DashboardStates.MapMode.Flatland)switch(h){case Msn.VE.DashboardStates.MapStyle.Aerial:if($MVEM.IsEnabled(MapControl.Features.MapStyle.Aerial))n(i+d+h);else A();break;case Msn.VE.DashboardStates.MapStyle.Hybrid:if($MVEM.IsEnabled(MapControl.Features.MapStyle.Hybrid))n(i+d+h);else A();break;default:n(i+d+h)}else n(i+d);p()}function Q(c){if(i==Msn.VE.DashboardStates.MapMode.View3D&&g(b[a.Oblique]).hasClass("MSVE_selected")){q();c.cancelBubble=true;return}G()}function G(){if(typeof b[a.ObliqueNotification]!="undefined"&&b[a.ObliqueNotification])q();if(i==Msn.VE.DashboardStates.MapMode.View3D)e.Oblique3DFunctionality.ObliqueClickFunction();else sb()}var M=null;function eb(){var e=new Date;if(M!=null)if(e.getTime()-M.getTime()<1000)return;M=e;var d=!g(b[a.Oblique]).hasClass("MSVE_selected");c.Show3DBirdseye(d,h==Msn.VE.DashboardStates.MapStyle.Road||k);var i=d?"RequestLayerBirdsEyeOn":"RequestLayerBirdsEyeOff";$VE_A.Log($VE_A.PgName.Map,i,f)}var o;function sb(){if(d===Msn.VE.DashboardStates.MapView.Oblique)return;d=Msn.VE.DashboardStates.MapView.Oblique;y();if(k)h=Msn.VE.DashboardStates.MapStyle.Hybrid;else h=Msn.VE.DashboardStates.MapStyle.Aerial;if(typeof Msn.VE.API=="undefined")nb();else F()}function nb(){if(!o){var a=$ID("msve_mapContainer");o=document.createElement("div");o.id="animator";a.appendChild(o)}o.style.display="block";o.className="zoom_animation";window.setTimeout(F,2000)}function F(){if(o){o.parentNode.removeChild(o);o=null}if(c.IsDragging()||c.IsZooming()){window.setTimeout(F,250);return}n(i+d+h);var a=k?"LabelsOn":"LabelsOff";$VE_A.Log($VE_A.PgName.Map,"MapStyleOblique-"+a,f)}function kb(){Fb(Msn.VE.DashboardStates.MapMode.View3D+Msn.VE.DashboardStates.MapView.Oblique)}function gb(){if(d==Msn.VE.DashboardStates.MapView.StreetSide&&i==Msn.VE.DashboardStates.MapMode.Flatland)return;d=Msn.VE.DashboardStates.MapView.StreetSide;n(i+d);ib()}function ub(){if(h==Msn.VE.DashboardStates.MapStyle.Aerial){k=true;h=Msn.VE.DashboardStates.MapStyle.Hybrid}else if(h==Msn.VE.DashboardStates.MapStyle.Hybrid){k=false;h=Msn.VE.DashboardStates.MapStyle.Aerial}n(i+d+h);var a=k?"LabelsOn":"LabelsOff",b=d==Msn.VE.DashboardStates.MapView.Oblique?"MapStyleOblique":"MapStyleAerial";$VE_A.Log($VE_A.PgName.Map,a+"-"+b,f)}function jb(){c.EnableMode(Msn.VE.MapActionMode.Mode2D);$VE_A.Log($VE_A.PgName.Map,"Mode2D",f)}function pb(){if(typeof b[a.ThreeDUpdatedNotification]!="undefined"&&b[a.ThreeDUpdatedNotification])E();if(!c.IsModeEnabled(Msn.VE.MapActionMode.Mode3D)){if(typeof ShowMessage!="undefined"){ShowMessage(L_3DLoading_Text);window.setTimeout(View3DSwitch,200)}else c.EnableMode(Msn.VE.MapActionMode.Mode3D);$VE_A.Log($VE_A.PgName.Map,"Mode3D",f)}}function C(){if(VE_TrafficManager.turnedOn){g(b[a.Traffic]).addClass("MSVE_selected");b[a.Traffic].title=L_NavActionHideTrafficToolTip_Text}else{g(b[a.Traffic]).removeClass("MSVE_selected");b[a.Traffic].title=L_NavActionShowTrafficToolTip_Text}}function zb(){if(VE_TrafficManager.turnedOn)VE_TrafficManager.ClearTraffic();else{$VE_A.LogTrafficActivation($VE_A.PgName.Map);VE_TrafficManager.GetTrafficInfo(true)}}function qb(c){if(c.enabled=="1"){g(b[a.Oblique]).addClass("MSVE_selected");b[a.Oblique].title=L_NavActionHideObliqueToolTip_Text}else{g(b[a.Oblique]).removeClass("MSVE_selected");b[a.Oblique].title=L_NavActionShowObliqueToolTip_Text}var e=c.enabled=="1"?"LayerBirdsEyeOn":"LayerBirdsEyeOff",d=h==Msn.VE.DashboardStates.MapStyle.Road||k?"LabelsOn":"LabelsOff";$VE_A.Log($VE_A.PgName.Map,e+"-"+d,f)}function t(a){V(a.view.mapStyle)}function Y(a){if(a==Msn.VE.MapActionMode.Mode3D)T();else S()}function T(){if(i==Msn.VE.DashboardStates.MapMode.View3D)return;i=Msn.VE.DashboardStates.MapMode.View3D;if(typeof b[a.Mode]!="undefined"&&b[a.Mode]!=null)g(b[a.Mode].classRecipients).swapClass("MSVE_FlatlandMapMode","MSVE_View3DMapMode");j(a.StreetSide,true);j(a.Road,true);j(a.Aerial,true);j(a.Hybrid,true);if(!e.Oblique3DFunctionality.DependsOnObliqueAvailability)j(a.Oblique,true);else{if(b[a.ObliqueNotification]!=null&&b[a.ObliqueNotification].enabled&&!g(b[a.Oblique]).hasClass("MSVE_selected"))x();p()}if(typeof b[a.Ortho]!="undefined"&&b[a.Ortho]!=null)b[a.Ortho].title=L_NavAction3DOrthoToolTip_Text;if(typeof b[a.Oblique]!="undefined"&&b[a.Oblique]!=null){b[a.Oblique].title=e.Oblique3DFunctionality.Title;if(b[a.Oblique].enabled&&!g(b[a.Oblique]).hasClass("MSVE_selected"))x()}if(typeof b[a.StreetSide]!="undefined"&&b[a.StreetSide]!=null)b[a.StreetSide].title=L_NavAction3DStreetSideToolTip_Text;var f=c.GetDashboard().GetShimmedElements(),d;for(d=0;d<f.length;d++)mvcViewFacade.UpdateShimIfSupported(f[d])}function S(){i=Msn.VE.DashboardStates.MapMode.Flatland;if(typeof b[a.Mode]!="undefined"&&b[a.Mode]!=null)g(b[a.Mode].classRecipients).swapClass("MSVE_View3DMapMode","MSVE_FlatlandMapMode");if(typeof b[a.Ortho]!="undefined"&&b[a.Ortho]!=null)b[a.Ortho].title=L_NavActionOrthoToolTip_Text;if(typeof b[a.Oblique]!="undefined"&&b[a.Oblique]!=null)b[a.Oblique].title=L_NavActionObliqueToolTip_Text;g(b[a.Oblique]).removeClass("MSVE_selected");photoState=0;if($MVEM.IsEnabled(MapControl.Features.MapStyle.Road))j(a.Road,true);else j(a.Road,false);if($MVEM.IsEnabled(MapControl.Features.MapStyle.Aerial))j(a.Aerial,true);else j(a.Aerial,false);if($MVEM.IsEnabled(MapControl.Features.MapStyle.Hybrid))j(a.Hybrid,true);else j(a.Hybrid,false);if($MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye)){c.GetObliqueAvailability("OnFlatlandModeUpdateUIObliqueReturned",P);return}else P(false)}function P(b){if(b){j(a.Oblique,true);if(e.obliqueZoom!=null)e.obliqueZoom.UpdateFromMap()}else{j(a.Oblique,false);d=Msn.VE.DashboardStates.MapView.Ortho;p()}switch(d){case Msn.VE.DashboardStates.MapView.Oblique:if(b&&$MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye))n(i+d);else u();break;case Msn.VE.DashboardStates.MapView.StreetSide:u();break;case Msn.VE.DashboardStates.MapView.Ortho:switch(h){case Msn.VE.DashboardStates.MapStyle.Aerial:if($MVEM.IsEnabled(MapControl.Features.MapStyle.Aerial))n(i+d+h);else A();break;case Msn.VE.DashboardStates.MapStyle.Hybrid:if($MVEM.IsEnabled(MapControl.Features.MapStyle.Hybrid))n(i+d+h);else A();break;default:n(i+d+h)}break;default:u()}}function w(){if(e.orthoZoom)e.orthoZoom.UpdateFromMap();if(e.obliqueZoom)e.obliqueZoom.UpdateFromMap();var b=null,a=null;if(m){var f=m.GetPlus();if(f)b=g([f]);var d=m.GetMinus();if(d)a=g([d])}if(c.IsMapViewOrtho()&&c.GetZoomLevel()==19||c.IsMapViewOblique()&&c.GetZoomLevel()==2){if(b)b.addClass("MSVE_ZoomBar_plus_disabled");if(m)m.UnhookPlusEvents()}else if(c.GetZoomLevel()==1){if(a)a.addClass("MSVE_ZoomBar_minus_disabled");if(m)m.UnhookMinusEvents()}if(c.IsMapViewOrtho()&&c.GetZoomLevel()!=19||c.IsMapViewOblique()&&c.GetZoomLevel()!=2)if(b&&b.hasClass("MSVE_ZoomBar_plus_disabled")){b.removeClass("MSVE_ZoomBar_plus_disabled");if(m)m.HookupPlusEvents()}if(c.GetZoomLevel()!=1)if(a&&a.hasClass("MSVE_ZoomBar_minus_disabled")){a.removeClass("MSVE_ZoomBar_minus_disabled");if(m)m.HookupMinusEvents()}}function yb(){if(c.IsMapViewOblique())d=Msn.VE.DashboardStates.MapView.Oblique;if(i==Msn.VE.DashboardStates.MapMode.Flatland||i==Msn.VE.DashboardStates.MapMode.View3D&&e.Oblique3DFunctionality.DependsOnObliqueAvailability){j(a.Oblique,true);if(b[a.ObliqueNotification]&&!c.IsMapViewOblique()&&!g(b[a.Oblique]).hasClass("MSVE_selected"))x()}}function L(){d=Msn.VE.DashboardStates.MapView.Ortho;p();if(i==Msn.VE.DashboardStates.MapMode.Flatland||i==Msn.VE.DashboardStates.MapMode.View3D&&e.Oblique3DFunctionality.DependsOnObliqueAvailability){j(a.Oblique,false);q()}}function db(){if(c.IsObliqueAvailable())e.obliqueCompass.UpdateFromMap(s,true);else L()}function ob(){if(c.IsObliqueAvailable()){d=Msn.VE.DashboardStates.MapView.Ortho;p()}else L()}function vb(){if($MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye)){if(d!=Msn.VE.DashboardStates.MapView.Oblique){d=Msn.VE.DashboardStates.MapView.Oblique;j(a.Oblique,true);y()}}else{d=Msn.VE.DashboardStates.MapView.Oblique;u()}if(b[a.ObliqueNotification])q();if(typeof e.obliqueCompass!="undefined"&&e.obliqueCompass!=null){e.obliqueCompass.UpdateFromMap(s);s=Msn.VE.BirdsEyeSearchSpinDirection.NoSpin}}function V(e){if(!e)e=c.GetMapStyle();switch(e){case Msn.VE.MapStyle.Shaded:case Msn.VE.MapStyle.Road:d=Msn.VE.DashboardStates.MapView.Ortho;p();h=Msn.VE.DashboardStates.MapStyle.Road;tb();if(b[a.ShowLabels]){j(a.ShowLabels,false);g(b[a.ShowLabels]).addClass("MSVE_selected")}break;case Msn.VE.MapStyle.Aerial:d=Msn.VE.DashboardStates.MapView.Ortho;p();h=Msn.VE.DashboardStates.MapStyle.Aerial;I();k=false;if(b[a.ShowLabels]){j(a.ShowLabels,true);g(b[a.ShowLabels]).removeClass("MSVE_selected")}break;case Msn.VE.MapStyle.Hybrid:d=Msn.VE.DashboardStates.MapView.Ortho;p();h=Msn.VE.DashboardStates.MapStyle.Hybrid;if(b[a.ShowLabels]){k=true;I();j(a.ShowLabels,true);g(b[a.ShowLabels]).addClass("MSVE_selected")}else U();break;case Msn.VE.MapStyle.Oblique:d=Msn.VE.DashboardStates.MapView.Oblique;y();h=Msn.VE.DashboardStates.MapStyle.Aerial;if(b[a.ShowLabels]){I();k=false;j(a.ShowLabels,true);g(b[a.ShowLabels]).removeClass("MSVE_selected")}j(a.Oblique,true);break;case Msn.VE.MapStyle.ObliqueHybrid:d=Msn.VE.DashboardStates.MapView.Oblique;y();h=Msn.VE.DashboardStates.MapStyle.Hybrid;if(b[a.ShowLabels]){U();k=true;j(a.ShowLabels,true);g(b[a.ShowLabels]).addClass("MSVE_selected")}j(a.Oblique,true)}if(i==Msn.VE.DashboardStates.MapMode.View3D&&g(b[a.Oblique]).hasClass("MSVE_selected"))if(h==Msn.VE.DashboardStates.MapStyle.Road)c.Show3DBirdseye(true,true);else c.Show3DBirdseye(true,k);if(b[a.ShowLabels])if(k||h==Msn.VE.DashboardStates.MapStyle.Road)b[a.ShowLabels].title=L_NavActionHideLabels_Text;else b[a.ShowLabels].title=L_NavActionShowLabels_Text}function tb(){if(typeof b[a.Style]!="undefined"&&b[a.Style]!=null){var c;for(c=0;c<b[a.Style].classRecipients.length;c++)b[a.Style].classRecipients[c].className="MSVE_RoadMapStyle"}}function I(){if(typeof b[a.Style]!="undefined"&&b[a.Style]!=null){var c;for(c=0;c<b[a.Style].classRecipients.length;c++)b[a.Style].classRecipients[c].className="MSVE_AerialMapStyle"}}function U(){if(typeof b[a.Style]!="undefined"&&b[a.Style]!=null){var c;for(c=0;c<b[a.Style].classRecipients.length;c++)b[a.Style].classRecipients[c].className="MSVE_HybridMapStyle"}}function p(){if(typeof b[a.View]!="undefined"&&b[a.View]!=null){var c=g(b[a.View].classRecipients);c.removeClass("MSVE_StreetSideView");c.removeClass("MSVE_ObliqueView");c.addClass("MSVE_OrthoView")}if(b[a.Traffic]!=null){j(a.Traffic,true);C()}s=Msn.VE.BirdsEyeSearchSpinDirection.NoSpin}function y(){if(typeof b[a.View]!="undefined"&&b[a.View]!=null){var c=g(b[a.View].classRecipients);c.removeClass("MSVE_StreetSideView");c.removeClass("MSVE_OrthoView");c.addClass("MSVE_ObliqueView")}if(J){if(e.obliqueCompass==null){e.obliqueCompass=new wb(b[a.ObliqueCompass]);if(b[a.ObliqueCompass].radius)e.obliqueCompass.SetRadius(b[a.ObliqueCompass].radius);e.obliqueCompass.onclick=function(){s=Msn.VE.BirdsEyeSearchSpinDirection.NoSpin}}e.obliqueCompass.UpdateFromMap()}if(Z){if(e.obliqueZoom==null){e.obliqueZoom=new xb(b[a.ObliqueZoom]);e.obliqueZoom.Init()}e.obliqueZoom.UpdateFromMap()}if(b[a.Traffic]!=null&&i==Msn.VE.DashboardStates.MapMode.Flatland)j(a.Traffic,false)}function ib(){if(typeof b[a.View]!="undefined"&&b[a.View]!=null){var c=g(b[a.View].classRecipients);c.removeClass("MSVE_OrthoView");c.removeClass("MSVE_ObliqueView");c.addClass("MSVE_StreetSideView")}}function x(){if(!b[a.ObliqueNotification])return;if(R)return;R=true;if(!e.displaying3DNotification)if(d!=Msn.VE.DashboardStates.MapView.Oblique){if(!z){var o=g(b[a.ObliqueNotification]),k=o.select("img");for(var i=0;i<k.length&&!z;i++){var j=k.element(i);if(j.id=="MSVE_obliqueNotifyImg")z=j}}if(z)z.src=c.GetObliqueMode().GetMiddleTileFilename();var f=b[a.Oblique];b[a.ObliqueNotification].style.display="block";var m=f.offsetLeft+f.offsetWidth/2-b[a.ObliqueNotification].offsetWidth/2,n=f.offsetTop+f.offsetHeight+4;g(b[a.ObliqueNotification]).setStyle("top",n+"px").setStyle("left",m+"px");var l=D(),h;for(h=0;h<l.length;++h)mvcViewFacade.UpdateShimIfSupported(l[h]);m=n=f=null;window.setTimeout(q,6000)}}function ab(){if(!b[a.ThreeDUpdatedNotification])return;q();if(!e.displaying3DNotification){e.displaying3DNotification=true;var c=b[a.Mode3D];b[a.ThreeDUpdatedNotification].style.display="block";var d=c.offsetLeft-6,f=c.offsetTop+c.offsetHeight+4;g(b[a.ThreeDUpdatedNotification]).setStyle("top",f+"px").setStyle("left",d+"px");mvcViewFacade.UpdateShimIfSupported(b[a.ThreeDUpdatedNotification]);c=null;window.setTimeout(E,6000)}}function q(){b[a.ObliqueNotification].style.display="none";var d=D(),c;for(c=0;c<d.length;++c)mvcViewFacade.UpdateShimIfSupported(d[c])}function E(){e.displaying3DNotification=false;b[a.ThreeDUpdatedNotification].style.display="none";mvcViewFacade.UpdateShimIfSupported(b[a.ThreeDUpdatedNotification])}function j(c,d){if(b[c]==null)return;if(b[c].enabled==d)return;b[c].enabled=d;var a=l[c];if(a.InitialClass)if(d)g(b[c]).swapClass(a.InitialClass+"_disabled",a.InitialClass);else g(b[c]).swapClass(a.InitialClass,a.InitialClass+"_disabled");if(a.Title)b[c].title=a.Title;if(a.OnClickFunction)if(d)b[c].attachEvent("onclick",a.OnClickFunction);else b[c].detachEvent("onclick",a.OnClickFunction)}function n(d){if(d&Msn.VE.DashboardStates.MapView.Ortho||d&Msn.VE.DashboardStates.MapMode.View3D)if(d&Msn.VE.DashboardStates.MapStyle.Road)c.SetMapStyle("r");else if(d&Msn.VE.DashboardStates.MapStyle.Aerial)c.SetMapStyle("a");else if(d&Msn.VE.DashboardStates.MapStyle.Hybrid)c.SetMapStyle("h");if(d&Msn.VE.DashboardStates.MapMode.Flatland&&d&Msn.VE.DashboardStates.MapView.Oblique)if(d&Msn.VE.DashboardStates.MapStyle.Aerial&&c.GetMapStyle()!=Msn.VE.MapStyle.Oblique){k=false;if(b[a.ShowLabels]){j(a.ShowLabels,true);g(b[a.ShowLabels]).removeClass("MSVE_selected")}c.SetMapStyle(Msn.VE.MapStyle.Oblique)}else if(d&Msn.VE.DashboardStates.MapStyle.Hybrid&&c.GetMapStyle()!=Msn.VE.MapStyle.ObliqueHybrid){k=true;if(b[a.ShowLabels]){j(a.ShowLabels,true);g(b[a.ShowLabels]).addClass("MSVE_selected")}c.SetMapStyle(Msn.VE.MapStyle.ObliqueHybrid)}}function Fb(a){if(a&Msn.VE.DashboardStates.MapMode.View3D)if(a&Msn.VE.DashboardStates.MapView.Ortho)c.SetTilt(-90);else if(a&Msn.VE.DashboardStates.MapView.Oblique)c.SetTilt(-45);else if(a&Msn.VE.DashboardStates.MapView.StreetSide)c.SetTilt(-25)}function D(){return [b[a.ObliqueNotification]]}function Eb(a){return b[a]}function Bb(){return b}function Cb(){return m}function fb(){return s}function hb(a){s=a}this.SetMapViewState=function(a){d=a};this.GetMapViewState=function(){return d};this.SetMapModeState=function(a){i=a};this.GetMapModeState=function(){return i};this.SetLabelsState=function(a){k=a};this.GetLabelsState=function(){return k};this.GetLastRotationDirection=fb;this.SetLastRotationDirection=hb;this.GetObliqueNotifierShimmedElements=D;this.Init=Hb;this.Create=N;this.Destroy=Gb;this.DestroyControl=K;this.GetControl=Eb;this.GetControls=Bb;this.GetTinyZoom=Cb;this.OnOrthoMapViewClick=u;this.OnObliqueMapViewClick=G;this.UpdateZoom=w;this.SelectObliqueMapView=y;this.SelectOrthoMapView=p;this.DisplayObliqueNotification=x;this.HideObliqueNotification=q;this.DisplayThreeDUpdatedNotification=ab;this.HideThreeDUpdatedNotification=E};function bb(o,c,d,b){var a=document.createElement("div"),i=0,j=0,h=false,f=15;this.Init=function(){a.id="Compass";a.attachEvent("onmousedown",k);a.attachEvent("onmouseup",m);a.attachEvent("onmousemove",l);a.attachEvent("ondblclick",IgnoreEvent);a.title=L_NavActionCompassPan_Text;o.appendChild(a);if(isNaN(parseInt(c)))c=a.offsetWidth/2;if(isNaN(parseInt(d)))d=a.offsetHeight/2;if(isNaN(parseInt(b)))b=Math.min(c,d)};this.Destroy=function(){a.detachEvent("onmousedown",k);a.detachEvent("onmouseup",m);a.detachEvent("onmousemove",l);a.detachEvent("ondblclick",IgnoreEvent);a=null};function k(m){m=GetEvent(m);CancelEvent(m);var n=g(a).getPagePosition();i=n.x;j=n.y;if(a.setCapture)a.setCapture();var k=Gimme.Screen.getMousePosition(m).x-i-c,l=Gimme.Screen.getMousePosition(m).y-j-d,o=Math.sqrt(k*k+l*l);if(o<b){k=Math.floor(k/b*f);l=Math.floor(l/b*f);$VE_A.Log($VE_A.PgName.Map,"Pan","Nav Bar");e.ContinuousPan(k,l,0,true);h=true}return false}function l(k){k=GetEvent(k);CancelEvent(k);if(h){var a=Gimme.Screen.getMousePosition(k).x-i-c,g=Gimme.Screen.getMousePosition(k).y-j-d,l=Math.sqrt(a*a+g*g);if(l<b){a=Math.floor(a/b*f);g=Math.floor(g/b*f);e.ContinuousPan(a,g,0,true)}}return false}function m(b){b=GetEvent(b);CancelEvent(b);if(a.releaseCapture)a.releaseCapture();e.StopContinuousPan();h=false;return false}function p(){a.style.display="none"}function q(){a.style.display="block"}function n(){return a}this.Hide=p;this.Show=q;this.GetElement=n}var a=H,b=null,h=null,B=null,c=null,u=null,x=null,y=null,d=null,n=null,r=null,s=null,i=null,j=null,kb=null,k=null,p=null,q=null,o=null,l=null,m=null,w=null,v=null,U=["North","East","South","West"],R={"North":0,"East":1,"South":2,"West":3},A,z,t,K=150,G=.7,X=.9,M=1;function fb(){B=[a.Mode,a.View,a.Style,a.ShowLabels,a.TinyZoom,a.ObliqueNotification,a.ObliqueCompass,a.ThreeDUpdatedNotification];if(typeof $MVEF!="undefined"&&$MVEM.IsEnabled($MVEF.MapAction.Traffic))if(typeof VE_TrafficManager!="undefined")B.push(a.Traffic);h=new Msn.VE.CommonControls(e,B);b=h.GetControls();b[a.Oblique].innerText=L_DashboardBirdsEye_Text;c=document.createElement("div");c.id="MSVE_navAction_container";c.className="MSVE_Dashboard_V6";if(Msn.VE.API)g(c).addClass("MSVE_API");j=document.createElement("div");j.id="MSVE_navAction_styleGroup";d=document.createElement("div");d.id="MSVE_navAction_topBar";b[a.View].classRecipients=[j,c,d];b[a.Style].classRecipients=[j];b[a.Mode].classRecipients=[d];h.Oblique3DFunctionality=h.ObliqueFunctions.ObliqueImageryIn3D;L.appendChild(c);u=document.createElement("div");u.id="MSVE_navAction_topBackground";u.className="MSVE_navAction_background";x=document.createElement("div");x.id="MSVE_navAction_compassBackground";x.className="MSVE_navAction_background";y=document.createElement("div");y.id="MSVE_navAction_leftBackground";y.className="MSVE_navAction_background";d.className="MSVE_Dashboard MSVE_Dashboard_V6 MSVE_FlatlandMapMode";n=document.createElement("div");n.id="MSVE_navAction_leftBar";n.className="MSVE_Dashboard MSVE_Dashboard_V6";r=document.createElement("div");r.id="MSVE_navAction_compassContainer";r.className="MSVE_Dashboard MSVE_Dashboard_V6";k=document.createElement("div");k.id="MSVE_navAction_toggleGlyphWrapper";k.title=L_NavActionHideToolTip_Text;pseudoHover(k);c.appendChild(y);c.appendChild(x);c.appendChild(u);c.appendChild(r);c.appendChild(n);c.appendChild(d);c.appendChild(k);if(!e.IsModeEnabled(Msn.VE.MapActionMode.Mode3D))P();var C=g(c),f=C.select("> div");f.addEvent("mousedown",IgnoreEvent);f.addEvent("mouseup",IgnoreEvent);f.addEvent("mousemove",DashboardContainerMouseMoveEvent);f.addEvent("mousewheel",IgnoreEvent);f.addEvent("dblclick",IgnoreEvent);f.addEvent("contextmenu",IgnoreEvent);f.addEvent("keydown",IgnoreEvent);f.addEvent("keyup",IgnoreEvent);f.addEvent("click",IgnoreEvent);i=[];for(t=0;t<5;t++){i[t]=document.createElement("div");i[t].className="MSVE_navAction_separator";i[t].id="MSVE_navAction_separator"+t}z=document.createElement("div");z.id="MSVE_navAction_toggleGlyphInner";z.className="MSVE_navAction_toggleGlyph";k.appendChild(z);b[a.Road].title=L_NavActionRoadToolTip_Text;b[a.Aerial].title=L_NavActionAerialToolTip_Text;b[a.Hybrid].title=L_NavActionHybridToolTip_Text;b[a.Mode2D].title=L_NavActionFlatlandToolTip_Text;b[a.Mode3D].title=L_NavActionView3DToolTip_Text;j.appendChild(b[a.Road]);j.appendChild(b[a.Aerial]);j.appendChild(i[1]);j.appendChild(b[a.Oblique]);if(E){d.appendChild(b[a.Mode]);d.appendChild(i[0])}d.appendChild(j);d.appendChild(i[2]);h.SetLabelsState(W!=false);d.appendChild(b[a.ShowLabels]);d.appendChild(i[3]);if(b[a.Traffic]!=null){b[a.Traffic].title=L_NavActionShowTrafficToolTip_Text;d.appendChild(b[a.Traffic]);d.appendChild(i[4])}else C.addClass("notraffic");if(!ab){var F=parseInt(C.getStyle("width"))-parseInt(g(b[a.Oblique]).getStyle("width"));c.style.width=F+"px";b[a.Oblique].style.display="none"}s=document.createElement("div");s.id="MSVE_navAction_compassWrapper";r.appendChild(s);A=new bb(s);A.Init();pseudoHover(A.GetElement());b[a.ObliqueCompass].radius=31;s.appendChild(b[a.ObliqueCompass]);var D=h.GetTinyZoom();n.appendChild(b[a.TinyZoom]);q=document.createElement("div");q.id="MSVE_navAction_zoomPlusWrapper";pseudoHover(q);q.appendChild(D.GetPlus());b[a.TinyZoom].appendChild(q);p=document.createElement("div");p.id="MSVE_navAction_zoomMinusWrapper";pseudoHover(p);p.appendChild(D.GetMinus());b[a.TinyZoom].appendChild(p);D.HookupPlusMinusEvents(q,p);o=document.createElement("div");o.id="MSVE_navAction_rotatorContainer";v=document.createElement("div");v.id="MSVE_navAction_ccw";v.title=L_NavActionObliqueRotationToolTip_CCW_Text;v.className="MSVE_navAction_rotator";w=document.createElement("div");w.id="MSVE_navAction_cw";w.title=L_NavActionObliqueRotationToolTip_CW_Text;w.className="MSVE_navAction_rotator";l=document.createElement("div");l.id="MSVE_navAction_ccwWrapper";pseudoHover(l);l.appendChild(v);m=document.createElement("div");m.id="MSVE_navAction_cwWrapper";pseudoHover(m);m.appendChild(w);g(l).addEvent("click",O);g(m).addEvent("click",Q);o.appendChild(l);o.appendChild(m);n.appendChild(o);d.appendChild(b[a.ObliqueNotification]);d.appendChild(b[a.ThreeDUpdatedNotification]);h.Init();e.AttachEvent("oninitmode",Y);if(Msn.VE.Animation)J();h.UpdateZoom()}function cb(){d.removeChild(b[a.ObliqueNotification]);d.removeChild(b[a.ThreeDUpdatedNotification]);g(l).removeEvent("click",O);g(m).removeEvent("click",Q);l.removeChild(v);m.removeChild(w);o.removeChild(l);o.removeChild(m);n.removeChild(o);var f=h.GetTinyZoom();if(f){var t=f.GetMinus();if(t)p.removeChild(t);var B=f.GetPlus();if(B)q.removeChild(B);b[a.TinyZoom].removeChild(p);b[a.TinyZoom].removeChild(q);n.removeChild(b[a.TinyZoom])}A.Destroy();r.removeChild(s);s.removeChild(b[a.ObliqueCompass]);if(b[a.Traffic]!=null){d.removeChild(b[a.Traffic]);d.removeChild(i[4])}d.removeChild(b[a.ShowLabels]);d.removeChild(i[3]);j.removeChild(b[a.Road]);j.removeChild(b[a.Aerial]);j.removeChild(i[1]);j.removeChild(b[a.Oblique]);if(E){d.removeChild(b[a.Mode]);d.removeChild(i[0])}d.removeChild(j);d.removeChild(i[2]);k.removeChild(z);var G=g(c),e=G.select("> div");e.removeEvent("mouseleave",C);e.removeEvent("mouseenter",D);e.removeEvent("mousedown",IgnoreEvent);e.removeEvent("mouseup",IgnoreEvent);e.removeEvent("mousemove",DashboardContainerMouseMoveEvent);e.removeEvent("mousewheel",IgnoreEvent);e.removeEvent("dblclick",IgnoreEvent);e.removeEvent("contextmenu",IgnoreEvent);e.removeEvent("keydown",IgnoreEvent);e.removeEvent("keyup",IgnoreEvent);e.removeEvent("click",IgnoreEvent);c.removeChild(y);c.removeChild(x);c.removeChild(u);c.removeChild(r);c.removeChild(n);c.removeChild(d);c.removeChild(k);L.removeChild(c);h.Destroy();if(Msn.VE.Animation)F().onclick=null}function C(){Gimme.Animation.end("MSVE_NAVACTION_FADEIN");g(c).select("div.MSVE_navAction_background").fadeTo(null,G,K,"MSVE_NAVACTION_FADEOUT")}function D(){Gimme.Animation.end("MSVE_NAVACTION_FADEOUT");g(c).select("div.MSVE_navAction_background").fadeTo(null,X,K,"MSVE_NAVACTION_FADEIN")}function Y(a){if(a==Msn.VE.MapActionMode.Mode3D){Z();if(e.Get3DControl())if(g(N()).hasClass("collapsed"))e.Get3DControl().ShowNavigationControl=false;else e.Get3DControl().ShowNavigationControl=true}else P()}function P(){var a=g(c),b=a.select("> div");a.select("div.MSVE_navAction_background").setStyle("opacity",G);b.addEvent("mouseleave",C);b.addEvent("mouseenter",D)}function Z(){var a=g(c),b=a.select("> div");b.removeEvent("mouseleave",C);b.removeEvent("mouseenter",D);a.select("div.MSVE_navAction_background").setStyle("opacity",M)}function O(){I(Msn.VE.BirdsEyeSearchSpinDirection.CounterclockwiseSpin);$VE_A.Log($VE_A.PgName.Map,"Rotate - Counterclockwise",f)}function Q(){I(Msn.VE.BirdsEyeSearchSpinDirection.ClockwiseSpin);$VE_A.Log($VE_A.PgName.Map,"Rotate - Clockwise",f)}function I(a){h.SetLastRotationDirection(a);var b=e.GetObliqueScene();if(b){var d=R[b.GetOrientation()],c=U[(d+a+4)%4];e.SetObliqueOrientation(c,a,true);h.obliqueCompass.UpdateFromMap()}}function N(){return c}function T(){return h.GetObliqueNotifierShimmedElements().concat([u])}function F(){return k}function db(){return h.GetMapModeState()}function gb(){if(c)c.style.display="block"}function eb(){if(c)c.style.display="none"}function J(){if(!e.GetDashboard().GetToggleGlyph())return;e.GetDashboard().GetToggleGlyph().onclick=function(){var a=e.GetDashboard();if(g(a.GetElement()).hasClass("collapsed")){g(a.GetElement()).removeClass("collapsed");a.GetToggleGlyph().title=L_NavActionHideToolTip_Text;if(e.Get3DControl())e.Get3DControl().ShowNavigationControl=true;$VE_A.Log($VE_A.PgName.Map,"Maximize nav bar",f)}else{g(a.GetElement()).addClass("collapsed");a.GetToggleGlyph().title=L_NavActionShowToolTip_Text;if(e.Get3DControl())e.Get3DControl().ShowNavigationControl=false;$VE_A.Log($VE_A.PgName.Map,"Minimize nav bar",f)}var c=e.GetDashboard().GetShimmedElements(),b;for(b=0;b<c.length;b++)mvcViewFacade.UpdateShimIfSupported(c[b]);g("#MSVE_navAction_topBackground").setStyle("opacity",M)}}function V(){h.ObliqueFunctions.ObliqueImageryIn3D.ObliqueClickFunction()}this.DisplayThreeDUpdatedNotification=function hb(){h.DisplayThreeDUpdatedNotification()};function S(a){h.SetLastRotationDirection(a)}this.Init=fb;this.Destroy=cb;this.GetElement=N;this.GetToggleGlyph=F;this.GetShimmedElements=T;this.createRoller=J;this.GetMode=db;this.Show=gb;this.Hide=eb;this.Oblique3DToggle=V;this.SetLastRotationDirection=S};Msn.VE.LatLong=function(b,a){this.latitude=b;this.longitude=a};Msn.VE.LatLong.prototype.ToString=function(){return "("+this.latitude+", "+this.longitude+")"};Msn.VE.LatLong.prototype.Copy=function(a){if(!a)return;this.latitude=a.latitude;this.longitude=a.longitude};Msn.VE.LatLong.prototype.Equals=function(a){if(a instanceof Msn.VE.LatLong)return this.latitude==a.latitude&&this.longitude==a.longitude;else return false};Msn.VE.LatLongRectangle=function(a,b){this.northwest=a;this.southeast=b;this.ToString=function(){return "("+(this.northwest?this.northwest.ToString():"null")+", "+(this.southeast?this.southeast.ToString():"null")+")"};this.Copy=function(a){if(!a)return;if(!this.northwest)this.northwest=new Msn.VE.LatLong;if(!this.southeast)this.southeast=new Msn.VE.LatLong;this.northwest.Copy(a.northwest);this.southeast.Copy(a.southeast)};this.Center=function(){var b=Math.sin(this.northwest.latitude*Math.PI/180),c=Math.sin(this.southeast.latitude*Math.PI/180),d=.25*(Math.log((1+b)/(1-b))+Math.log((1+c)/(1-c))),a=new Msn.VE.LatLong;a.latitude=Math.atan(Math.exp(d))*360/Math.PI-90;a.longitude=.5*(parseFloat(this.northwest.longitude)+parseFloat(this.southeast.longitude));return a};this.Contains=function(c){return c.latitude<=a.latitude&&c.longitude>=a.longitude&&c.latitude>=b.latitude&&c.longitude<=b.longitude};this.ContainsRectangle=function(a){return a.southeast.latitude>=this.southeast.latitude&&a.southeast.longitude<=this.southeast.longitude&&a.northwest.latitude<=this.northwest.latitude&&a.northwest.longitude>=this.northwest.longitude}};Msn.VE.MapStyle=new function(){this.Road="r";this.Shaded="s";this.Aerial="a";this.Hybrid="h";this.Oblique="o";this.ObliqueHybrid="b"};Msn.VE.MapStyle.IsViewOblique=function(a){return a==Msn.VE.MapStyle.ObliqueHybrid||a==Msn.VE.MapStyle.Oblique};Msn.VE.MapStyle.IsViewOrtho=function(a){return a==Msn.VE.MapStyle.Road||a==Msn.VE.MapStyle.Shaded||a==Msn.VE.MapStyle.Hybrid||a==Msn.VE.MapStyle.Aerial};Msn.VE.MapViewType=function(){};Msn.VE.MapViewType.Pixel="pixel";Msn.VE.MapViewType.PixelRect="pixelRect";Msn.VE.MapViewType.LatLong="latlong";Msn.VE.MapViewType.LatLongAccurate="latlongaccurate";Msn.VE.MapViewType.LatLongRect="latlongRect";Msn.VE.MapView=function(map){this.zoomLevel=0;this.mapStyle=null;this.doRoadShading=false;this.tilt=-90;this.direction=0;this.altitude=-1000;this.center=new VEPixel;this.latlong=new Msn.VE.LatLong;this.cameraLatlong=null;this.pixelRect=new Msn.VE.PixelRectangle;this.latlongRect=new Msn.VE.LatLongRectangle;this.sceneId=null;this.sceneOrientation=null;this.bySceneId=false;this.callback=null;this.photoX=null;this.photoY=null;this.photoScale=null;this._supressFlyToCall=false;this._needsPivotOperation=true;var mapInstance=map,p_this=this,viewType=Msn.VE.MapViewType.Pixel;this.Destroy=function(){this.center=this.latlong=p_this=mapInstance=null};this.GetViewType=function(){return viewType};this.GetMap=function(){return mapInstance};this.SetMap=function(a){mapInstance=a};function MakeCopy(){var a=new Msn.VE.MapView;a.Copy(p_this);return a}function Copy(a){p_this.zoomLevel=a.zoomLevel;p_this.mapStyle=a.mapStyle;p_this.doRoadShading=a.doRoadShading;p_this.tilt=a.tilt;p_this.direction=a.direction;p_this.altitude=a.altitude;p_this.center.Copy(a.center);if(a.cameraLatlong!=null){p_this.cameraLatlong=new Msn.VE.LatLong;p_this.cameraLatlong.Copy(a.cameraLatlong)}p_this.latlong.Copy(a.latlong);p_this.pixelRect.Copy(a.pixelRect);p_this.latlongRect.Copy(a.latlongRect);p_this.sceneId=a.sceneId;p_this.sceneOrientation=a.sceneOrientation;p_this.photoX=a.photoX;p_this.photoY=a.photoY;p_this.photoScale=a.photoScale;p_this.SetMap(a.GetMap());viewType=a.GetViewType()}function Equals(a){return a!=null&&p_this.zoomLevel==a.zoomLevel&&p_this.mapStyle==a.mapStyle&&MathAbs(p_this.tilt-a.tilt)<1e-6&&MathAbs(p_this.direction-a.direction)<1e-6&&MathAbs(p_this.altitude-a.altitude)<1e-6&&MathAbs(p_this.center.x-a.center.x)<1e-6&&MathAbs(p_this.center.y-a.center.y)<1e-6&&p_this.sceneId==a.sceneId&&p_this.GetMap()==a.GetMap()&&p_this.sceneOrientation==a.sceneOrientation}function ToString(){return "("+p_this.latlong.ToString()+", "+p_this.zoomLevel+", "+p_this.mapStyle+")"}function SetCenter(a){if(!a)return;p_this.center=a;viewType=Msn.VE.MapViewType.Pixel}function SetCenterLatLong(a){if(!a)return;p_this.latlong=a;p_this.cameraLatlong=null;viewType=Msn.VE.MapViewType.LatLong}function SetCenterLatLongAccurate(a){if(a){p_this.latlong=a;p_this.cameraLatlong=null;if(Msn.VE.MapStyle.IsViewOblique(p_this.mapStyle))viewType=Msn.VE.MapViewType.LatLongAccurate;else viewType=Msn.VE.MapViewType.LatLong}}function SetPixelRectangle(a){p_this.pixelRect=a;p_this.cameraLatlong=null;p_this.tilt=-90;p_this.direction=0;viewType=Msn.VE.MapViewType.PixelRect}function SetLatLongRectangle(a){p_this.latlongRect=a;p_this.cameraLatlong=null;p_this.tilt=-90;p_this.direction=0;viewType=Msn.VE.MapViewType.LatLongRect}function SetZoomLevel(a){if(a<=0)a=1;var c=mapInstance.GetCenterOffset().x,d=mapInstance.GetCenterOffset().y;switch(viewType){case Msn.VE.MapViewType.Pixel:var b=Math.pow(2,a-p_this.zoomLevel);p_this.center.x=(p_this.center.x+c)*b-c;p_this.center.y=(p_this.center.y+d)*b-d;break;case Msn.VE.MapViewType.PixelRect:var b=Math.pow(2,a-p_this.zoomLevel);p_this.pixelRect.topLeft.x=p_this.pixelRect.topLeft.x*b;p_this.pixelRect.topLeft.y=p_this.pixelRect.topLeft.y*b;p_this.pixelRect.bottomRight.x=p_this.pixelRect.bottomRight.x*b;p_this.pixelRect.bottomRight.y=p_this.pixelRect.bottomRight.y*b}if(p_this.zoomLevel!=a){p_this.altitude=-1000;if(p_this.zoomLevel!=0)p_this.cameraLatlong=null}p_this.zoomLevel=a}function SetMapStyle(a,c,b,e,d){var f=p_this.mapStyle;p_this.mapStyle=a;if(viewType==Msn.VE.MapViewType.Pixel)viewType=Msn.VE.MapViewType.LatLong;if(!Msn.VE.MapStyle.IsViewOblique(a)){p_this.sceneId=null;p_this.sceneOrientation=null;p_this.bySceneId=false}else{p_this.sceneId=c;if(b)p_this.sceneOrientation=b;p_this.spinDirection=f==a?e:null;p_this.preserveScene=d;if(c)p_this.bySceneId=true;else p_this.bySceneId=false}}function SetTilt(a){if(a>=269.99999)a=a-360;if(a<-90)a=-90;if(a>90)a=90;p_this.tilt=a;p_this._needsPivotOperation=true}function SetDirection(a){if(a<0||a>=360){a=a%360;if(a<0)a=360+a}p_this.direction=a;p_this._needsPivotOperation=true}function SetAltitude(a){if(a<-1000||a>15000000)a=-1000;p_this.altitude=a}function GetTilt(){return p_this.tilt}function GetDirection(){return p_this.direction}function GetAltitude(){return p_this.altitude}function ScaleCoord(a,b){if(b)a=a*Math.pow(2,b-p_this.zoomLevel);return a}function GetX(a){return ScaleCoord(p_this.center.x,a)}function GetY(a){return ScaleCoord(p_this.center.y,a)}function GetCenter(a){var b=ScaleCoord(p_this.center.x+mapInstance.GetCenterOffset().x,a),c=ScaleCoord(p_this.center.y+mapInstance.GetCenterOffset().y,a);return new VEPixel(b,c)}function GetZoomLevel(){return p_this.zoomLevel}function GetLatLongRectangle(){return p_this.latlongRect}function GetPixelRectangle(){return p_this.pixelRect}function GetCenterLatLong(){var b=p_this.center.x+mapInstance.GetCenterOffset().x,c=p_this.center.y+mapInstance.GetCenterOffset().y,a=mapInstance.GetCurrentMode().PixelToLatLong(new VEPixel(b,c),p_this.zoomLevel);return a==null?p_this.latlong:a}function Resolve(b,d,c,a){if(viewType==Msn.VE.MapViewType.LatLongAccurate)ResolveAsync(b,d,c,a);else ResolveSync(b,d,c,a)}function ResolveAsync(b,e,d,a){function c(c){if(c!=null&&typeof c!="undefined"&&c.length==1)p_this.center=c[0];if(p_this.cameraLatlong==null)if(!p_this._UpdateCamera(b)){p_this.tilt=-90;p_this.cameraLatlong=p_this.latlong}viewType=Msn.VE.MapViewType.Pixel;if(a!=null&&typeof a=="function")a()}b.LatLongToPixelAsync([p_this.latlong],p_this.zoomLevel,c)}function ResolveSync(a,e,c,b){switch(viewType){case Msn.VE.MapViewType.Pixel:p_this.latlong=a.PixelToLatLong(p_this.center,p_this.zoomLevel);break;case Msn.VE.MapViewType.LatLong:p_this.center=a.LatLongToPixel(p_this.latlong,p_this.zoomLevel);if(p_this.center!=null){p_this.center.x-=mapInstance.GetCenterOffset().x;p_this.center.y-=mapInstance.GetCenterOffset().y}break;case Msn.VE.MapViewType.PixelRect:ResolveRectangle(a,e,c);break;case Msn.VE.MapViewType.LatLongRect:if(Msn.VE.MapStyle.IsViewOblique(p_this.mapStyle)){p_this.zoomLevel=1;var d=a.GetScene();if(!d||!d.ContainsLatLong(p_this.latlongRect.northwest)||!d.ContainsLatLong(p_this.latlongRect.southeast)){p_this.latlong=p_this.latlongRect.Center();p_this.center=a.LatLongToPixel(p_this.latlong,p_this.zoomLevel)}else{p_this.pixelRect.topLeft=a.LatLongToPixel(p_this.latlongRect.northwest,p_this.zoomLevel);p_this.pixelRect.bottomRight=a.LatLongToPixel(p_this.latlongRect.southeast,p_this.zoomLevel);ResolveRectangle(a,e,c)}}else{p_this.zoomLevel=12;p_this.altitude=-1000;p_this.pixelRect.topLeft=a.LatLongToPixel(p_this.latlongRect.northwest,p_this.zoomLevel);p_this.pixelRect.bottomRight=a.LatLongToPixel(p_this.latlongRect.southeast,p_this.zoomLevel);ResolveRectangle(a,e,c)}}if(p_this.cameraLatlong==null)if(!p_this._UpdateCamera(a)){p_this.tilt=-90;p_this.cameraLatlong=p_this.latlong}viewType=Msn.VE.MapViewType.Pixel;if(b!=null&&typeof b=="function")b()}function ResolveRectangle(i,k,j){var c=19,b=Math.pow(2,c-p_this.zoomLevel),g=MathMax(1,MathAbs(p_this.pixelRect.topLeft.x-p_this.pixelRect.bottomRight.x)*b),f=MathMax(1,MathAbs(p_this.pixelRect.topLeft.y-p_this.pixelRect.bottomRight.y)*b),d=Math.log(2),e=c-Math.ceil(Math.log(g/k)/d),h=c-Math.ceil(Math.log(f/j)/d),a=MathMin(e,h);if(a<=0)a=1;if(a>17)a=17;b=Math.pow(2,a-p_this.zoomLevel);p_this.center.x=.5*(p_this.pixelRect.topLeft.x+p_this.pixelRect.bottomRight.x)*b-mapInstance.GetCenterOffset().x;p_this.center.y=.5*(p_this.pixelRect.topLeft.y+p_this.pixelRect.bottomRight.y)*b-mapInstance.GetCenterOffset().y;p_this.zoomLevel=a;p_this.altitude=-1000;p_this.latlong=i.PixelToLatLong(p_this.center,p_this.zoomLevel)}function _UpdateCamera(viewMode){if(p_this.latlong==null)if(p_this.center!=null&&p_this.zoomLevel!=null&&typeof viewMode._InternalOrthoMode=="function"){var orthoMode=viewMode._InternalOrthoMode();p_this.latlong=orthoMode.PixelToLatLong(p_this.center,p_this.zoomLevel);if(p_this.latlong!=null){p_this.tilt=-90;p_this.direction=0}}if(p_this.latlong==null)return false;p_this._needsPivotOperation=false;if(mapInstance.IsModeEnabled(Msn.VE.MapActionMode.Mode3D)){var control=mapInstance.Get3DControl();if(control!=null){var cam=control.CameraPositionGivenTarget(p_this.latlong.latitude,p_this.latlong.longitude,p_this.altitude,p_this.zoomLevel,p_this.tilt,p_this.direction);if(cam!=null){var lat,lon,alt;eval(cam);p_this.cameraLatlong=new Msn.VE.LatLong;p_this.cameraLatlong.latitude=lat;p_this.cameraLatlong.longitude=lon;p_this.altitude=alt}else return false}}return true}this.MakeCopy=MakeCopy;this.Copy=Copy;this.Equals=Equals;this.ToString=ToString;this.SetCenter=SetCenter;this.SetCenterLatLong=SetCenterLatLong;this.SetCenterLatLongAccurate=SetCenterLatLongAccurate;this.SetPixelRectangle=SetPixelRectangle;this.SetLatLongRectangle=SetLatLongRectangle;this.SetZoomLevel=SetZoomLevel;this.SetMapStyle=SetMapStyle;this.SetTilt=SetTilt;this.SetDirection=SetDirection;this.SetAltitude=SetAltitude;this.GetTilt=GetTilt;this.GetDirection=GetDirection;this.GetAltitude=GetAltitude;this.ScaleCoord=ScaleCoord;this.GetX=GetX;this.GetY=GetY;this.GetCenter=GetCenter;this.Resolve=Resolve;this.SetZoomLevel=SetZoomLevel;this.GetZoomLevel=GetZoomLevel;this.GetLatLongRectangle=GetLatLongRectangle;this.GetPixelRectangle=GetPixelRectangle;this.GetCenterLatLong=GetCenterLatLong;this._UpdateCamera=_UpdateCamera};Msn.VE.ViewChangeType=function(){};Msn.VE.ViewChangeType.Zoom=1;Msn.VE.ViewChangeType.Pan=2;Msn.VE.ViewChangeType.Hybrid=3;Msn.VE.ViewChangeType.IsValid=function(a){return typeof a=="number"&&a>0&&a<4};Msn.VE.ObliqueScene=function(e,K,D,G,I,O,c,f,w,v,J){var b=null,g="",d=null,i=null,h={};h[Msn.VE.MapStyle.Oblique]="15";h[Msn.VE.MapStyle.ObliqueHybrid]="15";var j={};j[Msn.VE.MapStyle.Oblique]="%0t%3.tiles.virtualearth.net/tiles/o%4-%5-%6-%7.jpeg?g=%8";j[Msn.VE.MapStyle.ObliqueHybrid]="%0t%3.tiles.virtualearth.net/tiles/cmd/ObliqueHybrid?a=%4-%5-%6-%7&g=%8";var x=Msn.VE.MapStyle.Oblique,a=null,N=null,o=null;if(Msn.VE.API==null)a="%0dev.virtualearth.net/legacyService/ElevatedLoc.ashx";else{o=Msn.VE.API.Constants.imageryurl+"/ConvertLatLongToPixelInBirdsEye";a="%0dev.virtualearth.net/legacyService/ElevatedLoc.ashx"}var r=new _xz1,q=256,s=this,L=new Msn.VE.Bounds(1,2,0,0,c/2,f/2);function C(d,e){var c=Math.pow(2,e-2),f=[[d.x/c],[d.y/c],[1]],a=MatrixMultiply(w,f),b=new Msn.VE.LatLong;b.longitude=a[0][0]/a[2][0];b.latitude=a[1][0]/a[2][0];return b}function z(g,l,m){if(a!=null&&typeof a!="undefined"&&a.length>0){var i=Math.pow(2,l-2),h=[];for(var f=0;f<g.length;++f)h[f]=parseInt(g[f].x/i)+","+parseInt(g[f].y/i);var j=new VENetwork;j.ServiceUrl=a;var c=[];if(b)c.push(new VEParameter(Msn.VE.API.Constants.clienttoken,b));if(d)c.push(new VEParameter("mapguid",d));c.push(new VEParameter("a","P2L"));c.push(new VEParameter("b",h.join(";")));c.push(new VEParameter("s",e));c.push(new VEParameter("f","__PixelToLatLongAsyncResponse"));var k=function(b){var c=null;if(b!=null&&(b.err==null||typeof b.err=="undefined")){c=[];for(var a=0;a<b.length;++a)if(b[a]!=null)if(Msn.VE.API!=null){var e=new VELatLong;e._reserved=b[a];c[a]=e}else{var d=r.Decode(b[a]);c[a]=new Msn.VE.LatLong(d[0],d[1])}else c[a]=null}m(c)};j.BeginInvoke("__PixelToLatLongAsyncResponse",c,k,s)}}function l(d,e){var c=Math.pow(2,e-2),f=[[d.longitude],[d.latitude],[1]],a=MatrixMultiply(v,f),b=new VEPixel;b.x=a[0][0]/a[2][0]*c;b.y=a[1][0]/a[2][0]*c;return b}function y(h,k,l){var g=[];for(var f=0;f<h.length;++f)g[f]=r.Encode(h[f].latitude,h[f].longitude);var c=[];if(Msn.VE.API==null){c.push(new VEParameter("a","L2P"));c.push(new VEParameter("b",g.join("")));c.push(new VEParameter("s",e));c.push(new VEParameter("f","__LatLongToPixelAsyncResponse"))}else{if(b)c.push(new VEParameter(Msn.VE.API.Constants.clienttoken,b));if(d)c.push(new VEParameter("mapguid",d));c.push(new VEParameter("locations",'"'+g.join("")+'"'));c.push(new VEParameter("sceneId",e));c.push(new VEParameter("encodingLength",6))}if(Msn.VE.API!=null){var j=function(d){if(i)i.__HandleAuthentication(d);var c=null;if(d!=null&&d.Pixels!=null){var e=Math.pow(2,k-2);c=[];var b=d.Pixels;for(var a=0;a<b.length;++a)if(b[a]!=null&&b[a].X!=null&&typeof b[a].X!="undefined"&&b[a].Y!=null&&typeof b[a].Y!="undefined")c[a]=new VEPixel(b[a].X*e,b[a].Y*e);else c[a]=null}l(c)};VEAPIRequestInvoke(o,c,j)}else{var j=function(a){var c=null;if(a!=null&&(a.err==null||typeof a.err=="undefined")){var d=Math.pow(2,k-2);c=[];for(var b=0;b<a.length;++b)if(a[b]!=null&&a[b].x!=null&&typeof a[b].x!="undefined"&&a[b].y!=null&&typeof a[b].y!="undefined")c[b]=new VEPixel(a[b].x*d,a[b].y*d);else c[b]=null}l(c)},m=new VENetwork;m.ServiceUrl=a;m.BeginInvoke("__LatLongToPixelAsyncResponse",c,j,s)}}function F(a,b,d){if(a<0||b<0)return false;if(d==1)return a<c/2&&b<f/2;return a<c&&b<f}function M(){return e}function k(f,i,d,b){if(!Msn.VE.MapStyle.IsViewOblique(b))b=x;var e=i*(d==1?c/2:c)+f,a=j[b];if(Msn.VE.API){if(b==Msn.VE.MapStyle.ObliqueHybrid)a=Msn.VE.API.Constants.obliquehybridtileserver;else a=Msn.VE.API.Constants.obliquetileserver;a=a+g}return a.replace(/%3/g,e%4).replace(/%4/g,K).replace(/%5/g,D).replace(/%6/g,I+d-2).replace(/%7/g,e).replace(/%8/g,h[b])}function t(){return k(c/4,f/4,1)}this.GetMiddleTileFilename=t;function u(){var a=Msn.VE.API?Msn.VE.API.Constants.obliquethumbnailtileserver+g:"%0t%1.tiles.virtualearth.net/tiles/ot%2.jpeg?g=%3";return a.replace(/%1/g,e%4).replace(/%2/g,e).replace(/%3/g,h)}function B(){return G}function H(){return L}function p(){return c*q}function n(){return f*q}function A(a){if(!a)return false;var b=l(a,2);return m(b,2)}function m(b,e){var a=Math.pow(2,2-e),c=b.x*a,d=b.y*a;return c>=0&&d>=0&&c<p()&&d<n()}this.SetClientToken=function(a){b=a;if(b)g="&"+Msn.VE.API.Constants.clienttoken+"="+b;else g=""};this.SetGUID=function(a){d=a;if(typeof VEMap!="undefined")i=VEMap._GetMapFromGUID(d)};function E(){return J}this.PixelToLatLong=C;this.PixelToLatLongAsync=z;this.LatLongToPixel=l;this.LatLongToPixelAsync=y;this.IsValidTile=F;this.GetID=M;this.GetTileFilename=k;this.GetThumbnailFilename=u;this.GetOrientation=B;this.GetBounds=H;this.GetWidth=p;this.GetHeight=n;this.ContainsLatLong=A;this.ContainsPixel=m;this.GetMapStyle=E};Msn.VE.Orientation=new function(){this.North="North";this.East="East";this.West="West";this.South="South"};VEPixel=function(a,b){this.x=parseFloat(a);this.y=parseFloat(b)};VEPixel.prototype.ToString=function(){return "("+this.x+", "+this.y+")"};VEPixel.prototype.Copy=function(a){if(!a)return;this.x=a.x;this.y=a.y};function VEPixelToQuadKey(a,f){var d="";if(a!=null){var g=MathFloor(a.x/256),h=MathFloor(a.y/256);for(var c=f;c>0;c--){var b=0,e=1<<c-1;if((g&e)!=0)b++;if((h&e)!=0)b+=2;d+=b+""}}return d}Msn.VE.PixelRectangle=function(b,a){this.topLeft=b;this.bottomRight=a;this.ToString=function(){return "("+(this.topLeft?this.topLeft.ToString():"null")+", "+(this.bottomRight?this.bottomRight.ToString():"null")+")"};this.Copy=function(a){if(!a)return;if(!this.topLeft)this.topLeft=new VEPixel;if(!this.bottomRight)this.bottomRight=new VEPixel;this.topLeft.Copy(a.topLeft);this.bottomRight.Copy(a.bottomRight)};this.Contains=function(a){if(a instanceof VEPixel)return a.x>this.topLeft.x&&a.y>this.topLeft.y&&a.x<this.bottomRight.x&&a.y<this.bottomRight.y}};Msn.VE.LineRegion=function(b,a,c){this.boundingRectangle=b;this.indices=a;this.childRegions=c;function d(){return "Bounding Rectangle: "+this.boundingRectangle[0].ToString()+" to "+this.boundingRectangle[1].ToString()+" | Indices: ["+a+"]"}this.ToString=d};var L_integerencodingoutofrange_text="VEIntegerEncoding: The number encoded is out of supported range",L_floatintegermapencodingoutofrange_text="VEFloatIntegerMap: The number encoded is out of supported range",L_integerencodinginvalidstringlength_text="VEIntegerEncoding: Invalid string length",L_integerencodingunknowndigit_text="VEIntegerEncoding: The encoded string has an unknown digit";function VEIntegerEncoding(g,j){var e=g,d=g.length,a=j,h=1;for(var i=0;i<a;++i)h*=d;var f=h-1,c=[];for(var b=0;b<e.length;++b)c[e.substr(b,1)]=b;this.MaxValue=function(){return f};this.ValueLength=function(){return a};this.Encode=function(c){if(c<=f){var h="",g=[];for(var b=0;b<a;++b)g[b]=0;var i=a-1;while(c>0){g[i]=Math.floor(c%d);c=Math.floor(c/d);--i}for(var b=0;b<g.length;++b)h+=e.substr(g[b],1);return h}else throw L_integerencodingoutofrange_text};this.Decode=function(c){if(c.length==a){var b=0;for(var e=0;e<c.length;++e){b*=d;b+=this.DigitValue(c.substr(e,1))}return b}else throw L_integerencodinginvalidstringlength_text};this.DigitValue=function(a){if(c[a]!=null&&c[a]!="undefined")return c[a];else throw L_integerencodingunknowndigit_text}}function VEFloatIntegerMap(e,d,f){var a=e,c=d,b=f;this.MinFloat=function(){return a};this.MaxFloat=function(){return c};this.MaxInt=function(){return b};this.FloatToInt=function(d){if(d>=a&&d<=c){var e=(d-a)/(c-a),f=e*b+.5;return Math.min(Math.floor(f),b)}else throw L_floatintegermapencodingoutofrange_text};this.IntToFloat=function(d){if(d<=b){var f=d/b,e=a+f*(c-a);return e}else throw L_floatintegermapencodingoutofrange_text}}var L_velatlongencodinginvalidstringlength_text="_xz1: Invalid string length";function _xz1(b){var i=-90,h=90,g=-180,f=180,j="0123456789bcdfghjkmnpqrstvwxyz",e=6;if(b!=null&&typeof b!="undefined")e=b;var a=new VEIntegerEncoding(j,e),d=new VEFloatIntegerMap(i,h,a.MaxValue()),c=new VEFloatIntegerMap(g,f,a.MaxValue());this.Encode=function(e,b){var f=a.Encode(d.FloatToInt(e))+a.Encode(c.FloatToInt(b));return f};this.Decode=function(f){if(f.length==2*a.ValueLength()){var e=a.ValueLength(),j=f.substr(0,e),h=f.substr(e,e),i=a.Decode(j),g=a.Decode(h),b=[];b[0]=d.IntToFloat(i);b[1]=c.IntToFloat(g);return b}else throw L_velatlongencodinginvalidstringlength_text}}function _xz1ForMobile(){_xz1.call(this,5)}var Shims=["help","msve_ScratchPad","VE_MessageControl","contextMenu","MSVE_dashboardId"],vedomain="http://dev.mapindia.live.com/mapcontrol/v6.2",sceneParam="Yes",_entityIdShapePostfix="_Shape",_hackUniqueLayerId="UniqueLayer_Hack";function GetManifestUrl(a){return a.indexOf("http")==0?a:vedomain+a}function Get3dMarket(){if(typeof Msn.VE.API=="undefined"||Msn.VE.API==null)return window.locale;else return Msn.VE.API.Globals.locale}function Get3dInstallMarket(){if(typeof Msn.VE.API=="undefined"||Msn.VE.API==null)return window.locale;else return Msn.VE.API.Globals.resourcelocale}function Get3dInstallUrl(b,a){if(typeof a=="undefined"||a==null)a=Get3dInstallMarket();if(typeof b=="undefined"||b==null){b="Default.aspx?action=install";if(a)b+="&mkt={0}"}var c="http://maps.live.com/Help/VE3DInstall/"+b;c=c.replace("{0}",a);return c}function Get3dHelpUrl(c,a){var b="http://maps.live.com/Help/{0}/"+c;if(typeof a=="undefined"||a==null)a=Get3dMarket();b=b.replace("{0}",a);return b}function initShimElements(){for(var a=0;a<Shims.length;a++)UpdateIFrameShim(Shims[a])}function hookResizeEvent(a){if(a.onresize==null)a.onresize=function(){var b=event.srcElement,a=b.shimElement;if(a)SetShimPosition(a,b)}}function destroyShimElements(){for(var a=0;a<Shims.length;a++)destroyIFrameShim(Shims[a]);var b=$ID("msve_ScratchPad");if(b)b.onresize=null}function ConvertClipToSize(d,e){var a=e.style.clip.split(",");if(a.length==4){var c=parseInt(a[1]),b=parseInt(a[2]);if(!isNaN(b))d.height=b;if(!isNaN(c))d.width=c}}var UseClipToSize=window.navigator.userAgent.indexOf("Firefox")>=0;function SetShimPosition(a,b){var c=g(b).getRelativePosition(a.parentNode);a.style.top=c.y+"px";a.style.left=c.x+"px";a.width=b.offsetWidth;a.height=b.offsetHeight;if(UseClipToSize)ConvertClipToSize(a,b);else a.style.clip=b.style.clip}function UpdateIFrameShim(c,e,d){var a=typeof c=="object"?c:$ID(c);if(!a)return;if(!a.shimElement)addIFrameShim(a,e,d);var b=a.shimElement;SetShimPosition(b,a);if(Msn.VE.Css.Functions.getComputedStyle(a,"display")=="none"||Msn.VE.Css.Functions.getComputedStyle(a,"visibility")=="hidden")b.style.display="none";else b.style.display="block"}function RepositionShims(){if(!view3DMode)return;for(var b=0;b<Shims.length;b++){var a=$ID(Shims[b]);if(a&&a.shimElement&&a.shimElement.style.display!="none")SetShimPosition(a.shimElement,a)}}function addIFrameShim(b,f,e){var a=document.createElement("iframe");a.frameBorder="0";a.scrolling="no";a.style.position="absolute";if(e>=0)a.style.zIndex=e;else a.style.zIndex="1";a.style.backgroundColor="white";b.shimElement=a;HideShim(b);var c=f;if(c==null)c=b;var d=c.parentNode;if(d==null)d=document.body;d.insertBefore(a,c);if(b.id=="msve_ScratchPad"||b.id&&b.id.indexOf("_vefindcontrolinput")>0)hookResizeEvent(b);return a}function destroyIFrameShim(b){var a=$ID(b);DestroyShim(a)}function ShowShim(a,b){UpdateIFrameShim(a,b);if(a!=null&&a.shimElement)a.shimElement.style.display="block"}function HideShim(a){if(a!=null&&a.shimElement)a.shimElement.style.display="none"}function DestroyShim(a){if(a!=null&&a.shimElement){a.shimElement.parentNode.removeChild(a.shimElement);a.shimElement=null}}function RollShim(b){var a=b.Recipient;if(a.shimElement)if(UseClipToSize)ConvertClipToSize(a.shimElement,a);else a.shimElement.style.clip=a.style.clip}function OnView3DKeyDown(d,c){var b=parseInt(d);CloseContextMenu(b);ero.hide();var a=GetMapControlInstance(c);if(a==null)return;switch(b){case 65:a.SetMapStyle("a");break;case 72:a.SetMapStyle("h");break;case 82:case 86:a.SetMapStyle("r");break;case 50:case 98:window.setTimeout(function(){a.EnableMode(Msn.VE.MapActionMode.Mode2D)},10);break;case 66:case 79:a.GetDashboard().Oblique3DToggle()}}function OnNavigationHelpFired(){VE_Help.OpenLiveHelp("wl_local","topic","WL_LOCAL_PROC_3D_NavigateMap.htm")}function OnHardwareAccelHelpFired(){VE_Help.OpenLiveHelp("wl_local","topic","WL_LOCAL_TROU_3D_VideoAcceleration.htm")}var __shapeIdBeingDragged=null;function Deserialize3DMessage(message){var messageObject;if(typeof Sys!="undefined"&&Sys!=null&&Sys.Serialization!=null)messageObject=Sys.Serialization.JavaScriptSerializer.deserialize(message);else eval("messageObject = "+message+";");return messageObject}function OnView3DMouseDown(b){var a=Deserialize3DMessage(b);if(a.button=="Left"){__shapeIdBeingDragged=a.shapeId;window.setTimeout(BeginDragPin3D,300)}CloseContextMenu();ero.hide();if(typeof Msn.VE.API=="undefined"||Msn.VE.API==null)VE_MapDispatch.ClickedEntity=null}function BeginDragPin3D(){if(__shapeIdBeingDragged!=null){var d=true,b=VE_MapManager.GetCollectionByAnId(__shapeIdBeingDragged);if(b!=null){var c=VE_MapManager.GetSelectedCollection();if(c!=null&&c.GetId()!=b.GetId())return}else return;var a=VE_MapManager.GetAnnotationInCollectionById(b,__shapeIdBeingDragged);if(typeof a!="undefined"&&a!=null&&a.GetType()==MC_GEO_TYPE_POINT){VE_Annotations.EnterMovePushpinMode(__shapeIdBeingDragged,true);View3DMovePin(__shapeIdBeingDragged)}}}function OnView3DDropGeometry(b){var a=Deserialize3DMessage(b);if(!a.pushpinId)return;var c=VE_MapManager.GetAnnotationById(a.pushpinId);if(c)VE_Annotations.MovePushpin(null,new Msn.VE.LatLong(a.lat,a.lon))}function OnView3DLatLonAltClicked(b){var a=Deserialize3DMessage(b);VE_MapUpdateView_AutoSaveEntity();if(VE_EditControl.GetMode()==MC_DRAW_MODEL)VE_MapDispatch.OnCreateModel(a.lat,a.lon,a.alt);else VE_EditControl.AddPoint(null,a.lat,a.lon,a.alt)}function OnBeginFlyTo(c,b){ero.hide();var a=GetMapControlInstance(b);if(a!=null)a.OnBeginCameraUpdate()}function OnView3DUpdateViewpoint(k,l){var b=Deserialize3DMessage(k),c=GetMapControlInstance(l);if(c==null)return;c.OnEndCameraUpdate();var f=1e-6,e=.1,j=.01,a=c.GetCurrentMapView(),h=Math.abs(b.heading-a.GetDirection())<e&&Math.abs(b.pitch-a.GetTilt())<e,i=a.cameraLatlong!=null&&Math.abs(b.lat-a.cameraLatlong.latitude)<f&&Math.abs(b.lon-a.cameraLatlong.longitude)<f,m=Math.abs(b.alt-a.GetAltitude())<j&&a.GetZoomLevel()==b.zoom,g=i&&h&&(a.GetAltitude()<=-1000&&a.GetZoomLevel()==b.zoom);if(!g){var d=c.GetOn3DAnimationInterruptedCallback();if(d)d()}a=new Msn.VE.MapView(c);a.latlong=new Msn.VE.LatLong(b.targetLat,b.targetLon);a.cameraLatlong=new Msn.VE.LatLong(b.lat,b.lon);a.SetZoomLevel(b.zoom);a.SetMapStyle(c.GetMapStyle());a.SetAltitude(b.alt);a.SetDirection(b.heading);a.SetTilt(b.pitch);a._supressFlyToCall=true;c.SetView(a);c.Fire("onendpan");c.Fire("onchangeview")}function ProcessQueuedRequest(c,b){var a=GetVEMapInstance(b);if(a!=null)a._ProcessQueuedRequest()}function OnView3DHoverEnd(){ero.hide()}function CloseContextMenu(a){if(a!=16){VE_MapUpdateView_AutoSaveEntity();VE_MapUpdateView_AutoSaveEntity()}if(VE_ContextMenu.MenuOpen){VE_ContextMenu.RemoveContextPin();VE_ContextMenu.CloseMenu()}}function DoShowNotification(b){var a=Deserialize3DMessage(b);VE_MessageControl._AddMessage(a.message,a.milliseconds)}function OnSetupVE3DVIA(){VE_Help.OpenSized(L_InstallVE3DVIATitle_Text,"Help/"+Get3dInstallMarket()+"/VE3DVIAInstall.htm",700,520)}function Refresh3DPassportCookie(a){if(document.all)return;if(!a)a=map.Get3DControl();a.RefreshCookiesFromMozilla()}function OnRefreshModel(a){if(typeof Msn.VE.API=="undefined"||Msn.VE.API==null)if(typeof a!="undefined"&&a!=null){var b=a.split(",");VE_MapViewPreUpdate.RefreshCollectionList(b)}}function OnSelectPhoto(b){var a=Deserialize3DMessage(b);if(typeof state!="undefined"&&state!=null)state.SetScene(a.SceneId);if(a.Cause=="Rotation")$VE_A.Log3DOblique("Rotate View","Yes","In-Image Mode",a.X,a.Y,a.Scale);else if(a.Cause=="Selection"){$VE_A.Log3DOblique("Select BE Scene",sceneParam);sceneParam="Yes"}else if(a.Cause=="Transition")$VE_A.Log3DOblique("Pan BE Scene","Yes","In-Image Mode",a.X,a.Y,a.Scale);else if(a.Cause=="NotApplicable")sceneParam="No"}function OnPhotoCameraZoom(a){OnPhotoCameraPanOrZoom(a,"Zoom while In-Image")}function OnPhotoCameraPan(a){OnPhotoCameraPanOrZoom(a,"Pan BE Scene")}function OnPhotoCameraPanOrZoom(b,c){ero.hide();var a=Deserialize3DMessage(b);if(typeof state!="undefined"&&state!=null)state.SetXYScale(a.X,a.Y,a.Scale);$VE_A.Log3DOblique(c,"Yes","In-Image Mode",a.X,a.Y,a.Scale)}function OnActivate(a){var b=Deserialize3DMessage(a);if(b.Activate==1)$VE_A.Log3DOblique("Activate BE","No","Image Found")}function IsModelVisibleInSpaceland(c){var a=false,b=map.Get3DControl();if(b)if(b.InvokePlugInMethod(VE_3DPlugin.GeoCommunityGuid,"QueryModel",'msnid="'+c+'"')=="1")a=true;return a}VE_ModelActionType={CreateModel:"CreateModel",AddModel:"AssociateModel",AddModelByReference:"LoadModelFile",DeleteModel:"DissociateModel",MoveModel:"MoveModel",RotateModel:"RotateModel",ElevateModel:"ElevateModel",EditModel:"EditModel",LoadModelFile:"LoadModelFile",DeleteModelFile:"DeleteModelFile"};VE_ModelWhereType={Scratchpad:"scratchpad",Taskbar:"taskbar",ContextMenu:"contextmenu",CV:"cv"};function UniqueModelViewSuccess(){$VE_A.Log($VE_A.PgName.Model3D,"UniqueModelViewSuccess",$VE_A.PgName.Model3D)}function UniqueModelViewFailure(){$VE_A.Log($VE_A.PgName.Model3D,"UniqueModelViewFailure",$VE_A.PgName.Model3D)}function UniqueModelFullyDownloaded(){$VE_A.Log($VE_A.PgName.Model3D,"UniqueModelFullyDownloaded",$VE_A.PgName.Model3D)}function OnView3DPushpinHover(b,c){if(typeof VE_Annotations!="undefined")if(VE_Annotations.PanelOpen)return;var a=Deserialize3DMessage(b);Process3DPushpinHover(a.layerId,a.pushpinId,a.rX1,a.rY1,a.rX2,a.rY2,c)}function Process3DPushpinHover(layerId,pushpinId,rX1,rY1,rX2,rY2,mapGuid){var result=null,isInvalid=rX1==null||rY1==null||rX2==null||rY2==null?true:false,isEqual=rX1===rX2&&rY1===rY2?true:false,vmap,mapcontrol,mapid;try{var isAPI=typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null;if(!isAPI){vmap=null;mapcontrol=map;mapid="msve_mapContainer"}else{vmap=GetVEMapInstance(mapGuid);if(vmap==null)return;mapcontrol=vmap.vemapcontrol;mapid=vmap.ID}}catch(a){return}var mapdiv=$ID(mapid);if(mapdiv==null)return;var mapPos=g(mapdiv).getScreenPosition(),rect=null;if(!isInvalid)rect=new Msn.VE.Geometry.Rectangle(new Msn.VE.Geometry.Point(rX1+mapPos.x,rY1+mapPos.y),new Msn.VE.Geometry.Point(rX2+mapPos.x,rY2+mapPos.y));if(vmap!=null){if(isInvalid||isEqual)return;if(pushpinId.indexOf("msftve")==0){VEShowVEShapeERO(pushpinId,mapGuid,rect);return}else{var pushpins=vmap.pushpins;if(pushpins!=null){var len=pushpins.length;for(var i=0;i<len;i++){var p=pushpins[i];if(p!=null&&p.ID==pushpinId){ero.hide();VEPushpin.Show3D(rect,p.Title,p.Details,p.TitleStyle,p.DetailsStyle);return}}}}return}else{result=VE_MapManager.GetAnnotationById(pushpinId);if(result){var entity=result;try{if(entity!="undefined"&&entity!=""&&entity){var content=null,col=null;col=VE_MapManager.GetCollectionByAnId(pushpinId);var isCV=col.GetType()==MC_COL_TYPE_COLLECTION?false:true,primitive=entity.GetPrimitive(0);if(primitive.type!=VEShapeType.Pushpin&&pushpinId.indexOf(_entityIdShapePostfix)>0){VE_MapManager.SetHighlightEntity(entity,isCV);return}if(!isCV)VE_MapViewPreUpdate.ShowEro(pushpinId,VE_Directions.EntryPoint.Scratchpad,rect);else VE_MapViewPreUpdate.Viewer.ShowEroToItem(null,pushpinId,rect,null)}}catch(a){}return}}var ddERO=$find(pushpinId+"_ero");if(ddERO){CloseContextMenu();var content=ddERO.get_Content();ero.clearActions();var ddActionNames=eval(ddERO.get_ActionNames()),ddActionValues=eval(ddERO.get_ActionValues());g(ddActionNames).forEach(function(a,b){ero.addAction('<a href = "#" onclick = "'+ddActionValues[b]+'; return false;">'+a+"</a>")});ero.setContent(content);ero.dockToRect(rect,null,-1);return}result=pushpinId.match(/pin_traffic_market_(.*)/);if(result!=null&&result.length>=2){var entity=VE_TrafficManager.GetEntity(pushpinId);if(entity!=null){var content=VE_TrafficManager.CreateZoomPopupContent(entity);if(content!=null&&content!=""&&content!="undefined"){CloseContextMenu();ero.setContent(content);ero.dockToRect(rect,null,-1);return}}}result=pushpinId.match(/pin_traffic_incident_(.*)/);if(result!=null&&result.length>=2){var entity=VE_TrafficManager.GetEntity(pushpinId);if(entity!=null){var content=VE_TrafficManager.CreatePopupContent(entity,true);if(content!=null&&content!=""&&content!="undefined"){CloseContextMenu();ero.setContent(content);ero.dockToRect(rect,null,-1);return}}}if(pushpinId=="autolocate"){var pushpins=mapcontrol.GetPushpins();if(pushpins)for(var i=0;i<pushpins.length;++i)if(pushpins[i].pin.id=="autolocate"){var pinDOM=pushpins[i].pin;pinDOM.onmouseover(rect);return}}result=pushpinId.match(/pin_(.*)/);if(result==null)result=pushpinId=="place_pin"?[null,"place_ero"]:null;if(result!=null&&result.length>=2){var entityID=result[1],r=VE_SearchManager.GetEntity(entityID);if(r===null){entityID=result[0];r=VE_SearchManager.GetEntity(entityID);if(r===null){var correspondingItem=Gimme.id(entityID+"_number");entityID=correspondingItem&&correspondingItem.parentNode.id.replace(/_pin$/,"");r=VE_SearchManager.GetEntity(entityID)}}if(r!==null){CloseContextMenu();VE_SearchManager.SetLatLong(r.latitude,r.longitude);if(r.type!=VE_SearchType.Collection){var content=VE_SearchManager.CreatePopupContent(r,true);ero.setContent(content);ero.dockToRect(rect,null,-1)}else ShowCollectionPopup(new VE_CollectionSearchEroData(r),rect,null)}return}}function OnHardwareCapabilitiesUpdate(){if(typeof view3DMode!="undefined"&&view3DMode){map.Setup3DManifests();var a="3D performance option � ",b=map.Get3DControl().HardwareClassificationLevel;if(typeof b!="undefined"&&b!=null){switch(b){case 3:a+="Quality";break;case 2:a+="Balanced";break;case 1:a+="Performance"}$VE_A.Log($VE_A.PgName.Quality3D,a);UpdateStreetLevelGeometryState(map.Get3DControl());UpdateHiResModelsState(map.Get3DControl());UpdateWeatherPluginState(map.Get3DControl())}}}function View3DMovePin(a){map.Get3DControl().PickupGeometry("UniqueLayer_Hack",a)}Msn.VE.FFSentinel=function(a){this.CurrentVersion=a};function BrowserSupports3D(){var a=window.navigator.userAgent;return a.indexOf("Windows")!=-1&&(a.indexOf("MSIE")!=-1||a.indexOf("Firefox")!=-1)}function GetSentinel(){if(BrowserSupports3D()){if(window.navigator.userAgent.indexOf("MSIE")!=-1){var b;try{b=new ActiveXObject("Microsoft.SentinelVirtualEarth3DProxy.SentinelVE3DProxy")}catch(f){try{b=new ActiveXObject("Microsoft.SentinelVirtualEarth3D.SentinelVE3D")}catch(g){b=null}}return b}else if(typeof navigator.plugins!=undefined)for(var a=0;a<navigator.plugins.length;a++){var c=navigator.plugins[a].name.indexOf("Virtual Earth 3D");if(c>=0){var e=navigator.plugins[a].name.indexOf("plugin"),d=parseFloat(navigator.plugins[a].name.substring(c+17,e-1));return new Msn.VE.FFSentinel(d)}}}else if(typeof navigator.plugins!=undefined)for(var a=0;a<navigator.plugins.length;a++){var c=navigator.plugins[a].name.indexOf("Virtual Earth 3D");if(c>=0){var e=navigator.plugins[a].name.indexOf("plugin"),d=parseFloat(navigator.plugins[a].name.substring(c+17,e-1));return new Msn.VE.FFSentinel(d)}}return null}function HandleModeNotInstalled(b){if(b==Msn.VE.MapActionMode.Mode3D){map.EnableMode(Msn.VE.MapActionMode.Mode2D);if(BrowserSupports3D()){var a=GetSentinel();if(a!=null)View3DDamaged();else View3DInstall()}else if(typeof ShowMessage!="undefined")ShowMessage(L_BrowserNotSupported3D_Text)}}function View3DInstall(){try{if(typeof Msn.VE.API=="undefined"||Msn.VE.API==null)state.Set3DViewInstallInProgress("true");if(window.navigator.userAgent.indexOf("MSIE")!=-1)VE_Help.OpenSized(L_View3DHelpWindowTitle_Text,Get3dInstallUrl(),650,520);else VE_Help.OpenSized(L_View3DHelpWindowTitle_Text,Get3dInstallUrl(),680,540);var a=VE_Help.helpPanel.onCloseClick;VE_Help.helpPanel.onCloseClick=function(){$VE_A.Log($VE_A.PgName.Inst3D,"Install 3D > Return");a();VE_Help.helpPanel.onCloseClick=a}}catch(b){}}function View3DUpgrade(c){try{var b=Get3dInstallUrl("Default.aspx?v="+c+"&mkt={0}");if(typeof Msn.VE.API=="undefined"||Msn.VE.API==null)state.Set3DViewInstallInProgress("true");if(typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null)window.open(b,"_blank","width=600,height=320,menubar=0,resizeable=0,status=0,titlebar=0,toolbar=0,scrollbars=0");else{VE_Help.OpenSized(L_View3DHelpWindowTitle_Text,b,600,320);var a=VE_Help.helpPanel.onCloseClick;VE_Help.helpPanel.onCloseClick=function(){$VE_A.Log($VE_A.PgName.Inst3D,"Upgrade 3D > Cancel");a();VE_Help.helpPanel.onCloseClick=a}}}catch(d){}}function View3DDamaged(){try{VE_Help.Open("",Get3dHelpUrl("View3DUnavailable.htm"))}catch(a){}}function View3DSwitch(){if(map)map.EnableMode(Msn.VE.MapActionMode.Mode3D)}function Start3DView(){if(map){if(typeof ShowMessage!="undefined")ShowMessage(L_3DLoading_Text);window.setTimeout(View3DSwitch,200)}}function Start3DViewWhenUpgradeComplete(){if(map){var a=GetSentinel();if(a.CurrentVersion>=3.0){if(typeof ShowMessage!="undefined")ShowMessage(L_3DLoading_Text);window.setTimeout(View3DSwitch,200)}else setTimeout(Start3DViewWhenUpgradeComplete,1500);a=null}}function NotifyWhen3DUpgraded(){if(map){var a=GetSentinel();if(a.CurrentVersion>=3.0)if(map.GetDashboard()&&map.GetDashboard().DisplayThreeDUpdatedNotification)map.GetDashboard().DisplayThreeDUpdatedNotification();else{if(typeof ShowMessage!="undefined")ShowMessage(L_3DLoading_Text);window.setTimeout(View3DSwitch,200)}else setTimeout(NotifyWhen3DUpgraded,1500);a=null}}function PushpinURL(d,c){var a=vedomain+"/i/bin/"+window.buildVersion+"/";if(typeof d=="undefined"||d==null||!d)return a+"pins/red_circ7px.gif";var b=Msn.VE.PushPinTypes;switch(d){case b.Annotation:if(c=="shared")return a+"pins/poi_viewer.gif";else return a+"pins/poi_usergenerated.gif";case b.Overlay:if(c=="shared")return a+"pins/poi_cruncher_viewer.gif";else return a+"pins/poi_cruncher.gif";case b.SearchResultPrecise:if(c=="model"||c=="sharemodel")return a+"pins/modelpoi.gif";else if(c=="shared")return a+"pins/poi_title_viewer.gif";return a+"pins/poi_"+c+".gif";case b.SearchResultNonprecise:if(c=="model"||c=="sharemodel")return a+"pins/modelpoi.gif";else if(c=="shared")return a+"pins/poi_title_viewer.gif";return a+"pins/poi_search_nonprecise.gif";case b.Collection:return a+"pins/poi_"+c+".gif";case b.AdSponsor:return a+"pins/poi_search.gif";case b.DirectionStep:return a+"pins/poi_direction_step.png";case b.Direction:return a+"blue_pushpin.png";case b.DirectionTemp:return a+"pins/mapicon_"+c+".gif";case b.TrafficOthers:return a+"Traffic/Traffic"+c+".gif";case b.YouAreHere:return a+"pins/poi_youarehere.gif";case b.Default:return a+"pins/"+c;case b.Context:return a+"pins/red_circ7px.gif";case b.AdRoofStandard:case b.AdRoofWide:case b.AdStandard:case b.AdWide:case b.AdCategory:return c}return a+"pins/poi_usergenerated.gif"}function _VEExtractImgUrlFromHtml(d){var b=null,a=document.createElement("div");a.innerHTML=d;var c=a.getElementsByTagName("img");if(c.length>=1)b=c[0].getAttribute("src");a=null;return b}var _VEHtmlToImgUrlHash=[];function TranslatePushpinURL(d,f,g){var a=Msn.VE.PushPinTypes,h,c=null;switch(g){case a.DirectionTemp:var e=/mapicon_(start|end).gif/g,b=e.exec(f);if(b!=null&&b.length>=2){c=b[1];break}else return vedomain+_VEExtractImgUrlFromHtml(f);case a.SearchResultPrecise:case a.SearchResultNonprecise:case a.Collection:var e=/VE_Pushpin VE_Pushpin_(.*)/g,b=e.exec(d);if(b!=null&&b.length>=2)c=b[1];break;case a.TrafficOthers:if(typeof _VEHtmlToImgUrlHash[d]=="string")c=_VEHtmlToImgUrlHash[d];else{var e=new RegExp(/VE_Pushpin VE_Traffic_(.*)/g),b=e.exec(d);if(b!=null&&b.length>=2){c=b[1];_VEHtmlToImgUrlHash[d]=c}e=null}break;case a.AdRoofStandard:case a.AdRoofWide:case a.AdStandard:case a.AdWide:case a.AdCategory:c=_VEExtractImgUrlFromHtml(f)}var h=PushpinURL(g,c);return h}var _VE_previousShapeId=null;function RaiseMouseEvent3D(g,d,b){try{var a=Deserialize3DMessage(g);if(a.shapeId!=null){var e=typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null;if(b=="onclick"||!e&&b=="onmouseover"&&a.shapeId.indexOf(_entityIdShapePostfix)>0&&_VE_previousShapeId!=a.shapeId){if(typeof VE_Annotations!="undefined")if(VE_Annotations.PanelOpen)return;_VE_previousShapeId=a.shapeId;Process3DPushpinHover(a.layerId,a.shapeId,a.rX1,a.rY1,a.rX2,a.rY2,d)}else if(!e&&b=="onmouseout"&&a.shapeId.indexOf(_entityIdShapePostfix)>0){VE_MapManager.HighlightEntity(false);_VE_previousShapeId=null}}var c=GetMapControlInstance(d);if(c==null)return;var f=c.CreateEvent(a.lat==null||a.lon==null?null:new Msn.VE.LatLong(a.lat,a.lon),null,null,null,a.shapeId,a.button,a.alt);c.Fire(b,f)}catch(h){}}function OnMouseDown3D(b,a){RaiseMouseEvent3D(b,a,"onmousedown")}function OnMouseUp3D(b,a){__shapeIdBeingDragged=null;RaiseMouseEvent3D(b,a,"onmouseup")}function OnClick3D(b,a){RaiseMouseEvent3D(b,a,"onclick")}function OnMouseOver3D(b,a){RaiseMouseEvent3D(b,a,"onmouseover")}function OnMouseOut3D(b,a){ero.hide();RaiseMouseEvent3D(b,a,"onmouseout")}function OnDoubleClick3D(b,a){RaiseMouseEvent3D(b,a,"ondoubleclick")}function OnChangeMapStyle3D(){var b=GetMapControlInstance();if(b){var a=b.Get3DControl();UpdateStreetLevelGeometryState(a);UpdateHiResModelsState(a);UpdateWeatherPluginState(a)}}function GetMapControlInstance(b){if(typeof Msn.VE.API=="undefined"||Msn.VE.API==null)return map;var a=GetVEMapInstance(b);if(a==null)return null;return a.vemapcontrol}function GetVEMapInstance(a){if(typeof a=="undefined"||a==null){if(Msn.VE.API==null||Msn.VE.API=="undefined"||Msn.VE.API.Globals.vemapinstances==null||Msn.VE.API.Globals.vemapinstances=="undefined")return null;var c=0;for(var b in Msn.VE.API.Globals.vemapinstances)if(Msn.VE.API.Globals.vemapinstances[b]instanceof VEMap&&Msn.VE.API.Globals.vemapinstances[b].GetMapMode()==VEMapMode.Mode3D){c++;a=b}if(c!=1)return null}return VEMap._GetMapFromGUID(a)}function Get3DHardwareClassification(b){var a=b.HardwareClassificationLevel;if(a==3)a="Quality";else if(a==2)a="Balanced";else if(a==1)a="Performance";else a="Unknown";return a}VE_3DPlugin={MovieRecorderGuid:"791BC97B-7526-4C74-85DB-8CC220E3A65E",PhotoGuid:"B1FC67C1-F8CE-4CA5-A957-B5FF2215037B",PhotoManifest:GetManifestUrl("http://go.microsoft.com/fwlink/?LinkID=99342"),PhotoUrl:GetManifestUrl("http://go.microsoft.com/fwlink/?LinkID=98905"),HiResModelsGuid:"5D4BE259-4D19-492F-8D6B-830833E2EAD9",HiResModelsManifest:GetManifestUrl("http://go.microsoft.com/fwlink/?LinkID=124117"),HiResModelsUrl:GetManifestUrl("http://go.microsoft.com/fwlink/?LinkID=124119"),WeatherPluginGuid:"A020A315-34D9-4357-94AD-97F909E96B22",WeatherPluginManifest:GetManifestUrl("http://go.microsoft.com/fwlink/?LinkID=124118"),WeatherPluginUrl:GetManifestUrl("http://go.microsoft.com/fwlink/?LinkID=124120"),GeoCommunityGuid:"49D0BC0C-67A7-44CD-93BA-C7CF6F20EAB9",GeoCommunityManifest:GetManifestUrl("http://go.microsoft.com/fwlink/?LinkID=99343"),GeoCommunityUrl:GetManifestUrl("http://go.microsoft.com/fwlink/?LinkID=98904"),StreetLevelGeometryGuid:"C9F0B259-0B78-464A-BEC4-B4E90CF0BC8D",StreetLevelGeometryManifest:GetManifestUrl("http://go.microsoft.com/fwlink/?LinkID=111353"),StreetLevelGeometryUrl:GetManifestUrl("http://go.microsoft.com/fwlink/?LinkID=109495")};var VE_3DPhotoPluginObj=0,VE_3DHiResModelsPluginObj=0,VE_3DWeatherPluginObj=0,VE_3DGeoCommunityPluginObj=0,VE_3DStreetLevelGeometryObj=0,PluginEventRegistered=0,PhotoPluginEventRegistered=0,GeoCommunityPluginEventRegistered=0,StreetLevelGeometryEventRegistered=0,VE3DVIASavedAction=0;function GetVE3DVIAInstallState(a){if(!a){a=map.Get3DControl();if(!a)return 0}return a.GetComponentInstallState("EE3B731B-969E-4cb6-8949-ADFDC763A547")}function OnVE3DVIAInstallEnd(){if(VE3DVIASavedAction!=0){ProcessModelIn3DEx(VE3DVIASavedAction.actionType,VE3DVIASavedAction.properties,VE3DVIASavedAction.control,L_PluginFeatureNotAvailable_Text);VE3DVIASavedAction=0}}function ProcessModelRequire3DVIA(b,c,a){if(typeof b=="undefined"||b==null)return;if(!a){a=map.Get3DControl();if(!a)return}if(GetVE3DVIAInstallState()==2)ProcessModelIn3DEx(b,c,a,L_PluginFeatureNotAvailable_Text);else{if(!VE3DVIASavedAction)VE3DVIASavedAction={};VE3DVIASavedAction.actionType=b;VE3DVIASavedAction.properties=c;VE3DVIASavedAction.control=a;OnSetupVE3DVIA()}}function ProcessModelIn3D(b,c,d){var a=L_UnableToDisplay3DVIAModel_Text;if(VE_ModelActionType.DeleteModel==b)a="";ProcessModelIn3DEx(b,c,d,a)}function ProcessModelIn3DEx(b,e,a,d){if(typeof b=="undefined"||b==null)return;if(!a){var c=GetMapControlInstance();if(c)a=c.Get3DControl();if(!a)return}if(!VE_3DGeoCommunityPluginObj)VE_3DGeoCommunityPluginObj=CreatePluginObj(a,VE_3DPlugin.GeoCommunityGuid,VE_3DPlugin.GeoCommunityManifest,VE_3DPlugin.GeoCommunityUrl);if(!GeoCommunityPluginEventRegistered){a.AttachPlugInEvent(VE_3DPlugin.GeoCommunityGuid,"OnRefreshModel","OnRefreshModel");a.AttachPlugInEvent(VE_3DPlugin.GeoCommunityGuid,"OnLaunchVE3DVIA","OnLaunchVE3DVIA");a.AttachPlugInEvent(VE_3DPlugin.GeoCommunityGuid,"LoadModelFileStatus","VE_OnLoadModelFileStatus");GeoCommunityPluginEventRegistered=1}FirePluginEventIn3D(VE_3DGeoCommunityPluginObj,b,e,a,d)}function ProcessPhotoPluginActionIn3D(b,c,a){if(typeof b=="undefined"||b==null)return;if(!a){a=map.Get3DControl();if(!a)return}if(!VE_3DPhotoPluginObj)VE_3DPhotoPluginObj=CreatePluginObj(a,VE_3DPlugin.PhotoGuid,VE_3DPlugin.PhotoManifest,VE_3DPlugin.PhotoUrl);if(!PhotoPluginEventRegistered){a.AttachPlugInEvent(VE_3DPlugin.PhotoGuid,"OnSelectPhoto","OnSelectPhoto");a.AttachPlugInEvent(VE_3DPlugin.PhotoGuid,"OnActivate","OnActivate");a.AttachPlugInEvent(VE_3DPlugin.PhotoGuid,"OnCameraPan","OnPhotoCameraPan");a.AttachPlugInEvent(VE_3DPlugin.PhotoGuid,"OnCameraZoom","OnPhotoCameraZoom");a.AttachPlugInEvent(VE_3DPlugin.PhotoGuid,"OnPhotoStateChanged","OnPhotoStateChanged");PhotoPluginEventRegistered=1}FirePluginEventIn3D(VE_3DPhotoPluginObj,b,c,a,null)}function AllowWeatherPlugin(a){if(!a)return false;var c=GetMapControlInstance(null),d=a.HardwareClassificationLevel,b=c.GetMapStyle();return d==3&&(b=="a"||b=="h")}function AllowHiResModels(a){if(!a)return false;var c=GetMapControlInstance(null),b=a.HardwareClassificationLevel;return b==3}function AllowStreetLevelDetail(a){if(!a)return false;var c=GetMapControlInstance(null),d=a.HardwareClassificationLevel,b=c.GetMapStyle();return d==3&&(b=="a"||b=="h")}function LoadWeatherPlugin(a){if(!VE_3DWeatherPluginObj)if(a&&AllowWeatherPlugin(a)){VE_3DWeatherPluginObj=CreatePluginObj(a,VE_3DPlugin.WeatherPluginGuid,VE_3DPlugin.WeatherPluginManifest,VE_3DPlugin.WeatherPluginUrl);if(VE_3DWeatherPluginObj){VE_3DWeatherPluginObj.Loading=1;a.LoadPlugInDll(VE_3DWeatherPluginObj.Url)}}}function OnHiResModelViewed(){$VE_A.Log($VE_A.PgName.HiRes3D,"Session")}function LoadHiResModelsPlugin(a){if(!VE_3DHiResModelsPluginObj)if(a&&AllowHiResModels(a)){VE_3DHiResModelsPluginObj=CreatePluginObj(a,VE_3DPlugin.HiResModelsGuid,VE_3DPlugin.HiResModelsManifest,VE_3DPlugin.HiResModelsUrl);if(VE_3DHiResModelsPluginObj){a.AttachPlugInEvent(VE_3DPlugin.HiResModelsGuid,"OnHiResModelViewed","OnHiResModelViewed");VE_3DHiResModelsPluginObj.Loading=1;a.LoadPlugInDll(VE_3DHiResModelsPluginObj.Url)}}}function LoadStreetLevelGeometry(a){if(!VE_3DStreetLevelGeometryObj)if(a&&AllowStreetLevelDetail(a)){VE_3DStreetLevelGeometryObj=CreatePluginObj(a,VE_3DPlugin.StreetLevelGeometryGuid,VE_3DPlugin.StreetLevelGeometryManifest,VE_3DPlugin.StreetLevelGeometryUrl);if(VE_3DStreetLevelGeometryObj){VE_3DStreetLevelGeometryObj.Loading=1;a.LoadPlugInDll(VE_3DStreetLevelGeometryObj.Url)}}}function ActivateStreetLevelGeometry(a){if(AllowStreetLevelDetail(a))if(!VE_3DStreetLevelGeometryObj)LoadStreetLevelGeometry(a);else if(VE_3DStreetLevelGeometryObj.Loaded&&!VE_3DStreetLevelGeometryObj.Activated)if(a)a.ActivatePlugIn(VE_3DStreetLevelGeometryObj.Guid,VE_3DStreetLevelGeometryObj.Manifest)}function DeactivateStreetLevelGeometry(a){if(VE_3DStreetLevelGeometryObj)if(VE_3DStreetLevelGeometryObj.Loaded&&VE_3DStreetLevelGeometryObj.Activated&&!AllowStreetLevelDetail(a))if(a)a.DeactivatePlugIn(VE_3DStreetLevelGeometryObj.Guid)}function UpdateStreetLevelGeometryState(a){var b=AllowStreetLevelDetail(a);if(b){if(!VE_3DStreetLevelGeometryObj.Activated)ActivateStreetLevelGeometry(a)}else if(VE_3DStreetLevelGeometryObj.Activated)DeactivateStreetLevelGeometry(a)}function ActivateWeatherPlugin(a){if(AllowWeatherPlugin(a))if(!VE_3DWeatherPluginObj)LoadWeatherPlugin(a);else if(VE_3DWeatherPluginObj.Loaded&&!VE_3DWeatherPluginObj.Activated)if(a)a.ActivatePlugIn(VE_3DWeatherPluginObj.Guid,VE_3DWeatherPluginObj.Manifest)}function DeactivateWeatherPlugin(a){if(VE_3DWeatherPluginObj)if(VE_3DWeatherPluginObj.Loaded&&VE_3DWeatherPluginObj.Activated&&!AllowWeatherPlugin(a))if(a)a.DeactivatePlugIn(VE_3DWeatherPluginObj.Guid)}function UpdateWeatherPluginState(a){var b=AllowWeatherPlugin(a);if(b){if(!VE_3DWeatherPluginObj.Activated)ActivateWeatherPlugin(a)}else if(VE_3DWeatherPluginObj.Activated)DeactivateWeatherPlugin(a)}function ActivateHiResModelsPlugin(a){if(AllowHiResModels(a))if(!VE_3DHiResModelsPluginObj)LoadHiResModelsPlugin(a);else if(VE_3DHiResModelsPluginObj.Loaded&&!VE_3DHiResModelsPluginObj.Activated)if(a)a.ActivatePlugIn(VE_3DHiResModelsPluginObj.Guid,VE_3DHiResModelsPluginObj.Manifest)}function DeactivateHiResModelsPlugin(a){if(VE_3DHiResModelsPluginObj)if(VE_3DHiResModelsPluginObj.Loaded&&VE_3DHiResModelsPluginObj.Activated&&!AllowHiResModels(a))if(a)a.DeactivatePlugIn(VE_3DHiResModelsPluginObj.Guid)}function UpdateHiResModelsState(a){var b=AllowHiResModels(a);if(b){if(!VE_3DHiResModelsPluginObj.Activated)ActivateHiResModelsPlugin(a)}else if(VE_3DHiResModelsPluginObj.Activated)DeactivateHiResModelsPlugin(a)}function CreatePluginObj(b,d,c,e){if(!PluginEventRegistered){b.AttachEvent("OnPlugInLoaded","On3DPlugInLoaded");b.AttachEvent("OnPlugInActivated","On3DPlugInActivated");b.AttachEvent("OnPlugInDeactivated","On3DPlugInDeactivated");PluginEventRegistered=1}var a={};a.Loaded=0;a.Loading=0;a.Activated=0;a.actionCounter=0;a.actionType=[];a.properties=[];a.control=[];a.errorMessage=[];a.Guid=d.toUpperCase();a.Manifest=c;a.Url=e;return a}function FirePluginEventIn3D(a,c,d,b,e){if(a.Activated)b.RaiseEvent(a.Guid,c,d);else{if(!a.Loaded&&!a.Loading){a.Loading=1;b.LoadPlugInDll(a.Url)}QueuePluginEvent(a,c,d,b,e)}}function QueuePluginEvent(a,c,d,e,b){a.actionType[a.actionCounter]=c;a.properties[a.actionCounter]=d;a.control[a.actionCounter]=e;a.errorMessage[a.actionCounter]=b;a.actionCounter=a.actionCounter+1}function FireErrorMessage(b){var a,c;for(a=0;a<b.actionCounter;a=a+1){if(b.errorMessage[a]==null||b.errorMessage[a].length==0)continue;var d=false;for(c=0;c<a;c=c+1)if(b.errorMessage[a]==b.errorMessage[c]){d=true;break}if(!d)VE_MessageControl._AddMessage(b.errorMessage[a])}}function PostLoadPlugin(b,a,c){a.Loading=0;if(!a.Loaded)if(c){a.Loaded=1;b.ActivatePlugIn(a.Guid,a.Manifest)}else{if(a.Guid==VE_3DPlugin.GeoCommunityGuid)FireErrorMessage(a);else VE_MessageControl._AddMessage(L_PluginFeatureNotAvailable_Text,3000);a.actionCounter=0}}function PostActivatePlugin(c,a,d){if(d){a.Activated=1;var b;for(b=0;b<a.actionCounter;b=b+1)if(c==a.control[b])c.RaiseEvent(a.Guid,a.actionType[b],a.properties[b])}else if(a.Guid==VE_3DPlugin.GeoCommunityGuid)FireErrorMessage(a);else VE_MessageControl._AddMessage(L_PluginFeatureNotAvailable_Text,3000);a.actionCounter=0}function On3DPlugInLoaded(h,g){var a=Deserialize3DMessage(h);if(typeof a.guid!="undefined"&&a.guid!=null)a.guid=a.guid.toUpperCase();else if(typeof a.plugInPath=="string"){var i=a.plugInPath.toLowerCase(),f=[VE_3DPhotoPluginObj,VE_3DGeoCommunityPluginObj,VE_3DStreetLevelGeometryObj,VE_3DWeatherPluginObj,VE_3DHiResModelsPluginObj];for(var d=0;d<f.length;d++){var c=f[d];if(typeof c=="object"&&typeof c.Url=="string"&&c.Url.toLowerCase()==i){a.guid=c.Guid.toUpperCase();break}}}var e=GetMapControlInstance(g);if(e){var b=e.Get3DControl();if(a.guid==VE_3DPlugin.PhotoGuid)PostLoadPlugin(b,VE_3DPhotoPluginObj,a.success);else if(a.guid==VE_3DPlugin.GeoCommunityGuid)PostLoadPlugin(b,VE_3DGeoCommunityPluginObj,a.success);else if(a.guid==VE_3DPlugin.HiResModelsGuid){if(a.success&&!VE_3DHiResModelsPluginObj.Loaded){VE_3DHiResModelsPluginObj.Loaded=1;ActivateHiResModelsPlugin(b)}}else if(a.guid==VE_3DPlugin.WeatherPluginGuid){if(a.success&&!VE_3DWeatherPluginObj.Loaded){VE_3DWeatherPluginObj.Loaded=1;ActivateWeatherPlugin(b)}}else if(a.guid==VE_3DPlugin.StreetLevelGeometryGuid)if(a.success&&!VE_3DStreetLevelGeometryObj.Loaded){VE_3DStreetLevelGeometryObj.Loaded=1;ActivateStreetLevelGeometry(b)}}}function On3DPlugInActivated(e,d){var a=Deserialize3DMessage(e);if(typeof a.guid!="undefined"&&a.guid!=null)a.guid=a.guid.toUpperCase();var c=GetMapControlInstance(d);if(c){var b=c.Get3DControl();if(a.guid==VE_3DPlugin.PhotoGuid)PostActivatePlugin(b,VE_3DPhotoPluginObj,a.success);else if(a.guid==VE_3DPlugin.GeoCommunityGuid)PostActivatePlugin(b,VE_3DGeoCommunityPluginObj,a.success);else if(a.guid==VE_3DPlugin.StreetLevelGeometryGuid)PostActivatePlugin(b,VE_3DStreetLevelGeometryObj,a.success);else if(a.guid==VE_3DPlugin.HiResModelsGuid)PostActivatePlugin(b,VE_3DHiResModelsPluginObj,a.success);else if(a.guid==VE_3DPlugin.WeatherPluginGuid)PostActivatePlugin(b,VE_3DWeatherPluginObj,a.success)}}function On3DPlugInDeactivated(b){var a=Deserialize3DMessage(b);a.guid=a.guid.toUpperCase();if(a.guid==VE_3DPlugin.PhotoGuid&&a.success)VE_3DPhotoPluginObj.Activated=0;else if(a.guid==VE_3DPlugin.GeoCommunityGuid&&a.success)VE_3DGeoCommunityPluginObj.Activated=0;else if(a.guid==VE_3DPlugin.StreetLevelGeometryGuid&&a.success)VE_3DStreetLevelGeometryObj.Activated=0;else if(a.guid==VE_3DPlugin.HiResModelsGuid&&a.success)VE_3DHiResModelsPluginObj.Activated=0;else if(a.guid==VE_3DPlugin.WeatherPluginGuid&&a.success)VE_3DWeatherPluginObj.Activated=0}function OnPhotoStateChanged(e,c){var a=GetMapControlInstance(c);if(a==null)return;var b=a.CreateEvent(),d=Deserialize3DMessage(e);b.enabled=d.enabled;a.Fire("onve3dphotostatechanged",b)}function OnLaunchVE3DVIA(){VE_MessageControl._AddMessage(L_LaunchVE3DVIA_Text,5000)}function VE_OnLoadModelFileStatus(d){if(typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null){var c=GetVEMapInstance();if(c){var b=Deserialize3DMessage(d),a=c.GetShapeByID(b.id);if(a&&a.ModelData&&typeof a.ModelData.Callback=="function")a.ModelData.Callback(a,b.status)}}}var __vemapcontrolisReady=true;if(!window.__DEP_COL_HASH)window.__DEP_COL_HASH=[];function openDependency(c,g){var d=false,a=__DEP_COL_HASH[c];if(!a){a=new f(c,g);var b=__DEP_COL_HASH.push(a);__DEP_COL_HASH[c]=__DEP_COL_HASH[b-1]}if(a.isClosed)a.reset();var b,i=arguments.length;for(b=2;b<i;b++){var e=arguments[b];if(!a.dependencyExists(e))a.addDependency(new h(e));else d=true}return !d;function h(a){this.id=a;this.isReady=false}function f(c,d){var a=[],b=d,e=false;this.key=c;this.isClosed=false;this.addDependency=function(b){var c=a.push(b);a[b.id]=a[c-1]};this.dependencyExists=function(b){return a[b]!=null};this.getDependencies=function(){return a};this.executeCallback=function(){if(typeof b=="function")b.call()};this.reset=function(){this.isClosed=false;a=[]}}}function closeDependency(f){var b,h=__DEP_COL_HASH.length;a:for(b=0;b<h;b++){var a=__DEP_COL_HASH[b],d=a.getDependencies(),e=d[f];if(typeof e!="undefined"&&e!=null){e.isReady=true;if(!a.isClosed){var c,g=d.length;for(c=0;c<g;c++)if(!d[c].isReady)continue a;a.isClosed=true;a.executeCallback()}}}}var CompatVersion="";if(typeof VEAPI_DisableAtlasCompat=="undefined"||!VEAPI_DisableAtlasCompat)VEAPI_DisableAtlasCompat=navigator.userAgent.indexOf("KHTML")!==-1;function disable_text_selection(a){if(typeof a==="undefined")return;a.onselectstart=function(){return false};a.onmousedown=function(){return false};a.unselectable="on";a.style.MozUserSelect="none";a.style.cursor="default"}_VERegisterNamespaces("Web.Browser","Web.Debug.Performance");if(!Web.Debug.Enabled){Web.Debug.Enabled=false;Web.Debug.Assert=Web.Debug.Trace=function(){};Web.Debug.Performance.Start=function(){this.End=function(){};return this}}Web.Browser.isSafari=function(){return navigator.userAgent.indexOf("KHTML")!==-1};Web.Browser.GetWebKitVersion=function(){var b=NaN,a=/ AppleWebKit\/([^ ]+)/.exec(navigator.userAgent);if(a&&a.length==2)b=parseInt(a[1]);Web.Browser.GetWebKitVersion=function(){return b};return b};Web.Browser.isSafari2=function(){return Web.Browser.GetWebKitVersion()<500};Web.Browser.isSafari3=function(){return Web.Browser.GetWebKitVersion()>=500};Web.Browser.AttachSafariCompatibility=function(a){if(Web.Browser.isSafari2())try{document.getElementsByTagName("HTML")[0]}catch(s){}a.CollectGarbage=function(){};Web.Browser.Button={LEFT:0,RIGHT:2,MIDDLE:1};function i(a){window.event=a}function q(b,c,d){var a=c.slice(2);if(a!=="mouseenter"&&a!=="mouseleave")b.addEventListener(a,i,true);else{b.addEventListener("mouseover",i,true);b.addEventListener("mouseout",i,true)}b.addEventListener(a,d,false)}function p(d,b,c){var a=b.slice(2);if(b==="mousewheel")a="DOMMouseScroll";d.removeEventListener(a,c,false)}function j(a,b){if(a==="onclick")a="onmouseup";q(this,a,b)}function k(a,b){if(a==="onclick")a="onmouseup";p(this,a,b)}if(Web.Browser.isSafari2())if(typeof a["[[DOMDocument.prototype]]"]==="undefined"||typeof a["[[DOMElement.prototype]]"]==="undefined"){Object.prototype.attachEvent=j;Object.prototype.detachEvent=k}else{a.attachEvent=a["[[DOMDocument.prototype]]"].attachEvent=a["[[DOMElement.prototype]]"].attachEvent=j;a.detachEvent=a["[[DOMDocument.prototype]]"].detachEvent=a["[[DOMElement.prototype]]"].detachEvent=k}else if(Web.Browser.isSafari3()){a.attachEvent=a.HTMLDocument.prototype.attachEvent=a.HTMLElement.prototype.attachEvent=j;a.detachEvent=a.HTMLDocument.prototype.detachEvent=a.HTMLElement.prototype.detachEvent=k}var g=false;function c(a){if(g){a.preventDefault();a.returnValue=false;document.removeEventListener(a.type,c,true);a.capturedTarget=a.target;g.dispatchEvent(a);delete a.captureTarget;if(g)document.addEventListener(a.type,c,true);a.stopPropagation()}}function b(a){a.stopPropagation();a.preventDefault()}function o(){g=this;document.addEventListener("mousemove",c,true);document.addEventListener("mouseover",b,true);document.addEventListener("mouseout",b,true);document.addEventListener("mouseenter",b,true);document.addEventListener("mouseleave",b,true);document.addEventListener("mouseup",c,true)}function m(){g=null;document.removeEventListener("mousemove",c,true);document.removeEventListener("mouseover",b,true);document.removeEventListener("mouseout",b,true);document.removeEventListener("mouseenter",b,true);document.removeEventListener("mouseleave",b,true);document.removeEventListener("mouseup",c,true)}if(Web.Browser.isSafari2()){var n=0;function l(){if(typeof a["[[DOMElement.prototype]]"]==="undefined"){if(n<100){n++;setTimeout(l,100)}}else{a["[[DOMElement.prototype]]"].setCapture=o;a["[[DOMElement.prototype]]"].releaseCapture=m}}l()}else if(Web.Browser.isSafari3()){a.HTMLElement.prototype.setCapture=o;a.HTMLElement.prototype.releaseCapture=m}function h(){}function d(){}var f=null,e=null;if(Web.Browser.isSafari2()){h=function(e,c,b){var a=d(e,c,b);if(a.length>0)return a[0];else return null};d=function(g,e,d){var c=d.getElementsByTagName(e),b=[],a,f=c.length;for(a=0;a<f;a++)b.push(c[a]);return b};f=typeof a["[[DOMDocument.prototype]]"]!=="undefined"?a["[[DOMDocument.prototype]]"]:Object.prototype;e=typeof a["[[DOMElement.prototype]]"]!=="undefined"?a["[[DOMElement.prototype]]"]:Object.prototype}else if(Web.Browser.isSafari3()){h=function(e,a,c){a+="[1]";var b=d(e,a,c);if(b.length>0)return b[0];else return null};d=function(b,f,e){var d=b.evaluate(f,e,b.createNSResolver(b.documentElement),XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null),c=[],a,g=d.snapshotLength;for(a=0;a<g;a++)c.push(d.snapshotItem(a));return c};if(typeof document.implementation!=="undefined"&&typeof document.implementation.createDocument!=="undefined")f=document.implementation.createDocument("ns","root",null).constructor.prototype;if(typeof Element!=="undefined")e=Element.prototype}if(f){f.selectNodes=function(a){return d(this,a,this)};f.selectSingleNode=function(a){return h(this,a,this)}}if(e){e.selectNodes=function(b){var a=this.ownerDocument;if(a.selectNodes)return d(a,b,this);else return null};e.selectSingleNode=function(b){var a=this.ownerDocument;if(a.selectSingleNode)return h(a,b,this);else return null}}};if(Web.Browser.isSafari()){Web.Browser.AttachSafariCompatibility(window);if(Web.Browser.isSafari2())Msn.Drawing.SvgLayer=function(i,d){function g(b){var c="http://www.w3.org/1999/xhtml",a=document.createElementNS(c,"canvas");a.setAttribute("id",b);disable_text_selection(a);a.setAttribute("width",d.GetMapWidth());a.setAttribute("height",d.GetMapHeight());a.style.position="absolute";a.style.top="0px";a.style.left="0px";return a}var c=d,b=null,h=false,k=false,j=true;if(h===false){h=true;b=document.createElement("div");b.setAttribute("height","100%");b.setAttribute("width","100%");i.appendChild(b);this.lineDashStyles=[];var a=this.lineDashStyles;a[0]=["Solid","none"];a[1]=["ShortDash","6,2"];a[2]=["ShortDot","2,2"];a[3]=["ShortDashDot","6,2,2,2"];a[4]=["ShortDashDotDot","6,2,2,2,2,2"];a[5]=["Dot","2,6"];a[6]=["Dash","10,6"];a[7]=["LongDash","20,6"];a[8]=["DashDot","10,6,2,6"];a[9]=["LongDashDot","20,6,2,6"];a[10]=["LongDashDotDot","20,6,2,6,2,6"]}this.addShape=function(d){if(b===null)return;var j=null;if(d.type===MC_GEO_TYPE_POINT){j=g(d.id!==0?d.id:d.iid);b.appendChild(j);var a=j.getContext("2d"),n=k.x-6,o=k.y-6,m=12,k=12;a.fillStyle=d.symbol.fill_color;a.strokeStyle=d.symbol.stroke_color;a.lineWidth=d.symbol.stroke_weight;a.beginPath();a.rect(n,o,m,k);a.closePath();a.fill();a.stroke()}else if(d.type===MC_GEO_TYPE_POLYLINE||d.type===MC_GEO_TYPE_POLYGON){j=g(d.id!==0?d.id:d.iid);b.appendChild(j);var a=j.getContext("2d");if(d.type===MC_GEO_TYPE_POLYGON)a.fillStyle=f(d.symbol.fill_color,e(d.symbol.fill_opacity));else a.fillStyle="";a.strokeStyle=f(d.symbol.stroke_color,e(d.symbol.stroke_opacity));a.lineWidth=parseInt(d.symbol.stroke_weight);var i=GetSvgPath(c,d.points).split(/[\s,]+/),h,l=i.length;if(d.type===MC_GEO_TYPE_POLYGON){a.beginPath();a.moveTo(Number(i[0]),Number(i[1]));for(h=2;h<l;h+=2)a.lineTo(Number(i[h]),Number(i[h+1]));a.closePath();a.fill()}a.beginPath();a.moveTo(Number(i[0]),Number(i[1]));for(h=2;h<l;h+=2)a.lineTo(Number(i[h]),Number(i[h+1]));a.stroke()}return j};this.SetZIndex=function(a){if(!c.bShowSVG)return;c.GetsvgDiv().style.zIndex=a};this.UpdatePoints=function(a){if(a.type==VEShapeType.Polyline||a.type==VEShapeType.Polygon){var b=$ID(a.id!==0?a.id:a.iid);if(b.parentNode)b.parentNode.removeChild(b);this.addShape(a)}return a};this.UpdateStyle=this.UpdatePoints;function f(b,c){if(b.length==7&&c){var a=[];a.push("rgba(");a.push(parseInt(b.substring(1,3),16));a.push(",");a.push(parseInt(b.substring(3,5),16));a.push(",");a.push(parseInt(b.substring(5,7),16));a.push(",");a.push(c);a.push(")");return a.join("")}else return b}function e(a){a+="";if(a.indexOf("%")>1){a=parseInt(a);if(a===NaN)a=.3;else a/=100}return a}}}var windowWidth=0,windowHeight=0,scrollbarWidth=null;function $ID(a){var b=document;return b.getElementById(a)}function $CE(a){var b=document;return b.createElement(a)}function $CENS(a){var b=document;return b.createElementNS(a)}function GetWindowWidth(){var a=0;if(typeof window.innerWidth=="number")a=window.innerWidth;else if(document.documentElement&&document.documentElement.clientWidth)a=document.documentElement.clientWidth;else if(document.body&&document.body.clientWidth)a=document.body.clientWidth;if(!a||a<100)a=100;return a}function GetWindowHeight(){var a=0;if(typeof window.innerHeight=="number")a=window.innerHeight;else if(document.documentElement&&document.documentElement.clientHeight)a=document.documentElement.clientHeight;else if(document.body&&document.body.clientHeight)a=document.body.clientHeight;if(!a||a<100)a=100;return a}function GetScrollbarWidth(){if(scrollbarWidth)return scrollbarWidth;if(navigator.userAgent.indexOf("IE")>=0){var a=document.createElement("div"),b=null;a.style.visible="hidden";a.style.overflowY="scroll";a.style.position="absolute";a.style.width=0;document.body.insertAdjacentElement("afterBegin",a);b=a.offsetWidth;a.parentNode.removeChild(a);if(!b)b=16;scrollbarWidth=b;return b}else return 0}function GetUrlPrefix(){var a=window.location.pathname.lastIndexOf("/"),b=window.location.protocol+"//"+window.location.hostname+window.location.pathname.substring(0,a+1);return b}function GetUrlParameterString(){var a=window.location.search;if(a.length==0||a.indexOf("?")==-1)return "";return a.substr(a.indexOf("?")+1)}function CheckWipExistence(){var a=GetUrlParameterString();if(a!=""&&a.indexOf("wip=")>-1)return true;return false}function GetUrlParameters(){var b=[],d=GetUrlParameterString();if(!d)return b;var e=d.split("&");for(var c=0;c<e.length;c++){var a=e[c].split("=");if(a.length==2&&a[0]&&a[1]){b.push(unescape(a[0]));b.push(unescape(a[1]))}}return b}function ParseShiftKeyForLinks(a){if(a.shiftKey)return false;return true}_VERegisterNamespaces("Msn.VE.API.Globals");_VERegisterNamespaces("Msn.VE.API.Constants");Msn.VE.API.Globals.vemapinstances=null;Msn.VE.API.Globals.veonbegininvokeevent=null;Msn.VE.API.Globals.veonendinvokeevent=null;Msn.VE.API.Globals.vefindresultsnpanel=null;Msn.VE.API.Globals.language="en";Msn.VE.API.Globals.locale="en-in";Msn.VE.API.Globals.resourcelocale="en-in";Msn.VE.API.Globals.vecurrentversion="6.2.2008082210001.41";Msn.VE.API.Globals.ishttpsenabled=false;Msn.VE.API.Globals.protocol=Msn.VE.API.Globals.ishttpsenabled?"https://":"http://";Msn.VE.API.Globals.vecurrentdomain="http://dev.mapindia.live.com/mapcontrol/v6.2";Msn.VE.API.Globals.veanalyticsenabled="__analyticsenabled__";Msn.VE.API.Globals.veomnitureaccount="__omnitureaccount__";Msn.VE.API.Globals.vedebug=false;Msn.VE.API.Globals.analyticsInitialized=false;var VE_MapDispatch_SymbolLib=null;Msn.VE.API.Constants.orthotileserver="http://r%2.ortho.tiles.mapindia.live.net/tiles/%3%4.%5?g=%6&mkt={21}".replace(/%0/g,Msn.VE.API.Globals.protocol);Msn.VE.API.Constants.obliquetileserver="%0t%3.tiles.virtualearth.net/tiles/o%4-%5-%6-%7.jpeg?g=%8".replace(/%0/g,Msn.VE.API.Globals.protocol);Msn.VE.API.Constants.obliquehybridtileserver="%0t%3.tiles.virtualearth.net/tiles/cmd/ObliqueHybrid?a=%4-%5-%6-%7&g=%8".replace(/%0/g,Msn.VE.API.Globals.protocol);Msn.VE.API.Constants.obliquethumbnailtileserver="%0t%1.tiles.virtualearth.net/tiles/ot%2.jpeg?g=%3".replace(/%0/g,Msn.VE.API.Globals.protocol);Msn.VE.API.Constants.shadedtileserver="http://r%2.ortho.tiles.mapindia.live.net/tiles/%3%4.%5?g=%6&mkt={21}".replace(/%0/g,Msn.VE.API.Globals.protocol);Msn.VE.API.Constants.traffictileserver="%0t%2.tiles.virtualearth.net/tiles/t%4".replace(/%0/g,Msn.VE.API.Globals.protocol);Msn.VE.API.Constants.imageryurl="%0dev.virtualearth.net/services/v1/ImageryMetadataService/ImageryMetadataService.asmx".replace(/%0/g,Msn.VE.API.Globals.protocol);Msn.VE.API.Constants.collectionservice="%0maps.live.com/GeoCommunity.aspx".replace(/%0/g,Msn.VE.API.Globals.protocol);Msn.VE.API.Constants.searchservice="%0dev.mapindia.live.com/ChinaLegacyService/ChinaSearchProxy.ashx".replace(/%0/g,Msn.VE.API.Globals.protocol);Msn.VE.API.Constants.legacyrouteservice="%0dev.virtualearth.net/legacyService/directions.ashx".replace(/%0/g,Msn.VE.API.Globals.protocol);Msn.VE.API.Constants.routeservice="%0dev.mapindia.live.com/platformservices/v1/RouteService/RouteService.asmx".replace(/%0/g,Msn.VE.API.Globals.protocol);Msn.VE.API.Constants.obliquecalcservice="%0dev.virtualearth.net/legacyService/ElevatedLoc.ashx".replace(/%0/g,Msn.VE.API.Globals.protocol);Msn.VE.API.Constants.geocodingservice="%0dev.mapindia.live.com/platformservices/v1/geocodeservice/geocodeservice.asmx".replace(/%0/g,Msn.VE.API.Globals.protocol);Msn.VE.API.Constants.iconurl=Msn.VE.API.Globals.vecurrentdomain+"/i/bin/"+Msn.VE.API.Globals.vecurrentversion+"/pins/poi_usergenerated.gif";Msn.VE.API.Constants.clustericonurl=Msn.VE.API.Globals.vecurrentdomain+"/i/bin/"+Msn.VE.API.Globals.vecurrentversion+"/pins/poi_stack.gif";Msn.VE.API.Constants.atlascompatjs=Msn.VE.API.Globals.vecurrentdomain+"/js/atlascompat.js";Msn.VE.API.Constants.stylesheet=Msn.VE.API.Globals.vecurrentdomain+"/css/bin/"+Msn.VE.API.Globals.vecurrentversion+"/"+Msn.VE.API.Globals.language+"/mapcontrol.css";Msn.VE.API.Constants.stylesheetiev6=Msn.VE.API.Globals.vecurrentdomain+"/css/bin/"+Msn.VE.API.Globals.vecurrentversion+"/"+Msn.VE.API.Globals.language+"/mapcontroliev6.css";Msn.VE.API.Constants.vedirectionsstarticon=Msn.VE.API.Globals.vecurrentdomain+"/i/bin/"+Msn.VE.API.Globals.vecurrentversion+"/pins/mapicon_start.gif";Msn.VE.API.Constants.vedirectionsendicon=Msn.VE.API.Globals.vecurrentdomain+"/i/bin/"+Msn.VE.API.Globals.vecurrentversion+"/pins/mapicon_end.gif";Msn.VE.API.Constants.vedirectionsstepicon=Msn.VE.API.Globals.vecurrentdomain+"/i/bin/"+Msn.VE.API.Globals.vecurrentversion+"/pins/RedCircle%1.gif";Msn.VE.API.Constants.trafficiconurl=Msn.VE.API.Globals.vecurrentdomain+"/i/bin/"+Msn.VE.API.Globals.vecurrentversion+"/Traffic/Traffic%1.gif";Msn.VE.API.Constants.spacerurl=Msn.VE.API.Globals.vecurrentdomain+"/i/bin/"+Msn.VE.API.Globals.vecurrentversion+"/spacer.gif";Msn.VE.API.Constants.mapguid="mapguid";Msn.VE.API.Constants.rim="rim";Msn.VE.API.Constants.rimargs="rimargs";Msn.VE.API.Constants.contextid="contextid";Msn.VE.API.Constants.clienttoken="token";Msn.VE.API.Constants.market="mkt";Msn.VE.API.Constants.culture="culture";Msn.VE.API.Constants.format="format";Msn.VE.API.Constants.json="json";Msn.VE.API.Constants.requestid="rid";Msn.VE.API.Constants.maximportedshapes="maxitems";Msn.VE.API.Globals.vemapmode=Msn.VE.MapActionMode.Mode2D;Msn.VE.API.Globals.vemapheight=400;Msn.VE.API.Globals.vemapwidth=600;Msn.VE.API.Globals.vemapzoom=4;Msn.VE.API.Globals.vemaplatitude="24.12";Msn.VE.API.Globals.vemaplongitude="79.71";Msn.VE.API.Globals.vemapstyle="r";Msn.VE.API.Globals.vemaxzoom="17";Msn.VE.API.Globals.veminzoom="1";Msn.VE.API.Globals.vetilesize=256;Msn.VE.API.Globals.vepushpinpanelzIndex=999;Msn.VE.API.Globals.veshapeiconzindex=1000;Msn.VE.API.Globals.veshapepolyshapezindex=50;Msn.VE.API.Globals.vetilelayerdefaultzindex=2;Msn.VE.API.Globals.vemessagepanelheight=75;Msn.VE.API.Globals.vemessagepanelzIndex=99;Msn.VE.API.Globals.veplacelistpanelheight=200;Msn.VE.API.Globals.veplacelistpanelwidth=350;Msn.VE.API.Globals.veplacelistpanelzIndex=300;Msn.VE.API.Globals.vefindresultsnpanelwidth=200;Msn.VE.API.Globals.vefindresultsnpanelzIndex=99;Msn.VE.API.Globals.vefindresultsnpanelcolor="blue";Msn.VE.API.Globals.veiscommercialcontrol=false;Msn.VE.API.Globals.veobliqueMode=null;Msn.VE.API.Constants.maxasynlatlongs=50;Msn.VE.API.Globals.vefindnumresultsdefault=10;Msn.VE.API.Globals.vefindnumresultsmin=1;Msn.VE.API.Globals.vefindnumresultsmax=20;Msn.VE.API.Globals.vedefaultmaximportedshapes=200;Msn.VE.API.Globals.Dispose=function(){Msn.VE.API.Globals.veonbegininvokeevent=null;Msn.VE.API.Globals.veonendinvokeevent=null;Msn.VE.API.Globals.vefindresultsnpanel=null};Msn.VE.API.Globals.PosX=function(a){var b=0;if(!a)var a=window.event;if(a.pageX)b=a.pageX;else if(a.clientX)b=a.clientX+document.body.scrollLeft;return b};Msn.VE.API.Globals.PosY=function(a){var b=0;if(!a)var a=window.event;if(a.pageY)b=a.pageY;else if(a.clientY)b=a.clientY+document.body.scrollTop;return b};function VE_Help(){}_VERegisterNamespaces("Msn.VE.Constants.Css");var MSVE_header=document.getElementsByTagName("body")[0],VE_ContextMenu=null;s_account=Msn.VE.API.Globals.veomnitureaccount;var Gimme={};(function(){var b=new function(){var e={},n=new function(){this.val=-2;this.t=0;this.f=0;this.inc=function(){this.val+=2;this.t=this.val+1;this.f=this.val}};this.query=p;this.processSelector=f;this.nthCacheContains=h;function p(a,b){if(!a)return [];if(a instanceof Array)return a;if(typeof a!=="string")return [a];e={};n.inc();return o(d.parseSelector(a),b)}function o(q,c){var b=q.selectors,j=q.hints,h=j.anchor;c=c||document.documentElement;if(h.elem===null)return [];if(j.isPartialQuery){b.unshift(d.createReferenceSelector(c));c=c.parentNode}else if(h.elem!==-1&&b.length>1)c=h.elem;if(j.initialCollection!==null)elems=i(j.initialCollection,b[b.length-1]);else elems=l(b[b.length-1],c);if(b.length===1)return elems;if(b.length===3)if(h.isIdeal)return elems;var s=0,k,g,t=elems.length,r=a.combinator,m,p,f,e,n=null,o=[];a:for(k=0;k<t;k++){g=b.length-2;e=b[g];f=p=elems[k];while(e){m=b[g-1];if(!r[e](m,f))if(f.parentNode&&n===" "&&e!==" "){f=f.parentNode;continue}else continue a;f=m.cursor;g-=2;n=e;e=g<1?null:b[g]}o[s++]=p}return o}function f(d,b){if(!b)return false;if(d.refersTo)return d.refersTo===b;var c=d.inProps,n=c.id,m=c.tag,j=c.classes,i=c.attributes,l=c.pseudos,g=a.inRules,f=a.exRules;if(n&&b.id!==n||m&&b.tagName!==m||j.length>0&&!g["."].processFn(b,j)||i.length>0&&!g["["].processFn(b,i)||l.length>0&&!g[":"].processFn(b,l))return false;var h,e,k=d.exProps;for(h in f){e=f[h].name;if(k[e]&&!f[h].processFn(b,k[e]))return false}return true}function l(g,f){f=f||document.documentElement;var k=0,d,i,c,a=g.inProps,l=g.exProps;if(a.id){c=[$ID(a.id)];delete a.id}else{var e=a.pseudos[a.pseudos.length-1];if(e&&e.name==="nth-child"){c=j(e.param.a,e.param.b,a.tag);a.pseudos=a.pseudos.splice(a.pseudos.length,1)}else c=f.getElementsByTagName(a.tag||"*");if(l.isEmpty&&a.classes.length<1&&a.attributes.length<1&&a.pseudos.length<1)return m(c);delete a.tag}var h=[];i=c.length;for(d=0;d<i;d++)if(b.processSelector(g,c[d]))h[k++]=c[d];return h}function i(d,g){var c=[],e=0,h=d.length,a,b;for(b=0;b<h;b++){a=d[b];if(a.nodeType!==1)continue;if(f(g,a))c[e++]=a}return c}function m(b){var c=[],d=0,e=b.length,a;for(a=0;a<e;a++)c[d++]=b[a];return c}function j(a,b,c){return e[a+"n+"+b]=g(a,b,c,true)}function k(a,b){return e[a+"n+"+b]=g(a,b,null,false)}function g(j,n,b,h){if(b==="*")b=null;var k=document.getElementsByTagName("*"),m=k.length,i={},l=0,e,a,f,g,d=h?[]:{};for(f=0;f<m;f++){a=k[f];e=c(a.parentNode);i[e]=i[e]||0;g=(l=++i[e])-n;if(j===0&&(b&&a.tagName!==b?false:true)){if(g===0){if(h)d.push(a);d[c(a)]=true}}else if(j*g>=0&&g%j===0&&(b&&a.tagName!==b?false:true)){if(h)d.push(a);d[c(a)]=true}}return d}function h(c,d,f){var b=c+"n+"+d,a=e[b];if(!a)a=e[b]=k(c,d);return a[f]===true}},d=new function(){var d=null,f=null,c="";this.setRules=function(b){d=b;var a;for(a in d.combinator)if(d.combinator.hasOwnProperty(a))c+=a;f=new RegExp("\\s*(["+c+"])\\s*","g")};this.parseSelector=function(l){l=e(l).replace(f,"$1");var i=null,k=[],n=new b,m={anchor:new g,isPartialQuery:false,initialCollection:null},h=m.anchor,p=h,s,t,v,q,r,u,d,j=0,o="",w=l.length;while(j<w){d=l.charAt(j);i=i||a.inRules[d]||a.exRules[d];if(i){u=i.endsWith+(i.stopForCombinators===false?"":c);t=i.startSkip||0;v=i.endSkip||0;q=i.startModifier||null;r=i.endModifier||null;d=l.charAt(j+=t);while(u.indexOf(d)===-1){if(d===q)while(d&&d!==r){o+=d;d=l.charAt(++j)}o+=d;d=l.charAt(++j)}if((s=n.addPart(o,i))!==-1){p=h;h=new g(k.length,s)}j+=v;o="";i=null;continue}else if(c.indexOf(d)!==-1){d==="+"||d==="~"?(h=p):(p=h);if(!(m.isPartialQuery=j===0)){k.push(n);n=new b}k.push(d);m.initialCollection=d===">"&&h.elem&&h.elem!==-1&&h.index===k.length-2?h.elem.childNodes:null}else{i=a.inRules["tag"];continue}j++}k.push(n);h.isIdeal=h.elem!==-1&&k.length-3===h.index;m.anchor=h;return {selectors:k,hints:m}};this.parseAttribute=function(c){var d=/\=|\^=|\$=|\*=|\|=|~=|!=/,a=c.match(d);a=a&&a[0];var b=c.split(a),f=b[0]&&e(b[0].replace(/[\[\]"]/g,"")),g=b[1]&&e(b[1].replace(/[\[\]"]/g,""));return {name:f,delim:a,val:g}};this.parsePseudo=function(f){var d=/(.*)\((.*)\)/,b=f.match(d),g=b&&b[1]||f,a=b&&b[2],c,h,e;if(g==="nth-child")if(a==="even")a={wholeValue:a,a:2,b:0};else if(a==="odd")a={wholeValue:a,a:2,b:1};else{d=/([+-]?\d+)?(n)?([+-]?\d+)?/;b=a.match(d);c=parseInt(b[1])||1;e=b[2]?1:0;h=c&&!e?c:parseInt(b[3])||0;a={wholeValue:a,a:c*e,b:h}}return {name:g,param:a}};this.createReferenceSelector=function(a){return new b(a)};function b(e){this.cursor=null;this.refersTo=e;this.inProps={id:null,tag:null,classes:[],attributes:[],pseudos:[]};this.exProps={isEmpty:true};var d,b,c=a.exRules;for(d in c)if(c.hasOwnProperty(d)){delete this.exProps.isEmpty;b=c[d];switch(b.objType){case "array":this.exProps[b.name]=[];break;case "null":default:this.exProps[b.name]=null}}}b.prototype.addPart=function(a,c){var b=c.name,f=c.preFn,e=c.hintFn,g=-1;if(typeof f==="function")a=f(a);var d=typeof this.inProps[b]!=="undefined"?this.inProps:this.exProps;d[b]instanceof Array?d[b].push(a):(d[b]=a);if(typeof e==="function")g=e(a);return g};function g(b,a,c){this.index=b===0?0:b||NaN;this.elem=a===null?null:a||-1;this.isIdeal=c||false}},a={inRules:{"tag":{name:"tag",endsWith:"#.[:",preFn:function(a){return a.toUpperCase()},hintFn:function(a){return a==="BODY"||a==="HTML"?document.getElementsByTagName(a)[0]:-1},processFn:function(a,b){return a.tagName===b}},"#":{name:"id",endsWith:"#.[:",startSkip:1,preFn:null,hintFn:function(a){return $ID(a)},processFn:function(a,b){return a.id===b}},".":{name:"classes",endsWith:".[:",startSkip:1,objType:"array",processFn:function(d,c){var a=d.className;if(typeof a!=="string")a=d.getAttribute("class");if(!a||a.length<1)return false;var e=" "+a+" ",b,f=c.length;for(b=0;b<f;b++)if(e.indexOf(" "+c[b]+" ")===-1)return false;return true}},"[":{name:"attributes",endsWith:"]",stopForCombinators:false,startSkip:1,endSkip:1,startModifier:'"',endModifier:'"',objType:"array",preFn:d.parseAttribute,processFn:function(j,g){var c,k=g.length,b,h,i,e,d;for(c=0;c<k;c++){b=g[c];h=b.name;i=b.val;e=b.delim;d=f(j,h);if(d===null)return false;else if(!e)continue;else if(!a.attr[e||"unknown"](d,i))return false}return true}},":":{name:"pseudos",endsWith:"#.[:)",startSkip:1,startModifier:"(",endModifier:")",objType:"array",preFn:d.parsePseudo,processFn:function(f,d){var c,e,g=d.length,b;for(b=0;b<g;b++){c=d[b];e=a.pseudo[c.name]||a.pseudo.unknown;if(!e(f,c))return false}return true}}},exRules:{},attr:{"=":function(a,b){return a===b},"^=":function(a,b){return a.indexOf(b)===0},"$=":function(a,b){var c=a.lastIndexOf(b);return c!==-1&&c+b.length===a.length},"*=":function(a,b){return a.indexOf(b)!==-1},"|=":function(a,b){return a===b||a.indexOf(b+"-")===0},"~=":function(a,b){return a===b||h(a.split(" "),b)},"!=":function(a,b){return a!==b},"unknown":function(){return false}},pseudo:{"first-child":j("previous"),"last-child":j("next"),"only-child":function(b){return a.pseudo["first-child"](b)&&a.pseudo["last-child"](b)},"nth-child":function(d,a){var e=a.param.a,f=a.param.b;return b.nthCacheContains(e,f,c(d))},"contains":function(b,a){return b.innerHTML.indexOf(a.param)!==-1},"unknown":function(){return false}},combinator:{" ":function(c,d){var a=d.parentNode;while(a&&a!==document){if(b.processSelector(c,a)){c.cursor=a;return true}a=a.parentNode}return false},">":function(a,d){var c=d.parentNode;a.cursor=c;return b.processSelector(a,c)},"<":function(d,e){var c=e.childNodes,a,f=c.length;for(a=0;a<f;a++)if(b.processSelector(d,c[a]))return true;return false},"~":function(c,d){var a=d.previousSibling;while(a)if(a.nodeType===1&&b.processSelector(c,a)){c.cursor=a;return true}else a=a.previousSibling;return false},"+":function(c,d){var a=d.previousSibling;while(a&&a.nodeType!==1)a=a.previousSibling;c.cursor=a;return b.processSelector(c,a)},",":function(){return false}}};Gimme.Selectors={addRule:function(b,c){a.exRules[b]=c},addPseudo:function(b,c){a.pseudo[b]=c},addAttribute:function(b,c){a.attr[b]=c},addCombinator:function(b,c){a.combinator[b]=c}};d.setRules(a);Gimme.query=b.query;Gimme.id=function(a){return $ID(a)};var g=navigator.userAgent.toLowerCase();Gimme.Browser={isIE:typeof ActiveXObject!=="undefined",isOpera:typeof window.opera!=="undefined",isKHTML:g.indexOf("khtml")!==-1,isGecko:g.indexOf("khtml")===-1&&g.indexOf("gecko")!==-1,isInIFrame:function(){try{return window.frameElement&&window.frameElement.tagName==="IFRAME"}catch(a){return true}}(),isInFrameset:window!=top,isInQuirksMode:document.compatMode==="BackCompat",offsetIncludesBorders:function(){if(typeof this.value==="undefined"){var a=document.createElement("div");a.setAttribute("style","position:absolute;visibility:hidden;top:0;left:0;border:1px solid #000;");var b=document.createElement("div");a.appendChild(b);document.body.appendChild(a);this.value=offsetIncludesBorders=b.offsetTop===1;document.body.removeChild(a);a=b=null}return this.value}};var o={guid:"_$gimme$_guid",descendant:"_$gimme$_descendant"},l=0;function c(a){if(a===window)return "theWindow";else if(a===document)return "theDocument";else if(typeof a.uniqueID!=="undefined")return a.uniqueID;var b=o.guid;if(typeof a[b]==="undefined")a[b]=b+l++;return a[b]}var i=function(){return typeof Array.prototype.indexOf!=="undefined"?b:a;function b(b,a){return b.indexOf(a)}function a(b,c){var a,d=b.length;for(a=0;a<d;a++)if(b[a]===c)return a;return -1}}();function h(b,a){return i(b,a)!==-1}function e(a){return a.replace(/^\s+|\s+$/g,"")}function n(a){return e(a).replace(/\s{2,}/g," ")}var f=function(){return Gimme.Browser.isIE?b:a;function a(b,a){return b.getAttribute(a)}function b(a,b){switch(b.toLowerCase()){case "class":return a.className||null;case "id":return a.id||null;case "href":case "src":if(typeof a.getAttribute!=="undefined")return a.getAttribute(b,2)}return a.attributes&&a.attributes[b]?a.attributes[b].nodeValue:a.getAttribute(b)}}(),m=function(){return typeof document.createElement("div").hasAttribute!=="undefined"?a:b;function a(b,a){return b.hasAttribute(a)}function b(b,a){return !!f(b,a)}}();function j(b){var a=b+"Sibling";return function(c){var b=c[a];while(b&&b.nodeType!==1)b=b[a];return !b}}function k(c,b){if(!c)return 0;if(/px$/.test(c))return parseInt(c,10);if(!b)b=document.body;var a=document.createElement("div");a.style.visbility="hidden";a.style.position="absolute";a.style.lineHeight="0";if(/%$/.test(c)||b.tagName==="IMG"){b=b.parentNode||b;a.style.height=c}else{a.style.borderStyle="solid";a.style.borderBottomWidth="0";a.style.borderTopWidth=c}b.appendChild(a);var d=a.offsetHeight;b.removeChild(a);return d||0}Gimme.Helper={getObjectGUID:c,indexOf:i,contains:h,trim:e,normalize:n,hasClass:a.inRules["."].processFn,readAttribute:f,attrExists:m,convertToPixels:k}})();function g(a){return new Gimme.object(Gimme.query(a))}Gimme.object=function(a){this.entities=a;this.length=this.entities.length};Gimme.ext=Gimme.object.prototype;(function(){var a=Gimme.Helper,i=a.contains,k=a.indexOf,n=a.trim,h=a.normalize,d=a.hasClass,m=a.attrExists,j=a.readAttribute,b=a.getObjectGUID,l=a.convertToPixels;Gimme.ext.element=function(a){return this.entities[a||0]};Gimme.ext.parent=function(a){return this.entities[a||0].parentNode};Gimme.ext.addClass=function(b){var a=b.split(/\s+/);this.forEach(function(b){g(a).forEach(function(a){if(!d(b,[a]))if(b.className==="")b.className=a;else b.className+=" "+a})});return this};Gimme.ext.removeClass=function(a){return this.swapClass(a,"$1")};Gimme.ext.swapClass=function(b,a){if(a!=="$1")a=" "+a+" ";var c=b.split(/\s+/);this.forEach(function(d){var b=d.className;g(c).forEach(function(c){var d=new RegExp("(^| )"+c+"( |$)");b=b.replace(d,a)});d.className=h(b)});return this};Gimme.ext.hasClass=function(a,b){return d(this.entities[b||0],[a])};Gimme.ext.getAncestor=function(b,d){var a=this.entities[d||0],c=b;while(c-->0)if(a)a=a.parentNode;else break;return a};Gimme.ext.getSibling=function(b,g){var c=this.entities[g||0];if(b===0)return c;var e=b>0?"nextSibling":"previousSibling",a=c,f=Math.abs(b),d=0;while(d<f){a=a[e];if(!a)break;if(a.nodeType===1)d++}return a};Gimme.ext.select=function(a){return new Gimme.object(Gimme.query(a,this.entities[0]))};Gimme.ext.setHTML=function(a){this.forEach(function(b){b.innerHTML=a});return this};Gimme.ext.getHTML=function(a){return this.entities[a||0].innerHTML};Gimme.ext.setValue=function(a){this.forEach(function(b){if(typeof b.value!=="undefined")b.value=a});return this};Gimme.ext.getValue=function(a){return this.entities[a||0].value||""};Gimme.ext.readAttribute=function(a,b){return j(this.entities[b||0],a)};Gimme.ext.writeAttribute=function(a,b){this.forEach(function(c){c.setAttribute(a,b)});return this};Gimme.ext.filter=function(d){var b=this.entities,a=0,c=b.length;while(a<c)if(!d(b[a])){b.splice(a,1);c--}else a++;return this};Gimme.ext.iterate=function(b){var c=this.entities,a,e=c.length;for(a=0;a<e;a++){var d=g(c[a]);b.call(d,a)}b=null;return this};Gimme.ext.getStyle=function(c,p,i){var b=this.entities[p||0];if(c==="opacity"){var h=e(b);if(isNaN(h))c=h;else return h}if(i!==false)i=true;var d="";if(typeof document.defaultView!=="undefined"&&typeof document.defaultView.getComputedStyle!=="undefined")d=document.defaultView.getComputedStyle(b,null);else if(typeof b.currentStyle!=="undefined"){d=b.currentStyle;var k=d[c];if(k==="auto"){if(c==="height"){var f=parseInt(g(b).getStyle("paddingTop"))+parseInt(g(b).getStyle("paddingBottom"));if(b.clientHeight)return b.clientHeight-f+"px";else return b.offsetHeight-f-parseInt(g(b).getStyle("borderTopWidth"))-parseInt(g(b).getStyle("borderBottomWidth"))+"px"}if(c==="width"){var f=parseInt(g(b).getStyle("paddingLeft"))+parseInt(g(b).getStyle("paddingRight"));if(b.clientWidth)return b.clientWidth-f+"px";else return b.offsetWidth-f-parseInt(g(b).getStyle("borderLeftWIdth"))-parseInt(g(b).getStyle("borderRightWidth"))+"px"}if(c==="top")return b.offsetTop+"px";else if(c==="left")return b.offsetLeft+"px";else if(i&&(c==="right"||c==="bottom")){var j={bottom:["top","Height"],right:["left","Width"]},n=parseInt(this.getComputedStyle(b,j[c][0],false),10);return b.parentNode["client"+j[c][1]]-b["offset"+j[c][1]]-n+"px"}else return "0px"}var o=/(em|ex|%|in|cm|mm|pt|pc|small|medium|large|thin|thick)$/,m=/border(.*)Width/i,l=m.test(c)?c.replace(m,"border$1Style"):null;if(o.test(k))if(l!==null&&d[l]==="none")return "0px";else return a.convertToPixels(k,b)}return d&&d[c]};Gimme.ext.setStyle=function(a,b){return g(this.entities).setStyles(a,b)};Gimme.ext.setStyles=function(){var b,c,d=arguments,e=d.length,a;if(e%2!==0)return;this.forEach(function(g){for(a=0;a<e;a+=2){b=d[a];c=d[a+1];if(b==="opacity")f(g,c);else g.style[b]=c}});return this};Gimme.ext.addEvent=function(){if(typeof document.addEventListener!=="undefined")return a;else if(typeof document.attachEvent!=="undefined")return d;else return function(){};function a(b,d,a,e){var c=this["on"+b];if(typeof c==="function"&&e!==false)c.call(this,d,a,true);else this.forEach(function(c){c.addEventListener(b,d,a)});return this}function d(a,d,g,f){var e=this["on"+a];if(typeof e==="function"&&f!==false)e.call(this,d,g,true);else this.forEach(function(f){var g="{"+b(f)+"/"+a+"/"+b(d)+"}",e=c[g];if(typeof e!=="undefined")return;e=function(b){b.target=b.srcElement;if(a=="mouseover")b.relatedTarget=b.fromElement;else if(a=="mouseout")b.relatedTarget=b.toElement;b.preventDefault=function(){b.returnValue=false};b.stopPropagation=function(){b.cancelBubble=true};d.call(f,b);b.target=null;b.relatedTarget=null;b.preventDefault=null;b.stopPropagation=null;b=null};c[g]=e;f.attachEvent("on"+a,e);g=null;e=null});return this}}();Gimme.ext.removeEvent=function(){if(typeof document.removeEventListener!=="undefined")return a;else if(typeof document.detachEvent!=="undefined")return d;else return function(){};function a(b,d,a,e){var c=this["on"+b];if(typeof c==="function"&&e!==false)c.call(this,d,a,false);else this.forEach(function(c){c.removeEventListener(b,d,a)});return this}function d(a,e,g,f){var d=this["on"+a];if(typeof d==="function"&&f!==false)d.call(this,e,g,false);else this.forEach(function(g){var d="{"+b(g)+"/"+a+"/"+b(e)+"}",f=c[d];if(typeof f!=="undefined"){g.detachEvent("on"+a,f);delete c[d]}d=null;f=null});return this}}();Gimme.ext.forEach=function(){return typeof Array.prototype.forEach!=="undefined"?b:a;function b(b,a){this.entities.forEach(b,a);return this}function a(e,d){var b=this.entities,a,c,f=b.length;for(a=0;a<f;a++){c=b[a];e.call(d,c,a,b)}return this}}();Gimme.ext.map=function(){return typeof Array.prototype.map!=="undefined"?b:a;function b(b,a){return this.entities.map(b,a)}function a(c,b){var a=[];this.forEach(function(d){a.push(c.call(b,d))});return a}}();Gimme.ext.contains=function(a){return i(this.entities,a)};Gimme.ext.indexOf=function(a){return k(this.entities,a)};var c={},f=function(){function c(a,b){a.style.opacity=b}function d(a,b){a.style.filter="alpha(opacity="+b*100+")"}var a,b=document.createElement("div");if(typeof b.style.opacity!=="undefined")a=c;else if(typeof b.style.filter!=="undefined")a=d;else a=function(){};b=null;return a}(),e=function(){function c(a){return parseFloat(a.style.opacity)||"opacity"}function d(c){var b=c.currentStyle.filter,a=b.match(/pacity\s*=\s*(\d{1,3}.?\d*)\)/);if(!a)return 1;else return parseFloat(a[1])/100}var a,b=document.createElement("div");if(typeof b.style.opacity!=="undefined")a=c;else if(typeof b.style.filter!=="undefined")a=d;else a=function(){};b=null;return a}()})();Gimme.Screen=new function(){this.getViewportSize=function(){var a={width:0,height:0};if(typeof window.innerWidth!=="undefined")a={width:window.innerWidth,height:window.innerHeight};else if(typeof document.documentElement!=="undefined"&&typeof document.documentElement.clientWidth!=="undefined"&&document.documentElement.clientWidth!==0)a={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight};else a={width:document.getElementsByTagName("body")[0].clientWidth,height:document.getElementsByTagName("body")[0].clientHeight};return a};this.getMousePosition=function(a){if(!a)a=window.event;var b={x:0,y:0};if(typeof a.pageX!=="undefined"&&typeof a.x!=="undefined"){b.x=a.pageX;b.y=a.pageY}else{var c=this.getScrollPosition();b.x=a.clientX+c.x;b.y=a.clientY+c.y}return b};this.getScrollPosition=function(){var a={x:0,y:0};if(typeof window.pageYOffset!=="undefined"){a.x=window.pageXOffset;a.y=window.pageYOffset}else if(!Gimme.Browser.isInQuirksMode&&typeof document.documentElement.scrollTop!=="undefined"){a.x=document.documentElement.scrollLeft;a.y=document.documentElement.scrollTop}else if(typeof document.body.scrollTop!=="undefined"){a.x=document.body.scrollLeft;a.y=document.body.scrollTop}return a}};Gimme.ext.getPosition=function(e,j){var a=this.entities[j||0],f,b,i,h,c=0,d=0;if(!Gimme.Browser.isOpera&&typeof a.getBoundingClientRect!=="undefined"){h=!Gimme.Browser.isInIFrame&&Gimme.Browser.isInFrameset?0:2;i=a.getBoundingClientRect();c=i.left-h;d=i.top-h;if(!e){b=Gimme.Screen.getScrollPosition();c+=b.x;d+=b.y}else e=false}else while(a!==null){f=typeof a.scrollTop!=="undefined"&&a!==document.body&&a!==document.documentElement&&a.tagName!=="TEXTAREA"&&a.tagName!=="INPUT"?1:0;c+=a.offsetLeft-f*a.scrollLeft;d+=a.offsetTop-f*a.scrollTop;a=a.offsetParent;if(a&&!Gimme.Browser.offsetIncludesBorders()){c+=parseInt(g(a).getStyle("borderLeftWidth"))||0;d+=parseInt(g(a).getStyle("borderTopWidth"))||0}}if(e){b=Gimme.Screen.getScrollPosition();c-=b.x;d-=b.y}return {x:c,y:d}};Gimme.ext.getScreenPosition=function(a){return this.getPosition(true,a)};Gimme.ext.getPagePosition=function(a){return this.getPosition(false,a)};Gimme.ext.getComputedPosition=function(b){var a=this.entities[b||0];return {x:parseInt(g(a).getStyle("left"),10),y:parseInt(g(a).getStyle("top"),10)}};Gimme.Util=new function(){this.setTimeout=function(){return a(arguments,false)};this.setInterval=function(){return a(arguments,true)};function a(a,c){var e=a[0],b=a[1];function d(){e.apply(this,Array.prototype.slice.call(a,2));if(!c)e=null}if(c===true)return window.setInterval(d,b);else return window.setTimeout(d,b)}};Gimme.Animation=new function(){var a={},b=false;this.Speeds={snail:2000,turtle:1250,slowly:1250,rabbit:1000,greyhound:750,quickly:750,cheetah:500,lightning:250};this.Directions={vertically:1,horizontally:2,both:3};this.start=function(b,f,e){var c=setInterval(f,e),d=a[b];if(typeof d==="undefined")a[b]={iids:[c],callback:null};else d.iids.push(c)};this.end=function(){var c,e=arguments.length;for(c=0;c<e;c++){var d=arguments[c],b=a[d];if(typeof b!=="undefined"){g(b.iids).forEach(function(a){clearTimeout(a)});if(typeof b.callback==="function"){b.callback.call();b.callback=null}delete a[d]}}};this.isRunning=function(b){return typeof a[b]!=="undefined"};this.whenDone=function(c,b){var d=a[c];if(typeof d==="undefined")a[c]={iids:[],callback:b};else d.callback=b};this.startGroup=function(){b=true};this.endGroup=function(){b=false};this.isGrouping=function(){return b===true}};Gimme.Animation.BezierCurve=function(){this.points=[];this.args=arguments};Gimme.Animation.BezierCurve.prototype.initialize=function(){var d=this.args,h=d.length,g=d[h-1]||100,k=h-1,e,f,b,c,a;for(e=0;e<k;e++){a=d[e];c=i(a.length);b=a.length-1;for(f=0;f<=g;f++)this.points.push(j(f/g))}this.args=d=null;return g;function j(j){var d,h=0,i=0;for(d=0;d<=b;d++){var f=c[b]/(c[d]*c[b-d]),e=Math.pow(1-j,b-d),g=Math.pow(j,d);h+=f*a[d].x*e*g;i+=f*a[d].y*e*g}return {x:h,y:i}}function i(d){var a,c=1,b=[1];for(a=1;a<=d;a++){c*=a;b.push(c)}return b}};Gimme.Animation.BezierCurve.prototype.getPoint=function(c){var a=this.points.length;if(a===0)a=this.initialize();var b=Math.floor(c*a);if(b>a-1)b=a-1;return this.points[b]};Gimme.Animation.AccelerationLine=function(a,c){var d=a[a.length-1],b=g(a).map(function(a){return {x:a/d,y:0}});this.bezier=new Gimme.Animation.BezierCurve(b,c);this.points=this.bezier.points};Gimme.Animation.AccelerationLine.prototype.getValue=function(a){return this.bezier.getPoint(a).x};Gimme.Animation.AccelerationLines={zoom:new Gimme.Animation.AccelerationLine([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520],75),slowStartAccelerate:new Gimme.Animation.AccelerationLine([0,1,2,3,8,50],100),quickStartDecelerate:new Gimme.Animation.AccelerationLine([0,50,55,56,57,58],100),linear:new Gimme.Animation.AccelerationLine([0,10],100)};Gimme.Animation.AccelerationLines.defaultLine=Gimme.Animation.AccelerationLines.zoom;Gimme.ext.fadeIn=function(b,c,a){g(this.entities).fadeTo(null,.99999,b,c,a);a=null;return this};Gimme.ext.fadeOut=function(b,c,a){g(this.entities).fadeTo(null,0,b,c,a);a=null;return this};Gimme.ext.fadeTo=function(b,c,e,h,d,a){a=a||Gimme.Animation.AccelerationLines.linear;g(this.entities).animate(a,e,h,d,f,i);function i(d){d.style.zoom="1";var a=b===0?0:b||Number(g(d).getStyle("opacity")),e=c-a;return {startOpacity:a,deltaO:e}}function f(e,b,c,a){var f=c.getValue(b),d=a.startOpacity+f*a.deltaO;g(e).setStyle("opacity",d)}return this};Gimme.ext.veil=function(b,d,h,c,e){var a=Gimme.Animation.Directions;b=Math.floor(b)||a[b]||a.vertically;g(this.entities).animate(e,d,h,c,f,i);function i(d){var e=d.style.display||g(d).getStyle("display");if(e==="none")return false;var c=function(b){var a={};g(b).forEach(function(b){a[b]=parseInt(g(d).getStyle(b),10)});return a}(["height","width","paddingTop","paddingRight","paddingBottom","paddingLeft"]);d["_$gimme$_veil"]=c.height+";"+c.width+";"+c.paddingTop+";"+c.paddingRight+";"+c.paddingBottom+";"+c.paddingLeft;d.style.overflow="hidden";if((b&a.horizontally)===a.horizontally)d.style.height=c.height+"px";return c}function f(d,g,m,c){if(g>=1)d.style.display="none";var e=m.getValue(g),k,l,j,h,f,i;if((b&a.vertically)===a.vertically){k=c.height-e*c.height;j=c.paddingTop-e*c.paddingTop;f=c.paddingBottom-e*c.paddingBottom;d.style.height=k+"px";d.style.paddingTop=j+"px";d.style.paddingBottom=f+"px"}if((b&a.horizontally)===a.horizontally){l=c.width-e*c.width;h=c.paddingRight-e*c.paddingRight;i=c.paddingLeft-e*c.paddingLeft;d.style.width=l+"px";d.style.paddingRight=h+"px";d.style.paddingLeft=i+"px"}}return this};Gimme.ext.unveil=function(b,e,i,d,f){var a=Gimme.Animation.Directions;b=Math.floor(b)||a[b]||a.vertically;var c=true;g(this.entities).animate(f,e,i,d,h,j);function j(b){var l=b.style.display||g(b).getStyle("display");if(l!=="none"&&l!==null)return false;var m=Gimme.Helper.convertToPixels,d=b.cloneNode(true);d.setAttribute("style","position:absolute;top:0;left:0;visibility:hidden;margin:0;padding:0;border:0;height:;width:;");d.style.display="block";b.parentNode.appendChild(d);var j,k,i,f,e,h,a=b["_$gimme$_veil"];if(a){a=a.split(";");j=a[0];k=a[1];i=a[2];f=a[3];e=a[4];h=a[5]}else{var c=g(d);j=parseInt(m(b.style.height),10)||parseInt(c.getStyle("height"),10);k=parseInt(m(b.style.width),10)||parseInt(c.getStyle("width"),10);d.style.padding="";i=parseInt(c.getStyle("paddingTop"),10);e=parseInt(c.getStyle("paddingBottom"),10);f=parseInt(c.getStyle("paddingRight"),10);h=parseInt(c.getStyle("paddingLeft"),10)}b.parentNode.removeChild(d);b.style.overflow="hidden";return {deltaH:j,deltaW:k,paddingTop:i,paddingBottom:e,paddingLeft:h,paddingRight:f}}function h(h,j,p,d){var n,o,m,i,k,l,f=g(h),e=1-p.getValue(j);if(c){h.style.display="block";c=false}if(j>=1)h.style.overflow="";if(b===a.vertically)f.setStyles("width",d.deltaW+"px","paddingRight",d.paddingRight+"px","paddingLeft",d.paddingLeft+"px");else if(b===a.horizontally)f.setStyles("height",d.deltaH+"px","paddingTop",d.paddingTop+"px","paddingBottom",d.paddingBottom+"px");if((b&a.vertically)===a.vertically){n=d.deltaH-e*d.deltaH;m=d.paddingTop-e*d.paddingTop;i=d.paddingBottom-e*d.paddingBottom;f.setStyles("height",n+"px","paddingTop",m+"px","paddingBottom",i+"px")}if((b&a.horizontally)===a.horizontally){o=d.deltaW-e*d.deltaW;k=d.paddingRight-e*d.paddingRight;l=d.paddingLeft-e*d.paddingLeft;f.setStyles("width",o+"px","paddingRight",k+"px","paddingLeft",l+"px")}}return this};Gimme.ext.scrollTo=function(b,e,a,c){g(this.entities[0]).animate(c,b,e,a,d,f);function f(c){var a=Gimme.Screen.getScrollPosition(),b=g(c).getPagePosition().y-a.y;return {scrollPos:a,deltaY:b}}function d(f,b,c,a){var d=c.getValue(b),e=a.scrollPos.y+d*a.deltaY;window.scrollTo(0,Math.floor(e))}return this};Gimme.ext.slideToPoint=function(a,c,f,b,d){g(this.entities).animate(d,c,f,b,e,h);function h(e){var b=g(e).getComputedPosition();if(a.x===null)a.x=b.x;if(a.y===null)a.y=b.y;var d=a.y-b.y,c=a.x-b.x;return {startPt:b,deltaX:c,deltaY:d}}function e(c,e,f,a){var b=a.startPt,g=a.deltaX,h=a.deltaY,d=f.getValue(e),i=b.x+d*g,j=b.y+d*h;c.style.top=Math.floor(Math.round(j))+"px";c.style.left=Math.floor(Math.round(i))+"px"}return this};Gimme.ext.followPath=function(f,a,d,e,c){a=a||1;g(this.entities).animate(f,d,e,c,b,h);function h(b){var a=g(b).getComputedPosition();return {startPt:a}}function b(c,e,g,f){var b=f.startPt,d=g.getPoint(e),h=b.x+d.x*a,i=b.y+d.y*a;c.style.top=Math.floor(Math.round(i))+"px";c.style.left=Math.floor(Math.round(h))+"px"}return this};Gimme.ext.animate=function(d,b,a,h,c,e){var f=this.entities.length;if(f<1)return;d=d||Gimme.Animation.AccelerationLines.defaultLine;b=Math.floor(b)||Gimme.Animation.Speeds[b]||Gimme.Animation.Speeds.quickly;a=a||"AUTOGUID_"+Math.random((new Date).getTime());if(!Gimme.Animation.isGrouping()&&Gimme.Animation.isRunning(a))return;Gimme.Animation.whenDone(a,h);var g=0,j=(new Date).getTime();this.forEach(function(c,b){Gimme.Animation.start(a,i(c,b),1)});function i(i){var h=e(i),l=function(){var l=(new Date).getTime(),k=(l-j)/b;if(k>=1){if(typeof c==="function")c(i,1,d,h);if(++g===f){Gimme.Animation.end(a);e=null;c=null}}else c(i,k,d,h)},k=function(){Gimme.Animation.end(a)};return h?l:k}};Gimme.Events=new function(){var c={},b=null,a=null;this.captureMouse=function(c){Gimme.Events.releaseMouse();b=c;if(typeof c.setCapture!=="undefined")c.setCapture();else{a=function(b){b.stopPropagation();var d,e;if(Gimme.Browser.isGecko){d=document.createEvent("MouseEvents");d.initMouseEvent(b.type,b.bubbles,b.cancelable,window,b.detail,b.screenX,b.screenY,b.clientX,b.clientY,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,b.button,b.relatedTarget);e=Gimme.Screen.getScrollPosition();d.__defineGetter__("pageX",function(){return this.clientX+e.x});d.__defineGetter__("pageY",function(){return this.clientY+e.y})}else d=b;document.removeEventListener(b.type,a,true);d.captureTarget=b.target;c.dispatchEvent(d);if(a!==null)document.addEventListener(b.type,a,true);delete d.captureTarget};document.addEventListener("mouseover",a,true);document.addEventListener("mouseout",a,true);document.addEventListener("mousemove",a,true);document.addEventListener("mouseup",a,true);document.addEventListener("mousedown",a,true);document.addEventListener("click",a,true);document.addEventListener("dblclick",a,true)}return this};this.releaseMouse=function(){if(b!==null){if(typeof b.releaseCapture!=="undefined")b.releaseCapture();else{document.removeEventListener("mouseover",a,true);document.removeEventListener("mouseout",a,true);document.removeEventListener("mousemove",a,true);document.removeEventListener("mouseup",a,true);document.removeEventListener("mousedown",a,true);document.removeEventListener("click",a,true);document.removeEventListener("dblclick",a,true)}b=a=null}return this};this.getCaptureTarget=function(a){return a.captureTarget||a.srcElement||a.target};Gimme.ext.onmouseenter=function(e,b,c){var a=d(e);c?this.addEvent("mouseover",a,b,false):this.removeEvent("mouseover",a,b,false);a=null};Gimme.ext.onmouseleave=function(e,b,c){var a=d(e);c?this.addEvent("mouseout",a,b,false):this.removeEvent("mouseout",a,b,false);a=null};Gimme.ext.onmousewheel=function(d,c,e){var a="mousewheel",b=d;if(Gimme.Browser.isGecko){a="DOMMouseScroll";b=f(d)}e?this.addEvent(a,b,c,false):this.removeEvent(a,b,c,false)};function e(c,a,b){if(c===a)return false;var d=0;while(a&&a!=c){d++;a=a.parentNode}b=b||d;return a===c&&b===d}function d(b){var d=Gimme.Helper.getObjectGUID(b),a=c[d];if(typeof a==="undefined")a=c[d]=function(c){var a=c.relatedTarget;if(this===a||e(this,a))return;b.call(this,c)};return a}function f(b){var d=Gimme.Helper.getObjectGUID(b),a=c[d];if(typeof a==="undefined")a=c[d]=function(a){a.wheelDelta=-a.detail;b.call(this,a);a.wheelDelta=null};return a}};Gimme.ver="Gimme v2.0.0.2 (Caspian) :: 10/17/2008, 13:42:53";Gimme.ext.getRelativePosition=function(d,e){var a=this.entities[e||0],b=0,c=0;while(a!==null&&a!==d){b+=a.offsetLeft;c+=a.offsetTop;a=a.offsetParent}return {x:b,y:c}};Gimme.ext.addShim=function(d,e){var b=this.entities[0];if(b.shim){b.shim.parentNode.removeChild(b.shim);b.shim=null}var a=document.createElement("iframe");a.frameBorder="0";a.scrolling="no";a.className="iframeShim";a.style.position="absolute";a.style.zIndex=e||"1";a.style.background="#fff";a.style.height=b.offsetHeight+"px";a.style.width=b.offsetWidth+"px";var c=g(b);a.style.top=c.getStyle("top");a.style.left=c.getStyle("left");a.style.marginTop=c.getStyle("marginTop");a.style.marginLeft=c.getStyle("marginLeft");a.style.marginRight=c.getStyle("marginRight");a.style.marginBottom=c.getStyle("marginBottom");this.entities.push(a);d=d||b;(d.parentNode||document.body).insertBefore(a,d);b.shim=a;return this};Gimme.ext.removeShim=function(){var b=this.entities[0],a=b.shim;if(a){a.parentNode.removeChild(a);b.shim=null}return this};Gimme.ext.toggle=function(a){if(a!==true)a=false;this.forEach(function(c){var b=g(c);if(a)b.setStyle("visibility",b.getStyle("visibility")==="visible"?"hidden":"visible");else b.setStyle("display",b.getStyle("display")!=="none"?"none":"block")});return this};function MVC_Init_AbstractView_Shared(){Msn.MVC.AbstractView.prototype.GetMoveMenuOptionAsHtml=function(a){return a}}function MVC_Init_View3D_Shared(){Msn.MVC.View3D.prototype.GetMoveMenuOptionAsHtml=function(d,c){var e=c.GetPrimitiveCount();for(var a=0;a<e;a++){var b=c.GetPrimitive(a).type;if(b==VEShapeType.Polyline||b==VEShapeType.Polygon)return ""}return d}}function MVC_Init_ViewFacade_Shared(){Msn.MVC.ViewFacade.prototype.GetMoveMenuOptionAsHtml=function(a,b){if(this._curMvcView==null)return "";return this._curMvcView.GetMoveMenuOptionAsHtml(a,b)}}function VE_SelectItem(b,a){this.data=b;this.description=a}VE_SelectItem.prototype.toString=function(){return this.description};function VE_Select(h,l,k,j){this.isVisible=false;var b=[],a=document.createElement("div");a.setAttribute("id",h);this.id=h;var v=h,d=this,c=-1,r=k?k:"",m=l?l:"",p=j?j:"",e="";function y(d){if(!(d instanceof VE_SelectItem))d=new VE_SelectItem(d,d.toString());b.push(d);var c=document.createElement("div");c.setAttribute("id",v+"_"+(b.length-1));c.onclick=w;c.onmouseover=q;c.onmouseout=s;c.innerHTML=d.description;a.appendChild(c)}function x(){return b.length}function u(){return a}function w(e){var c=GetTarget(e),a=f(c);i(a);if(d.OnClick)d.OnClick(a,b[a]);if(d.OnSelect)d.OnSelect(a,b[a])}function q(g){var a=GetTarget(g),c=f(a);e=a.className;a.className=p;if(d.OnMouseOver)d.OnMouseOver(c,b[c])}function s(g){var a=GetTarget(g),c=f(a);a.className=e;if(d.OnMouseOut)d.OnMouseOut(c,b[c])}function i(d){if(d>=0&&d<b.length){var f=g();if(f>=0)a.childNodes[f].className=m;c=d;a.childNodes[d].className=r;e=a.childNodes[d].className}else{var f=g();if(f>=0)a.childNodes[f].className=m;c=-1}}function g(){return c}function o(){if(c>=0&&c<b.length)return b[c];return null}function n(d){if(d<0||d>=b.length)return;if(d<c)c-=1;else if(d==c)c=-1;b.splice(d,1);a.removeChild(a.childNodes[d])}function f(c){for(var b=0;b<a.childNodes.length;++b)if(c==a.childNodes[b])return b;return -1}function t(){while(b.length>0)b.pop();while(a.childNodes.length>0)a.removeChild(a.lastChild);c=-1}function A(){a.style.display="block";this.isVisible=true}function z(){a.style.display="none";this.isVisible=false}this.OnClick=null;this.GetCount=x;this.GetElement=u;this.GetSelectedIndex=g;this.GetSelectedItem=o;this.SelectItemAtIndex=i;this.OnSelect=null;this.AddItem=y;this.OnMouseOver=null;this.OnSelect=null;this.OnMouseOut=null;this.ClearItems=t;this.RemoveItemAtIndex=n;this.Show=A;this.Hide=z}function DecodeHtml(a){var c="";if(typeof a=="string"&&a.length>0){var b=document.createElement("span");b.innerHTML=a;c=b.firstChild.nodeValue;b=null}return c}function OutputEncoder_URLEncodeUTF8(e){if(e==null)return "";var d=["%00","%01","%02","%03","%04","%05","%06","%07","%08","%09","%0a","%0b","%0c","%0d","%0e","%0f","%10","%11","%12","%13","%14","%15","%16","%17","%18","%19","%1a","%1b","%1c","%1d","%1e","%1f","%20","%21","%22","%23","%24","%25","%26","%27","%28","%29","%2a","%2b","%2c","%2d","%2e","%2f","%30","%31","%32","%33","%34","%35","%36","%37","%38","%39","%3a","%3b","%3c","%3d","%3e","%3f","%40","%41","%42","%43","%44","%45","%46","%47","%48","%49","%4a","%4b","%4c","%4d","%4e","%4f","%50","%51","%52","%53","%54","%55","%56","%57","%58","%59","%5a","%5b","%5c","%5d","%5e","%5f","%60","%61","%62","%63","%64","%65","%66","%67","%68","%69","%6a","%6b","%6c","%6d","%6e","%6f","%70","%71","%72","%73","%74","%75","%76","%77","%78","%79","%7a","%7b","%7c","%7d","%7e","%7f","%80","%81","%82","%83","%84","%85","%86","%87","%88","%89","%8a","%8b","%8c","%8d","%8e","%8f","%90","%91","%92","%93","%94","%95","%96","%97","%98","%99","%9a","%9b","%9c","%9d","%9e","%9f","%a0","%a1","%a2","%a3","%a4","%a5","%a6","%a7","%a8","%a9","%aa","%ab","%ac","%ad","%ae","%af","%b0","%b1","%b2","%b3","%b4","%b5","%b6","%b7","%b8","%b9","%ba","%bb","%bc","%bd","%be","%bf","%c0","%c1","%c2","%c3","%c4","%c5","%c6","%c7","%c8","%c9","%ca","%cb","%cc","%cd","%ce","%cf","%d0","%d1","%d2","%d3","%d4","%d5","%d6","%d7","%d8","%d9","%da","%db","%dc","%dd","%de","%df","%e0","%e1","%e2","%e3","%e4","%e5","%e6","%e7","%e8","%e9","%ea","%eb","%ec","%ed","%ee","%ef","%f0","%f1","%f2","%f3","%f4","%f5","%f6","%f7","%f8","%f9","%fa","%fb","%fc","%fd","%fe","%ff"],b,a=[],g=e.length;for(var f=0;f<g;f++){var c=e.charCodeAt(f),b=e.charAt(f);if("A"<=b&&b<="Z")a=a+b;else if("a"<=b&&b<="z")a=a+b;else if("0"<=b&&b<="9")a=a+b;else if(b==" ")a=a+"+";else if(b=="-"||b=="_"||b=="."||b=="!"||b=="~"||b=="*"||b=="'"||b=="("||b==")")a=a+String.fromCharCode(c);else if(c<=127)a=a+d[c];else if(c<=2047){a=a+d[192|c>>6];a=a+d[128|c&63]}else{a=a+d[224|c>>12];a=a+d[128|c>>6&63];a=a+d[128|c&63]}}return a}function OutputEncoder_URLEncodeEscapeUTF8(e){if(e==null)return "";var d=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],b,a=[],g=e.length;for(var f=0;f<g;f++){var c=e.charCodeAt(f),b=e.charAt(f);if("A"<=b&&b<="Z")a=a+b;else if("a"<=b&&b<="z")a=a+b;else if("0"<=b&&b<="9")a=a+b;else if(b==" ")a=a+"+";else if(b=="-"||b=="_"||b=="."||b=="!"||b=="~"||b=="*"||b=="'"||b=="("||b==")")a=a+String.fromCharCode(c);else if(c<=127)a=a+"%"+d[c];else if(c<=2047){a=a+"%25"+d[192|c>>6];a=a+"%25"+d[128|c&63]}else{a=a+"%25"+d[224|c>>12];a=a+"%25"+d[128|c>>6&63];a=a+"%25"+d[128|c&63]}}return a}function OutputEncoder_EncodeHtml(c){var a,b="";if(c==null)return "";for(var d=0;d<c.length;d++){a=c.charCodeAt(d);if(a>96&&a<123||a>64&&a<91||a==32||a>47&&a<58||a==46||a==44||a==45||a==95)b=b+String.fromCharCode(a);else b=b+"&#"+a+";"}return b}function OutputEncoder_EncodeHtmlAttribute(c){var a,b="";if(c==null)return "";for(var d=0;d<c.length;d++){a=c.charCodeAt(d);if(a>96&&a<123||a>64&&a<91||a>47&&a<58||a==46||a==44||a==45||a==95)b=b+String.fromCharCode(a);else b=b+"&#"+a+";"}return b}function OutputEncoder_EncodeXml(a){return OutputEncoder_EncodeHtml(a)}function OutputEncoder_EncodeXmlAttribute(a){return OutputEncoder_EncodeHtmlAttribute(a)}function OutputEncoder_EncodeJs(c){var a,b="";if(c==null)return "";for(var d=0;d<c.length;d++){a=c.charCodeAt(d);if(a>96&&a<123||a>64&&a<91||a==32||a>47&&a<58||a==46||a==44||a==45||a==95)b=b+String.fromCharCode(a);else if(a>127)b=b+"\\u"+OutputEncoder_TwoByteHex(a);else b=b+"\\x"+OutputEncoder_SingleByteHex(a)}return "'"+b+"'"}function OutputEncoder_EncodeVbs(d){var b,a="",c=false;if(d==null)return "";for(var e=0;e<d.length;e++){b=d.charCodeAt(e);if(b>96&&b<123||b>64&&b<91||b==32||b>47&&b<58||b==46||b==44||b==45||b==95){if(!c){a=a+'&"';c=true}a=a+String.fromCharCode(b)}else{if(c){a=a+'"';c=false}a=a+"&chrw("+b+")"}}if(a.charAt(0)=="&")a=a.substring(1);if(a.length==0)a='""';if(c)a=a+'"';return a}function OutputEncoder_AsUrl(a){if(a==null)return "";if(a.search(/^(?:http|https|ftp):\/\/[a-zA-Z0-9\.\-]+(?:\:\d{1,5})?(?:[A-Za-z0-9\.\;\:\@\&\=\+\$\,\?\/]|%u[0-9A-Fa-f]{4}|%[0-9A-Fa-f]{2})*$/i))throw"Unsanitized value passed to AsUrl";return a}function OutputEncoder_QualifyUrl(a){if(a==null)return "";if(a.search(/^(?:http|https|ftp):\/\//i))if(document.location.protocol=="HTTPS")return "https://"+document.location.hostname+OutputEncoder_QualifyUrl_MakePath(a);else return "http://"+document.location.hostname+OutputEncoder_QualifyUrl_MakePath(a);else return a}function OutputEncoder_QualifyUrl_MakePath(a){if(a==null)return "";if(!a.search(/^[\/\\]/))return a;var b=/^(\/(?:.*\/|))(?:[^\/\\]*\.\w+|\w*)$/;if(!document.location.pathname.search(b)){var c=b.exec(document.location.pathname);return c[1]+a}return "/"+a}function OutputEncoder_AsNumeric(a){if(a==null)return "";if(isNaN(parseFloat(a)))throw"IOSec.AsNumeric(): Error input ["+a+"] not a valid number.";return a}function OutputEncode_TruncateUrlSafe(a,b,e){if(a.length<=b)return a;var d="";if(e&&e.length>0){d=OutputEncoder_EncodeUrl(e);b-=d.length}var a=a.substring(0,b);for(var c=1;c<6;c++)if(a.charAt(b-c)=="%"){a=a.substring(0,b-c);break}return a+d}function OutputEncode_EncodeUrlDelims(f,c){if(!f)return c;var a,h,b="";for(var d=0;d<c.length;d++){a=c.charCodeAt(d);if(37==a){b=b+"%"+OutputEncoder_SingleByteHex(a);continue}var e=c.charAt(d);for(var g=0;g<f.length;g++){h=f.charCodeAt(g);if(h==a){if(a>127)e="%u"+OutputEncoder_TwoByteHex(a);else e="%"+OutputEncoder_SingleByteHex(a);break}}b+=e}return b}function OutputEncoder_EncodeUrl(c){if(c==null)return "";var a,e=c.length,b=new Array(e);for(var d=0;d<e;++d){a=c.charCodeAt(d);if(a>96&&a<123||a>64&&a<91||a>47&&a<58||a==46||a==45||a==95)b.push(String.fromCharCode(a));else if(a>127){b.push("%u");b.push(OutputEncoder_TwoByteHex(a))}else{b.push("%");b.push(OutputEncoder_SingleByteHex(a))}}return b.join("")}function OutputEncoder_SingleByteHex(b){if(b==null)return "";var a=b.toString(16);for(var c=a.length;c<2;c++)a="0"+a;return a}function OutputEncoder_TwoByteHex(b){if(b==null)return "";var a=b.toString(16);for(var c=a.length;c<4;c++)a="0"+a;return a}function GetValidatedUrl(a){if(a==null||a=="undefined"||a.length<=0)return "";try{a=unescape(a);a=a.replace(/\|/g," ").replace(/\^/g," ").replace(/^\s+/g,"").replace(/\s+$/g,"");var b=new RegExp(/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/);if(a.match(b))return a;else return ""}catch(c){return ""}}function OutputEncoder(){this.GetValidatedUrl=GetValidatedUrl;this.EncodeHtml=OutputEncoder_EncodeHtml;this.EncodeHtmlAttribute=OutputEncoder_EncodeHtmlAttribute;this.EncodeXml=OutputEncoder_EncodeXml;this.EncodeXmlAttribute=OutputEncoder_EncodeXmlAttribute;this.EncodeJs=OutputEncoder_EncodeJs;this.EncodeVbs=OutputEncoder_EncodeVbs;this.AsNumeric=OutputEncoder_AsNumeric;this.EncodeUrl=OutputEncoder_EncodeUrl;this.EncodeUrlDelims=OutputEncode_EncodeUrlDelims;this.TruncateUrlSafe=OutputEncode_TruncateUrlSafe;this.SingleByteHex=OutputEncoder_SingleByteHex;this.TwoByteHex=OutputEncoder_TwoByteHex;this.AsUrl=OutputEncoder_AsUrl;this.QualifyUrl=OutputEncoder_QualifyUrl;this.EncodeUrlUTF8=OutputEncoder_URLEncodeUTF8;this.EncodeUrlEscapeUTF8=OutputEncoder_URLEncodeEscapeUTF8;this.DecodeHtml=DecodeHtml}var IOSec=new OutputEncoder;function VE_Panel(c,q,r,o,m,f,d,n,p,l,s,t,e,h,i,j){var b=this;this.index=0;this.x=q;this.y=r;this.width=o;this.height=m;this.dynamicHeightMax=600;this.color=f;this.sPanel=null;this.toolbarHeight=20;this.footerHeight=20;this.min=false;this.visible=true;this.onTitleClick=null;this.onCloseClick=null;this.onMaximize=null;this.onMinimize=null;this.isLegacyPanel=h==true;this.usesShimIn3D=!this.isLegacyPanel;if(!e)e=document.body;var a=null;if(!this.isLegacyPanel){a=VE_Panel._CreateElement("div",c,"VE_Panel_el",d);this.el=a;this.titleDisabled=false;this.title=document.createElement("a");this.title.id=c+"_title";this.title.className="VE_Panel_title";this.title.appendChild(document.createElement("span"));this.title.onclick=function(a){VE_Panel._OnTitleClick(a);return false};this.title.href="#";a.appendChild(this.title);this.SetTitle(n);this.closeboxDisabled=false;this.cb=VE_Panel._CreateElement("a",c+"_cb","VE_Panel_cb VE_Panel_cb_"+f,d+1);this.cb.onclick=function(a){VE_Panel._OnCloseClick(a);return false};this.cb.onmouseover=function(){if(typeof Msn.VE.Css!="undefined")Msn.VE.Css.Functions.addClass(b.title,"VE_Panel_title_hover")};this.cb.onmouseout=function(){if(typeof Msn.VE.Css!="undefined")Msn.VE.Css.Functions.removeClass(b.title,"VE_Panel_title_hover")};this.cb.href="#";this.cb.unselectable="on";a.appendChild(this.cb);this.tb=VE_Panel._CreateElement("div",c+"_tb","toolbar",d+1);this.tb.unselectable="on";a.appendChild(this.tb)}else{var k=$ID(c+"_tb");this.tb=VE_Panel._CreateElement("div","","",d+1);k.appendChild(this.tb)}this.body=VE_Panel._CreateElement("div",c+"_body","VE_Panel_body",d+1);this.body.innerHTML=p;if(!this.isLegacyPanel){a.appendChild(this.body);this.foot=VE_Panel._CreateElement("div",c+"_foot","VE_Panel_foot VE_Panel_foot_"+f,d+1);this.foot.innerHTML=l;this.foot.unselectable="on";a.appendChild(this.foot)}else{a=this.body;this.el=a}VE_Panel.panels.push(this);if(i){a.style.top="0";a.style.left="0";if(j)a.style.position="absolute";else{a.style.display="none";a.style.visibility="hidden"}}e.appendChild(a);if(!Gimme.Browser.isKHTML){var g=Gimme.id("TaskHost_CollectionsViewer_state");if(g!==null)e.appendChild(g)}this.Destroy=function(){if(a.parentNode)a.parentNode.removeChild(a);if(b.sPanel!=null)b.sPanel.Destroy();if(a.shimElement&&a.shimElement.parentNode)a.shimElement.parentNode.removeChild(a.shimElement);a.shimElement=null;var d=VE_Panel.panels;for(var c=0;c<d.length;c++)if(d[c]==b){d.splice(c,1);break}if(!this.isLegacyPanel){b.cb.onclick=b.cb.onmouseover=b.cb.onmouseout=null;b.title.onclick=null;b.cb=null;b.title=null;b.foot=null;b.onTitleClick=null;b.onCloseClick=null}else{var f=b.tb.parentNode;if(f)f.removeChild(b.tb)}b.tb=null;b.sPanel=null;b.body=null;b.onMaximize=null;a=b.el=null;b=null;e=null}}VE_Panel.panels=[];VE_Panel.shadowThickness=3;VE_Panel._CreateElement=function(d,e,b,c){var a=document.createElement(d);a.id=e;a.className=b;a.style.zIndex=c;return a};VE_Panel._PositionElement=function(a,d,e,c,b){a.style.top=e+"px";a.style.left=d+"px";a.style.width=c+"px";a.style.height=b+"px"};VE_Panel.prototype.SetPosition=function(c,d,b,a){this.x=c;this.y=d;this.width=b;this.height=a;if(map.IsModeEnabled(Msn.VE.MapActionMode.Mode3D)&&this.usesShimIn3D)UpdateIFrameShim(this.el)};VE_Panel.prototype.SetToolbarSize=function(toolbarHeight){this.toolbarHeight=toolbarHeight;var d=eval(toolbarHeight)>0?"block":"none";this.tb.style.display=d;this.Resize()};VE_Panel.prototype.SetFooterSize=function(footerHeight){if(!this.isLegacyPanel){this.footerHeight=footerHeight;var d=eval(footerHeight)>0?"block":"none";this.foot.style.display=d;this.Resize()}};VE_Panel.prototype.Resize=function(){if(typeof ve_globals!="undefined"){var geoFn=Msn.VE.Geometry.Functions,taskAreaHeight=Gimme.Screen.getViewportSize().y-g(ve_globals["taskArea"]).getScreenPosition().y-ve_globals["footer"].offsetHeight;if(taskAreaHeight>=0&&typeof taskAreaHeight=="number")ve_globals["taskArea"].style.height=taskAreaHeight-2+"px";if(this.el.id=="contextMenu"||this.el.id=="scratchpad"||this.el.id=="annotationPanel"||this.el.id=="annotationPopup"||this.el.id=="searchPopup"||this.el.id=="help"){if(this.height!="auto"&&typeof this.height=="number")this.el.style.height=eval(this.height)+"px";if(this.width!="auto"&&typeof this.width=="number")this.el.style.width=eval(this.width)+"px";if(this.x!="auto"&&typeof this.x=="number")this.el.style.left=eval(this.x)+"px";if(this.y!="auto"&&typeof this.y=="number")this.el.style.top=eval(this.y)+"px"}if(this.el.shimElement)ShowShim(this.el)}};VE_Panel.prototype.SetHeightToFit=function(){var contentid=this.id+"_body_table",content=$ID(contentid);if(!content)return false;this.height=0;var width=Math.max(eval(this.width),100);if(content.offsetWidth>width-14)this.height+=scrollbarWidth;this.height+=this.titleDisabled?14:21+14;this.height+=this.toolbarHeight;this.height+=content.offsetHeight;this.height+=this.footerHeight;this.height=Math.min(this.dynamicHeightMax,this.height)};VE_Panel.prototype.DisableClosebox=function(){if(!this.isLegacyPanel){if(this.closeboxDisabled)return;this.closeboxDisabled=true;this.el.removeChild(this.cb)}};VE_Panel.prototype.EnableClosebox=function(){if(!this.isLegacyPanel){if(!this.closeboxDisabled)return;this.closeboxDisabled=false;this.el.appendChild(this.cb)}};VE_Panel.prototype.DisableTitle=function(){if(!this.isLegacyPanel){if(this.titleDisabled)return;this.titleDisabled=true;this.el.removeChild(this.cb);this.el.removeChild(this.title)}};VE_Panel.prototype.EnableTitle=function(){if(!this.isLegacyPanel){if(!this.titleDisabled)return;this.titleDisabled=false;this.el.insertBefore(this.cb,this.tb);this.el.insertBefore(this.title,this.cb)}};VE_Panel.prototype.SetTitle=function(c){if(!this.isLegacyPanel){var b=document.createTextNode(c),a=this.title.firstChild;if(a)if(a.firstChild)a.replaceChild(b,a.firstChild);else a.appendChild(b)}};VE_Panel.prototype.SetToolbar=function(a){this.tb.innerHTML=a};VE_Panel.prototype.SetBody=function(a){this.body.innerHTML=a};VE_Panel.prototype.SetDynamicBody=function(a){this.body.innerHTML='<table id="'+this.id+'_body_table"><tr><td>'+a+"</td></tr></table>"};VE_Panel.prototype.SetFooter=function(a){if(!this.isLegacyPanel)this.foot.innerHTML=a};VE_Panel.prototype.SetOpacity=function(o){if(o>=100)o=99.99;with(this.el.style){filter="alpha(opacity:"+o+")";o*=.01;KHTMLOpacity=o;MozOpacity=o;opacity=o}};VE_Panel.prototype.SetColor=function(a){if(!this.isLegacyPanel){this.color=a;this.title.className="VE_Panel_title VE_Panel_title_"+a;this.foot.className="VE_Panel_foot VE_Panel_foot_"+a;this.cb.className="VE_Panel_cb VE_Panel_cb_"+a}};VE_Panel.prototype.Minimize=function(){this.el.className=" VE_Panel_el_minimized";if(this.onMinimize)this.onMinimize(this._CreateEvent())};VE_Panel.prototype.Maximize=function(){this.el.className="VE_Panel_el";if(this.onMaximize)this.onMaximize(this._CreateEvent());this.Resize()};VE_Panel.prototype.isMaximized=function(){return this.el.className=="VE_Panel_el"};VE_Panel.prototype.Show=function(){this.el.style.display="block";this.visible=true;if(this.usesShimIn3D)mvcViewFacade.ShowShimIfSupported(this.el)};VE_Panel.prototype.Hide=function(){this.el.style.display="none";this.visible=false;HideShim(this.el)};VE_Panel.prototype.IsVisible=function(){return this.el.style.display!="none"};function VE_PanelEvent(a){this.srcPanel=a}VE_Panel.prototype._CreateEvent=function(){return new VE_PanelEvent(this)};VE_Panel._OnTitleClick=function(c){if(!c)c=window.event;var d=GetTarget(c),b=VE_Panel.panels;for(var a=0;a<b.length;a++)if(b[a].title==d||b[a].title==d.parentNode){if(b[a].onTitleClick)b[a].onTitleClick(b[a]._CreateEvent());return}};VE_Panel._OnCloseClick=function(c){if(!c)c=window.event;var d=GetTarget(c),b=VE_Panel.panels;for(var a=0;a<b.length;a++)if(b[a].cb==d){if(b[a].onCloseClick)b[a].onCloseClick(b[a]._CreateEvent());return}};function Ad(h,j,a,e,b,c,d,i,g,f,k){this.title=h;this.url=j;this.description=a;this.latitude=e;this.longitude=b;this.address1=c;this.address2=d;this.city=i;this.state=g;this.country=f;this.zip=k}Ad.prototype.ToHtml=function(){var a="<li>"+'<a href = "'+this.url+'" target = "_blank">'+IOSec.EncodeHtml(this.title)+"</a>"+"$AdDescription$"+"</li>";if(this.description&&this.description.length>0)a=a.replace("$AdDescription$","<p>"+IOSec.EncodeHtml(this.description)+"</p>");return a};Ad.prototype.HasAddress=function(){return this.address1.length>0&&this.city.length>0&&this.state.length>0&&this.zip.length>0};Ad.prototype.GetAdDescription=function(){var a=this.description;if(this.HasAddress())a=this.address1+", "+this.city+", "+this.state+" "+this.zip;return a};Msn.VE.DirectionsDecoder=function(){var a=4,b=1000000;function e(a,c,m,l){if(!a||a.length<c)return [];var k=a.length-a.length%c,i=[],f=false,b=0,j=c-1;for(var d=0;d<k;d++){var e=a.charCodeAt(d),h=d%c;if(l&&h==0){f=e&128;e&=127}b|=e;if(h==j){var g=b/m;i.push(f?-g:g);b=0;f=false}else b<<=8}return i}function d(c){return e(c,a,b,true)}function c(c){var l=true;if(!c||c.length<a)return [];var j=[],g=false,d=0,k=a-1,m=c.length;for(var e=0;e<m;++e){var f=c[e],i=e%a;if(l&&i==0){g=f&128;f&=127}d|=f;if(i==k){var h=d/b;j.push(g?-h:h);d=0;g=false}else d<<=8}return j}this.DecodeCoordinatesString=d;this.DecodeCoordinatesByteArray=c};var HelpHistory=[];function VE_Help(){}VE_Help.helpZIndex=31;VE_Help.introZIndex=31;VE_Help.introPanel=null;VE_Help.helpPanel=null;VE_Help.margins=110;VE_Help.LiveHelp=new function(){this.Keyword="keyword";this.Search="search";this.Topic="topic"};VE_Help.CreateHelpPanel=function(){VE_Help.CreateSizedHelpPanel(220,160,windowWidth<=430?300:windowWidth-430,windowHeight<=220?200:windowHeight-220)};VE_Help.CreateSizedHelpPanel=function(e,f,c,b){if(typeof VE_Help.helpPanel!="undefined"&&VE_Help.helpPanel!=null){VE_Help.helpPanel.SetBody("");VE_Help.helpPanel.Destroy();VE_Help.helpPanel=null}var d='<iframe id="helpFrame" src="about:blank" width="100%" height="100%" allowtransparency="true" frameborder="0"></iframe>',a=new VE_Panel("help",e,f,c<=300?300:c,b<=200?200:b,"blue",VE_Help.helpZIndex,L_Help_Text,d,"",null,null,null,null,true,null);a.body.className="VE_Panel_body_help";a.Hide();a.el.style.visibility="";a.SetToolbarSize(0);a.SetFooterSize(0);a.onCloseClick=function(){VE_Help.DisablePreventLayer();VE_Help.ClosePanel()};VE_Help.helpPanel=a};VE_Help.EnablePreventLayer=function(){var a=$ID("__preventLayer__");if(!a)a=document.createElement("div");a.id="__preventLayer__";a.className="preventLayer";document.body.appendChild(a)};VE_Help.DisablePreventLayer=function(){var a=$ID("__preventLayer__");if(a)document.body.removeChild(a)};VE_Help.EnableDrawingPreventLayer=function(){var c=$ID("msve_header");if(c){var b=$ID("__preventLayerHeader__");if(!b)b=document.createElement("div");b.id="__preventLayerHeader__";b.className="preventLayer";b.style.left=c.clientLeft;b.style.top=c.clientTop;b.style.width=c.clientWidth;b.style.height=c.clientHeight;document.body.appendChild(b)}var d=$ID("sb_foot");if(d){var a=$ID("__preventLayerFooter__");if(!a)a=document.createElement("div");a.id="__preventLayerFooter__";a.className="preventLayer";a.style.left=0;a.style.top=GetWindowHeight()-d.clientHeight;a.style.width=d.clientWidth;a.style.height=d.clientHeight;document.body.appendChild(a)}};VE_Help.DisableDrawingPreventLayer=function(){var d=$ID("__preventLayerHeader__");if(d)document.body.removeChild(d);var b=$ID("__preventLayerTaskArea__");if(b)document.body.removeChild(b);var a=$ID("__preventLayerActionBar__");if(a)document.body.removeChild(a);var c=$ID("__preventLayerFooter__");if(c)document.body.removeChild(c)};function findPosX(a){var b=0;if(a.offsetParent)while(a.offsetParent){b+=a.offsetLeft;a=a.offsetParent}else if(a.x)b+=a.x;return b}function findPosY(a){var b=0;if(a.offsetParent)while(a.offsetParent){b+=a.offsetTop;a=a.offsetParent}else if(a.y)b+=a.y;return b}VE_Help.Open=function(b,c){VE_Help.EnablePreventLayer();VE_Help.helpPanel.Show();VE_Help.helpPanel.SetTitle(b);VE_Help.helpPanel.SetBody('<iframe id = "helpFrame" src = "about:blank" width = "100%" allowtransparency = "true" scrolling = "auto" frameborder = "0"></iframe>');var a=$ID("helpFrame");a.src=c;VE_Help.Redraw()};VE_Help.OpenSized=function(f,g,a,b){var d=GetWindowWidth(),c=GetWindowHeight();if(a>d-10)a=d-10;if(b>c-10)b=c-10;VE_Help.CreateSizedHelpPanel((d-a)/2,(c-b)/2,a,b);VE_Help.EnablePreventLayer();VE_Help.helpPanel.Show();VE_Help.helpPanel.SetTitle(f);VE_Help.helpPanel.SetBody('<iframe id = "helpFrame" src = "about:blank" width = "100%" allowtransparency = "true" scrolling = "no" frameborder = "0"></iframe>');var e=$ID("helpFrame");e.src=g};VE_Help.OpenLiveHelp=function(b,a,c){var g="_live_help",f=550,e=575,i=(screen.availWidth-f)*.5,j=(screen.availHeight-e)*.5,h="resizable=yes,top="+j+",width="+f+",height="+e+",left="+i;if(typeof b=="undefined"||b==null||b=="")b=liveLocalHelpProjectCode;if(typeof a=="undefined"||a==null||a=="")a=VE_Help.LiveHelp.Keyword;if(typeof c=="undefined"||c==null||c=="")c="qaf";var k=liveHelpUrl+"&project="+b+"&querytype="+a+"&query="+c,d=window.open(k,g,h);if(d!=null&&typeof d=="object")d.focus()};VE_Help.Redraw=function(){var b=VE_Help.helpPanel;if(!b)return;var c=Gimme.Screen.getViewportSize(),a=g(b.el);a.setStyle("top",(c.height-a.element().offsetHeight)/2+"px");a.setStyle("left",(c.width-a.element().offsetWidth)/2+"px");ShowShim(b.el)};VE_Help.CloseIntro=function(){if(VE_Help.introPanel)VE_Help.introPanel.Hide()};VE_Help.ClosePanel=function(){if(VE_Help.helpPanel){VE_Help.helpPanel.Hide();VE_Help.DisablePreventLayer()}};VE_Help.Destroy=function(){if(VE_Help.introPanel){VE_Help.introPanel.Destroy();VE_Help.introPanel=null}if(VE_Help.helpPanel){VE_Help.helpPanel.Destroy();VE_Help.helpPanel=null}};function SanitizeHtmlString(a){if(!a||typeof a!="string")return a;return IOSec.EncodeHtml(a)}function GetTarget(b){if(!b)b=window.event;var a=null;if(b.srcElement)a=b.srcElement;else if(b.target)a=b.target;if(a&&a.nodeType){if(b.capturedTarget)a=b.capturedTarget;if(a.nodeType==3)a=a.parentNode}return a}function SelectText(a,c,d){if(!a)return;if(a.createTextRange){var b=a.createTextRange();b.moveStart("character",c);b.moveEnd("character",d);b.select()}else if(a.setSelectionRange)a.setSelectionRange(c,d)}function SelectedTextLength(a){if(!a)return 0;if(a.document){var b=a.document.selection.createRange();return b.text.length}else{var c=a.selectionStart,d=a.selectionEnd;return d-c}}function GetXMLText(a){if(a.text)return a.text;else if(a.textContent)return a.textContent;else if(a.firstChild&&a.firstChild.data)return a.firstChild.data;return ""}function VEValidator(){}VEValidator.ValidateFloat=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateFloat";if(b==null||b=="undefined")throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","float"));try{if(isNaN(parseFloat(b)))throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","float"));return true}catch(d){throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","float"))}};VEValidator.ValidateInt=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateInt";if(b==null||b=="undefined")throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","int"));try{if(isNaN(parseInt(b))||parseFloat(b)!=parseInt(b))throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","int"));return true}catch(d){throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","int"))}};VEValidator.ValidateNonNegativeInt=function(a,c){var b="";if(arguments!=null&&arguments.caller!=null)b=VEValidator.GetCaller(arguments.caller);if(b=="")b="VEValidator.ValidateNonNegativeInt";if(a==null||a=="undefined")throw new VEException(b,"err_invalidargument",L_invalidnonnegativeint_text.replace("%1",c));try{if(isNaN(parseInt(a))||parseFloat(a)!=parseInt(a)||parseInt(a)<0)throw new VEException(b,"err_invalidargument",L_invalidnonnegativeint_text.replace("%1",c));return true}catch(d){throw new VEException(b,"err_invalidargument",L_invalidnonnegativeint_text.replace("%1",c))}};VEValidator.ValidateFunction=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateFunction";if(b==null||typeof b!="function")throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","function"))};VEValidator.ValidateNonNull=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateNonNull";if(b==null||b=="undefined")throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","non null"))};VEValidator.ValidateBetween=function(b,e,d,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateBetween";if(b<d||b>c)throw new VEException(a,"err_invalidargument",L_invalidbetweenint_text.replace("%1",e).replace("%2",d).replace("%3",c))};VEValidator.ValidateBoolean=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateBoolean";if(b!=true&&b!=false)throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","bool"))};VEValidator.ValidateMapStyle=function(a,c){var b="";if(arguments!=null&&arguments.caller!=null)b=VEValidator.GetCaller(arguments.caller);if(b=="")b="VEValidator.ValidateMapStyle";if(a==null||a=="undefined")throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","MapStyle"));if(a=="r"||a=="R"||$MVEM.IsEnabled(MapControl.Features.MapStyle.Shaded)&&(a=="s"||a=="S")||$MVEM.IsEnabled(MapControl.Features.MapStyle.Aerial)&&(a=="a"||a=="A")||$MVEM.IsEnabled(MapControl.Features.MapStyle.View3D)&&(a=="o"||a=="O")||$MVEM.IsEnabled(MapControl.Features.MapStyle.BirdsEye)&&(a=="b"||a=="B")||$MVEM.IsEnabled(MapControl.Features.MapStyle.Hybrid)&&(a=="h"||a=="H"))return true;throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","MapStyle"))};VEValidator.ValidateClusteringType=function(a,c){var b="";if(arguments!=null&&arguments.caller!=null)b=VEValidator.GetCaller(arguments.caller);if(b=="")b="VEValidator.ValidateClusteringType";if(a==null||a=="undefined")throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","ClusteringType"));if(typeof a=="number"&&(a==VEClusteringType.None||a==VEClusteringType.Grid))return true;throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","ClusteringType"))};VEValidator.ValidateMapMode=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a="")a="VEValidator.ValidateMapMode";if(b==null||b=="undefined")throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","MapMode"));if(b==VEMapMode.Mode2D||$MVEM.IsEnabled(MapControl.Features.MapStyle.View3D)&&b==VEMapMode.Mode3D)return true;throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","MapMode"))};VEValidator.ValidateDistanceUnit=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateDistanceUnit";if(b==null||b=="undefined")throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEDistanceUnit"));if(b==VEDistanceUnit.Miles||b==VEDistanceUnit.Kilometers)return true;throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEDistanceUnit"))};VEValidator.ValidateMaxZoom=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateMaxZoom";if(b==null||b=="undefined")throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","ValidateMaxZoom"));if(b<=Msn.VE.API.Globals.vemaxzoom)return true;throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","ValidateMaxZoom"))};VEValidator.ValidateLayerType=function(a,c){var b="";if(arguments!=null&&arguments.caller!=null)b=VEValidator.GetCaller(arguments.caller);if(b=="")b="VEValidator.ValidateLayerType";if(a==null||a=="undefined")throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEDataType"));if(a==VEDataType.GeoRSS||a==VEDataType.VECollection||a==VEDataType.VETileSource)return true;throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEDataType"))};VEValidator.ValidateDashboardSize=function(a,c){var b="";if(arguments!=null&&arguments.caller!=null)b=VEValidator.GetCaller(arguments.caller);if(b=="")b="VEValidator.ValidateDashboardSize";if(a==null||a=="undefined")throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEDashboardSize"));if(a==VEDashboardSize.Normal||a==VEDashboardSize.Small||a==VEDashboardSize.Tiny)return true;throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEDashboardSize"))};VEValidator.ValidateMiniMapSize=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateMiniMapSize";if(b==null||b=="undefined")throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEMiniMapSize"));if(b==VEMiniMapSize.Small||b==VEMiniMapSize.Large)return true;throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEMiniMapSize"))};VEValidator.ValidateAltitudeMode=function(b,c){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateAltitudeMode";if(b==null)throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEAltitudeMode"));if(b!=VEAltitudeMode.Absolute&&b!=VEAltitudeMode.RelativeToGround)throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEAltitudeMode"));return true};VEValidator.ValidateObject=function(b,c,e,d){var a="";if(arguments!=null&&arguments.caller!=null)a=VEValidator.GetCaller(arguments.caller);if(a=="")a="VEValidator.ValidateObject";if(b==null||b=="undefined")throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","non null"));if(!(b instanceof e))throw new VEException(a,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2",d))};VEValidator.ValidateObjectArray=function(a,d,f,e){var b="";if(arguments!=null&&arguments.caller!=null)b=VEValidator.GetCaller(arguments.caller);if(b=="")b="VEValidator.ValidateObject";if(a==null||typeof a=="undefined"||a.length==null||typeof a.length=="undefined")throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",d).replace("%2","array"));for(var c=0;c<a.length;++c)if(a[c]==null||typeof a[c]=="undefined"||!(a[c]instanceof f))throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",d).replace("%2",e))};VEValidator.ValidateOrientation=function(a,c){var b="";if(arguments!=null&&arguments.caller!=null)b=VEValidator.GetCaller(arguments.caller);if(b=="")b="VEValidator.ValidateOrientation";if(a==null||a=="undefined")throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEOrientation"));if(a!=VEOrientation.North&&a!=VEOrientation.East&&a!=VEOrientation.West&&a!=VEOrientation.South)throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VEOrientation"))};VEValidator.ValidateBounds=function(a,c){var b="";if(arguments!=null&&arguments.caller!=null)b=VEValidator.GetCaller(arguments.caller);if(b=="")b="VEValidator.ValidateBounds";if(a==null||a=="undefined")throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VELatLongRectangle"));if(a.TopLeftLatLong==null||a.BottomRightLatLong==null||a.TopLeftLatLong.Latitude<=a.BottomRightLatLong.Latitude||a.TopLeftLatLong.Longitude>=a.BottomRightLatLong.Longitude)throw new VEException(b,"err_invalidargument",L_invalidargument_text.replace("%1",c).replace("%2","VELatLongRectangle"))};VEValidator.GetCaller=function(b){if(b!=null||b!=""){try{var a=b.toString().match(/function (\w*)/)[1]}catch(c){a=""}if(a==null||a.length==0)return "";else return a}else return ""};function VEPushpin(f,e,d,h,g,c,b,a){VEValidator.ValidateNonNull(f,"pinId");VEValidator.ValidateNonNull(e,"veLatLong");var i=this;this.IsInLayer=false;this.ID=f;this.LatLong=e;this.Title=h;if(d==null||d=="undefined"||d.length==0)this.Iconurl=Msn.VE.API.Constants.iconurl;else this.Iconurl=d;this.Details=g;if(c==null||c=="undefined"||c.length==0)this.IconStyle="";else this.IconStyle=c;if(b==null||b=="undefined"||b.length==0)this.TitleStyle="VE_Pushpin_Popup_Title";else this.TitleStyle=b;if(a==null||a=="undefined"||a.length==0)this.DetailsStyle="VE_Pushpin_Popup_Body";else this.DetailsStyle=a;if(window.ero==null||window.ero=="undefined")window.ero=ERO.getInstance()}VEPushpin.ShowDetailOnMouseOver=true;VEPushpin.OnMouseOverCallback=null;VEPushpin.prototype.Dispose=function(){this.DetailsStyle==null;this.TitleStyle=null;this.IconStyle=null;this.Details=null;this.IconUrl=null;this.Title=null;this.LatLong=null;this.ID=null;this.m_vemapcontrol=null;this.m_vemap=null};VEPushpin.Hide=function(a){if(window.ero!=null){if(a=="undefined"||a==null)a=false;window.ero.hide(a)}};VEPushpin.GetEroContent=function(c,b,e,d){var a="<p>";if(c!=null&&c!="undefined"&&c.length>0)a+='<div class="'+e+'">'+unescape(c)+"</div>";if(b!=null&&b!="undefined"&&b.length>0)a+='<div class="'+d+'">'+unescape(b)+"</div>";if(!document.all&&(c.length==0||b.length==0))a+="<br/><br/>";a+="</p>";return a};VEPushpin.Show=function(l,m,k,h,d,c,g,e){var a=VEMap._GetMapFromGUID(l);if(a==null||a=="undefined")return;var i=a.vemapcontrol.GetX(h)+a.GetLeft(),j=a.vemapcontrol.GetY(k)+a.GetTop();if(VEPushpin.ShowDetailOnMouseOver){var b=$ID(m+"_"+a.GUID);if(b!=null&&b!="undefined"){var f=VEPushpin.GetEroContent(d,c,g,e);window.ero.setContent(f);window.ero.setBoundingArea(null);window.ero.getBoundingArea().move(Gimme.Screen.getScrollPosition());window.ero.dockToElement(b)}}if(VEPushpin.OnMouseOverCallback!=null)VEPushpin.OnMouseOverCallback(i,j,d,unescape(c))};VEPushpin.Show3D=function(a,c,b,f,d){if(VEPushpin.ShowDetailOnMouseOver){var e=VEPushpin.GetEroContent(c,b,f,d);window.ero.setContent(e);ero.setGlitz(false,false,false,true);window.ero.dockToRect(a,null,-1)}if(VEPushpin.OnMouseOverCallback!=null)VEPushpin.OnMouseOverCallback(a.getP1().x,a.getP1().y,c,unescape(b))};function GetContent(){var g=this.ID+"_"+this.m_vemap.GUID,a="<img class='"+this.IconStyle+"' src='"+this.Iconurl+"' id='"+g+"' ",f=Msn.VE.Environment.BrowserInfo;if(f.Type==Msn.VE.BrowserType.MSIE&&parseFloat(f.MajorVersion)<7&&this.Iconurl!=null&&this.Iconurl.search(/.gif$/)<0)a+='onload=\'this.onload="";if(this.fileSize!=-1){this.style.width=this.width;this.style.height=this.height;this.src="'+Msn.VE.API.Constants.spacerurl+'";this.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\\"'+this.Iconurl+'\\", sizingMethod=\\"scale\\")";}\' ';var e=this.Title!=null&&this.Title!="undefined"&&this.Title.length>0,d=this.Details!=null&&this.Details!="undefined"&&this.Details.length>0;if(e||d){var b="if (VEMap._GetMapFromGUID("+this.m_vemap.GUID+").FireEvent(",c="))return;";a+=" onmouseout='"+b+'"onmouseout"'+c+"VEPushpin.Hide();' ";a+=" onmousedown='"+b+'"onmousedown"'+c+"VEPushpin.Hide(true);' ";a+=" onmouseover='"+b+'"onmouseover"'+c+'VEPushpin.Show("'+this.m_vemap.GUID+'","'+this.ID+'",'+this.LatLong.Latitude+","+this.LatLong.Longitude;if(e)a+=', "'+escape(this.Title)+'"';else a+=',""';if(d)a+=', "'+escape(this.Details)+'"';else a+=',""';a+=',"'+this.TitleStyle+'"';a+=',"'+this.DetailsStyle+'"';a+=");' "}a+="/>";return a}VEPushpin.DisposeERO=function(){if(window.ero!=null&&window.ero!="undefined"){window.ero.destroy();window.ero=null}};VEPushpin.prototype._SetMapInstance=function(a){this.m_vemap=a;this.m_vemapcontrol=a.vemapcontrol};VEPushpin.prototype.GetContent=GetContent;function GetImageFullUrl(a){var b="";if(a&&a.constructor==String&&a.length>0){var c=new Image;c.src=a;b=c.src}return b}function VE_ScratchpadManager(){}VE_ScratchpadManager.AddGeoLocation=function(){return};VE_ScratchpadManager.AddLocation=VE_ScratchpadManager.AddGeoLocation;VE_Scratchpad=VE_ScratchpadManager;function VEMessage(b){VEValidator.ValidateObject(b,"vemap",VEMap,"VEMap");this.m_vemap=b;var a=this;this.Show=function(g){if(g==null||g=="undefined"||g.length<=0)return;g=c(g);if(this.vemessagepanel==null||this.vemessagepanel=="undefined"){var d=document.createElement("div");d.id=this.m_vemap.ID+"_vemessagepanel";d.className="VE_Message";d.style.zIndex=Msn.VE.API.Globals.vemessagepanelzIndex;var i=this.m_vemap.GetHeight()/2-Msn.VE.API.Globals.vemessagepanelheight/2;if(i<0)i=0;d.style.top=i+"px";d.style.left=30+"px";var h=this.m_vemap.GetWidth()-60;if(h<30)h=30;d.style.width=h+"px";d.style.height=Msn.VE.API.Globals.vemessagepanelheight+"px";d.style.position="absolute";this.vemessagepanel=d;var e=document.createElement("a");e.className="VE_Message_Title";e.style.zIndex=parseInt(Msn.VE.API.Globals.vemessagepanelzIndex)+1;e.style.top="1px";e.style.left="1px";e.style.width=parseInt(this.vemessagepanel.style.width)-5+"px";e.innerHTML=IOSec.EncodeHtml(L_error_text);e.unselectable="on";this.vemessagepanel.appendChild(e);var f=document.createElement("a");f.className="VE_Message_Close";f.style.zIndex=parseInt(Msn.VE.API.Globals.vemessagepanelzIndex)+2;f.style.top="1px";f.style.right="1px";f.onclick=a.Hide;f.unselectable="on";f.innerHTML=L_close_text;this.vemessagepanel.appendChild(f);var b=document.createElement("div");b.id=this.m_vemap.ID+"_vemessagepanel_body";b.className="VE_Message_Body";b.style.zIndex=parseInt(Msn.VE.API.Globals.vemessagepanelzIndex)+3;b.style.top=22+"px";b.style.left=0+"px";b.style.width=parseInt(this.vemessagepanel.style.width)-8+"px";b.onclick=a.Hide;b.unselectable="on";b.innerHTML=g;this.vemessagepanel.appendChild(b);this.m_vemap.AddControl(this.vemessagepanel,Msn.VE.API.Globals.vemessagepanelzIndex)}else{var b=$ID(this.m_vemap.ID+"_vemessagepanel_body");b.innerHTML=g}this.vemessagepanel.style.display="block";mvcViewFacade.ShowShimIfSupported(this.vemessagepanel);this.timeoutIntervalID=window.setInterval(this.Hide,10000)};this.Hide=function(){if(a.vemessagepanel!=null&&a.vemessagepanel!="undefined"){a.vemessagepanel.style.display="none";HideShim(a.vemessagepanel);if(a.timeoutIntervalID!=null){window.clearInterval(a.timeoutIntervalID);a.timeoutIntervalID=null}}};this.Dispose=function(){if(this.vemessagepanel!=null&&this.vemessagepanel!="undefined")this.vemessagepanel=null};function c(a){var b=/<a[^>]*>/gi;a=a.replace(b,"");b=/<\/a>/gi;a=a.replace(b,"");return a}}function VEAmbiguouslist(vemap){VEValidator.ValidateNonNull(vemap,"vemap");this.m_vemap=vemap;var self=this;this.ID=this.m_vemap.ID+"_veplacelistpanel";this.Show=function(a,onSelectCallback,callbackOnClose){var body=null,veambiglistHide="VEMap._GetMapFromGUID('"+this.m_vemap.GUID+"').m_veambiguouslist.Hide();",veambiglistSetViewport="VEMap._GetMapFromGUID('"+this.m_vemap.GUID+"').vemapcontrol.SetViewport";if(this.veplacelistpanel==null||this.veplacelistpanel=="undefined"){var e=document.createElement("div");e.id=this.ID;e.className="VE_PlaceList";e.style.top=this.m_vemap.GetHeight()/2-Msn.VE.API.Globals.veplacelistpanelheight/2+"px";e.style.left=this.m_vemap.GetWidth()/2-Msn.VE.API.Globals.veplacelistpanelwidth/2+"px";e.style.width=Msn.VE.API.Globals.veplacelistpanelwidth+"px";e.style.height=Msn.VE.API.Globals.veplacelistpanelheight+"px";e.style.position="absolute";this.veplacelistpanel=e;var title=document.createElement("a");title.className="VE_PlaceList_Title";title.style.zIndex=parseInt(Msn.VE.API.Globals.veplacelistpanelzIndex)+1;title.style.width=parseInt(Msn.VE.API.Globals.veplacelistpanelwidth)-5+"px";title.style.top="1px";title.style.left="1px";title.style.height="20px";title.innerHTML=IOSec.EncodeHtml(L_selectlocation_text);title.unselectable="on";this.veplacelistpanel.appendChild(title);var cb=document.createElement("a");cb.className="VE_PlaceList_Close";cb.id=this.m_vemap.ID+"_veplaceListclose";cb.style.zIndex=parseInt(Msn.VE.API.Globals.veplacelistpanelzIndex)+2;cb.style.top="1px";cb.style.right="1px";cb.unselectable="on";cb.innerHTML=L_close_text;this.veplacelistpanel.appendChild(cb);body=document.createElement("div");body.id=this.m_vemap.ID+"_veplacelistbody";body.style.zIndex=300;body.style.height=Msn.VE.API.Globals.veplacelistpanelheight-38+"px";body.style.width=Msn.VE.API.Globals.veplacelistpanelwidth-8+"px";body.className="VE_PlaceList_Body";this.veplacelistpanel.appendChild(body);this.m_vemap.AddControl(this.veplacelistpanel,Msn.VE.API.Globals.veplacelistpanelzIndex)}else body=$ID(this.m_vemap.ID+"_veplacelistbody");var cb=$ID(this.m_vemap.ID+"_veplaceListclose");if(callbackOnClose==true)cb.onclick=function(){eval(veambiglistHide+onSelectCallback+"();")};else cb.onclick=self.Hide;body.innerHTML="";for(var i=0;i<a.length;i++){if(a[i]==null||a[i]=="undefined")continue;var loc=document.createElement("div");loc.id="veplacelistpanel_body_loc"+i;loc.className="VE_PlaceList_Location";loc.style.position="relative";loc.style.zIndex=parseInt(Msn.VE.API.Globals.veplacelistpanelzIndex)+4;loc.unselectable="on";if(a[i].name)if(onSelectCallback!=null&&onSelectCallback!="undefined")loc.innerHTML='<a onclick="javascript:'+veambiglistHide+onSelectCallback+"('"+a[i].name+"', "+a[i].latitude+", "+a[i].longitude+');">'+a[i].name+"</a>";else loc.innerHTML='<a onclick="javascript:'+veambiglistHide+'">'+a[i].name+"</a>";else if(onSelectCallback!=null&&onSelectCallback!="undefined")loc.innerHTML='<a onclick="javascript:'+veambiglistHide+onSelectCallback+"('"+a[i][0].replace("'","\\'")+"', "+a[i][1]+", "+a[i][2]+", "+a[i][3]+", "+a[i][4]+');">'+a[i][0]+"</a>";else loc.innerHTML='<a onclick="javascript:'+veambiglistHide+veambiglistSetViewport+"("+a[i][1]+", "+a[i][2]+", "+a[i][3]+", "+a[i][4]+');">'+a[i][0]+"</a>";body.appendChild(loc)}this.veplacelistpanel.style.display="block";mvcViewFacade.ShowShimIfSupported(this.veplacelistpanel)};this.Hide=function(){if(self.veplacelistpanel!=null&&self.veplacelistpanel!="undefined"){HideShim(self.veplacelistpanel);self.veplacelistpanel.style.display="none"}};this.IsVisible=function(){var a=false;if(this.veplacelistpanel!=null&&this.veplacelistpanel!="undefined"&&this.veplacelistpanel.style.display!="none")a=true;return a};this.Dispose=function(){DestroyShim(self.veplacelistpanel);if(this.veplacelistpanel!=null&&this.veplacelistpanel!="undefined")this.veplacelistpanel=null}}function VEGraphicsManager(G){VEValidator.ValidateObject(G,"vemap",VEMap,"VEMap");var a=this;this._spacecontrol=null;this._hackUniqueLayerId="UniqueLayer_Hack";var Z=null;this._entityIdShapePostfix="_Shape";this.m_vemap=G;this.m_vemapcontrol=this.m_vemap.vemapcontrol;var d=null,o=false,w=1,e=null;this._useOffset=VEShapeAccuracy.None;this._drawOverMaxShapes=VEFailedShapeRequest.DrawInaccurately;this._failRequest=VEFailedShapeRequest.DrawInaccurately;var Y=null,x=null,g=[],b=[],j={},f=false,c=null;this.m_spec=null;var r=null,k=null,l=true,X=Msn.VE.API.Constants.iconurl,s=0,m=new _xy1;this.SetDisplayThreshold=function(a){s=a};this.Initialize=function(){if(this.m_vegraphiccanvas==null||this.m_vegraphiccanvas=="undefined"){this.m_vegraphicspolylines=[];this.m_vegraphicspolygons=[];var b=document.createElement("div");b.id="rootgraphicshape";this.m_vemapcontrol.SetChildDiv(b);this.m_vegraphiccanvas=Msn.Drawing.Graphic.CreateGraphic(b,this.m_vemapcontrol);this.m_vegraphiccanvas.SetZIndex(17);this.m_vemapcontrol.AttachEvent("onstartzoom",a.OnStartZoom);this.m_vemapcontrol.AttachEvent("onchangeview",a.Update);this.m_vemapcontrol.AttachEvent("onmapoffsetreset",a.OnMapOffsetReset);this.m_vemapcontrol.AttachEvent("oninitmode",a.UpdateViewMode);if(window.ero==null||window.ero=="undefined")window.ero=ERO.getInstance()}};this.HideClusterLayers=function(){var d=a.m_vemap.GetShapeLayerCount();for(var c=0;c<d;c++){var b=a.m_vemap.GetShapeLayerByIndex(c);if(b._isClusterLayer){b._originalVisibility=b.GetVisibility();b.SetVisibility(false)}}};this.ShowClusterLayers=function(){var d=a.m_vemap.GetShapeLayerCount();for(var c=0;c<d;c++){var b=a.m_vemap.GetShapeLayerByIndex(c);if(b._isClusterLayer){if(b._originalVisibility){b.SetVisibility(true);b._clusterZoomLevel=null}b._originalVisibility=null}}};this.UpdateViewMode=function(){if(a.m_vemap.GetMapMode()==Msn.VE.MapActionMode.Mode3D){a.HideClusterLayers();a.DrawAll3DPushpins();a.Draw()}else{a.ShowClusterLayers();_spacecontrol=null;a.ClearAll();a.Update()}};this.Update=function(){if(a.m_vemap.GetMapMode()!=Msn.VE.MapActionMode.Mode3D){a.Clear();a.Draw()}o=false};this.OnStartZoom=function(){a.Clear();if(a.m_vemap.GetMapMode()==Msn.VE.MapActionMode.Mode2D){if(!c)return;var h=c.GetCollectionCount();for(var d=0;d<h;d++){var f=c.GetCollectionByIndex(d),g=f.GetShapeCount();for(var e=0;e<g;e++){var b=f.Annotations[e];if(b._isDrawn){a.HideShape(b);a.HideIcon(b)}b._isHiddenForZoom=true}}}};this.OnMapOffsetReset=function(){if(a.m_vemap.GetMapMode()!=Msn.VE.MapActionMode.Mode3D)o=true};this.Clear=function(){if(a.m_vegraphiccanvas!=null&&a.m_vegraphiccanvas!="undefined")a.m_vegraphiccanvas.Clear()};function C(a){var b=false;if(a.minX>e.x1&&a.minY>e.y1&&a.maxX<e.x2&&a.maxY<e.y2)b=true;return b}function M(a){if(typeof a=="undefined"||a.type==VEShapeType.Pushpin)return false;if(a.minX==null||a.minY==null||a.maxX==null||a.maxY==null){var b=null;b=Msn.Drawing.ComputeBoundingBox(a.points);if(b){a.minX=b[0];a.minY=b[1];a.maxX=b[2];a.maxY=b[3]}else return false}var c=true;c=IsRecIntersect(d.x1,d.y1,d.x2,d.y2,a.minX,a.minY,a.maxX,a.maxY);return c}function E(c){if(!C(c)){var a=e;if(a==null)return false;var b=null;b=VE_LineClip.Clip(c.points,a.x1,a.y1,a.x2,a.y2);if(b){c.points=b;return true}}return false}function J(b){if(M(b)){var f=b.points;if(!C(b)){var c=e;if(c==null)return;var d=null;d=VE_LineClip.Clip(f,c.x1,c.y1,c.x2,c.y2);if(d)b.points=d}a.m_vegraphiccanvas.DrawPrimitive(b);b.points=f}}function N(b){a.m_vemap.m_velayermanager=b;c=b.VE_LayerManager;k=c.GetCollectionListDiv();a.m_vemapcontrol.SetChildDiv(k);a.m_spec=new VELatLongFactorySpecFromMap(a.m_vemap);r=new VELatLongFactory(b.m_spec)}function t(c){if(d==null||c){d=GetCurrentMapViewBounds(a.m_vemapcontrol);e=GetBufferedMapViewBounds(w,d)}currentOffetScene=null;if(a.m_vemapcontrol.IsMapViewOblique()){var b=a.m_vemapcontrol.GetObliqueScene();if(b!=null)currentOffetScene=b.GetID()}}function v(){f=false;g=[];b=[];for(var a in j)j[a]=null}function p(a){j[a.GetId()]=null}function n(b){var c=a.m_vemapcontrol.GetObliqueScene();if(a.m_vemapcontrol.IsMapViewOblique()&&c!=null){if(j[b.GetId()]==null){j[b.GetId()]=b;g.push(b)}}else v()}function I(e){try{var o=a.m_vemapcontrol.GetObliqueScene();if(a.m_vemapcontrol.IsMapViewOblique()&&o!=null){var m=o.GetID();if(x!=m){for(var c=0;c<b.length;c++)g.push(b[c]);f=true}else if(e!=null)for(var c=0,d=0;c<b.length&&d<e.length;c++){var k=true,l=[];if(e[d]!=null){var j=a.m_vemapcontrol.PixelToLatLong(e[d],a.m_vemapcontrol.GetZoomLevel());b[c]._OffsetScene=m;b[c]._OffsetLatLong=r.CreateVELatLong(j.latitude,j.longitude);l.push(e[d])}else k=false;if(b[c].GetPrimitive(0).type!=VEShapeType.Pushpin){b[c]._OffsetPoints=[];var i=b[c].GetPrimitive(0).points.length/2,q=[];while(i>0){d++;if(e[d]==null){k=false;d=d+i-1;i=0}else{var j=a.m_vemapcontrol.PixelToLatLong(e[d],a.m_vemapcontrol.GetZoomLevel());b[c]._OffsetPoints.push(r.CreateVELatLong(j.latitude,j.longitude));i--;l.push(e[d])}}}p(b[c]);if(k){h(b[c]);if(b[c]._OffsetCallBack)b[c]._OffsetCallBack(l)}else{b[c]._OffsetScene=null;b[c]._OffsetLatLong=null;b[c]._OffsetPoints=null;if(a._failRequest==VEFailedShapeRequest.DoNotDraw){if(b[c]._OffsetCallBack)b[c]._OffsetCallBack(null)}else if(a._failRequest==VEFailedShapeRequest.DrawInaccurately){b[c]._OffsetScene=-1;h(b[c]);b[c]._OffsetScene=null;if(b[c]._OffsetCallBack)b[c]._OffsetCallBack(null)}else if(a._failRequest==VEFailedShapeRequest.QueueRequest){f=true;n(b[c])};}d++}else for(var c=0;c<b.length;c++){p(b[c]);if(a._failRequest==VEFailedShapeRequest.DoNotDraw){if(b[c]._OffsetCallBack)b[c]._OffsetCallBack(null)}else if(a._failRequest==VEFailedShapeRequest.DrawInaccurately){b[c]._OffsetScene=-1;h(b[c]);b[c]._OffsetScene=null;if(b[c]._OffsetCallBack)b[c]._OffsetCallBack(null)}else if(a._failRequest==VEFailedShapeRequest.QueueRequest){f=true;n(b[c])};}}else v()}catch(s){throw s}finally{b=[];if(f){f=false;a.PushOffsetRequest()}}}this.PushOffsetRequest=function(){var k=a.m_vemapcontrol.GetObliqueScene();if(f||b.length!=0)f=true;else if(!a.m_vemapcontrol.IsMapViewOblique()||k==null)v();else if(g.length>0){var e=Msn.VE.API.Constants.maxasynlatlongs,d=[];while(g.length>0&&e>0){var c=g.shift();if(c.GetPrimitive(0).type!=VEShapeType.Pushpin&&c.GetPrimitive(0).points.length/2>e-1){var j=c.GetPrimitive(0).points;if(j.length/2>Msn.VE.API.Constants.maxasynlatlongs-1){p(c);if(a._drawOverMaxShapes==VEFailedShapeRequest.DoNotDraw){if(c._OffsetCallBack)c._OffsetCallBack(null)}else if(a._drawOverMaxShapes==VEFailedShapeRequest.DrawInaccurately){c._OffsetScene=-1;h(c);if(c._OffsetCallBack)c._OffsetCallBack(null)};}else{g.unshift(c);e=0}}else if(c._OffsetScene!=k.GetID()){b.push(c);d.push(new Msn.VE.LatLong(c.Latitude,c.Longitude));e--;if(c.GetPrimitive(0).type!=VEShapeType.Pushpin){var j=c.GetPrimitive(0).points;for(var i=0;i<j.length;i=i+2){d.push(new Msn.VE.LatLong(j[i+1],j[i]));e--}}}else p(c)}if(g.length>0)f=true;if(d!=null&&d.length>0){x=k.GetID();a.m_vemapcontrol.LatLongToPixelAsync(d,a.m_vemapcontrol.GetZoomLevel(),I)}}};function W(){if(!c)return;MC_MAX_COL_SIZE=200;if(c.GetCollectionCount()<1)return;t();for(var d=0;d<c.GetCollectionCount();d++){var b=c.GetCollectionByIndex(d);if(b){b._index=d;MC_MAX_COL_SIZE=Math.max(MC_MAX_COL_SIZE,b.GetShapeCount());if(!F(b))i(b)}}a.PushOffsetRequest()}function F(b){if(!c)return false;if(b.GetType()==MC_COL_TYPE_TILEIMAGE)return false;b._mapGuid=a.m_vemap.GUID;if(!b.GetVisibility())return false;if(a.m_vemapcontrol.IsMapViewOblique())i(b);V(b);var p=b.GetShapeCount();if(a.m_vemap.GetMapMode()==Msn.VE.MapActionMode.Mode3D){if(VE_CheckModuleStatus(VE_ModuleName.API3D)=="loaded")mvcViewFacade._curMvcView._DrawCollectionLayer(b);return true}var o=a.m_vemapcontrol.GetZoomLevel();if(o>b.MaxScale||o<b.MinScale)return false;t();var f=b.GetBoundingBox();if(p>0&&!IsBoundsIntersect(d,f))return false;if(b.Spec!=null&&b.Spec.IconUrl!=null&&b.Spec.IconUrl!="undefined")X=b.Spec.IconUrl;var g=$ID(b.GetId());if(g==null){g=document.createElement("div");g.setAttribute("id",b.GetId());k.appendChild(g)}var n=true;l=true;if(IsContainedInView(e,f)){l=false;n=IsDisplayShape(a.m_vemap.vemapcontrol,s,f.x1,f.y1,f.x2,f.y2)}for(var m=0;m<p;m++){var j=b.Annotations[m];j._shplayer=b;j.SetIndex(m);if(!h(j,g))q(j);if(!n)break}l=true;return true}function h(b,g){if(b.GetVisibility()&&!b._clustered){if(a.m_vemap.GetMapMode()==Msn.VE.MapActionMode.Mode3D){if(VE_CheckModuleStatus(VE_ModuleName.API3D)=="loaded")mvcViewFacade._curMvcView._DrawEntity(b,null,false,false,b._shplayer);return}var l=a.m_vemapcontrol.GetZoomLevel();if(l>b.maxZoomLevel||l<b.minZoomLevel)return false;t();var i=D(b),j;if(i&&b.GetPrimitive(0).type==VEShapeType.Pushpin&&b._OffsetScene==currentOffetScene){var p=m.Decode(b._OffsetLatLong);j=new VELatLongRectangle(p,p)}else j=b.GetBoundingBox();if(!IsBoundsIntersect(d,j))return false;if(typeof g=="undefined"||g==null)g=H(b.iid);var e=b.GetPrimitive(0),f=null,c=null;if(i)q(b);var h=b._isDrawn;if(e.type!=VEShapeType.Pushpin){var c=null;if(b._isDrawn)if(b._isHiddenForZoom||o){c=u(b,true);a.ShowShape(b)}else c=u(b,false);else{var k=true;k=IsDisplayShape(a.m_vemap.vemapcontrol,s,e.minX,e.minY,e.maxX,e.maxY);if(k){if(i)if(b._OffsetScene==currentOffetScene)try{b.SetUseOffset(true);c=y(a.m_vemapcontrol,e,b.GetIndex(),b.GetTitle())}catch(r){throw r}finally{b.SetUseOffset(false)}else n(b);else c=y(a.m_vemapcontrol,e,b.GetIndex(),b.GetTitle());if(document.all&&c){c.style.zIndex=b.GetZIndexPolyShape();g.appendChild(c)}if(c)h=true;e._shapeElement=c}}}if(b.GetIconVisibility())if(b._isDrawn){if(b._isHiddenForZoom||o){c=B(b);if(c&&e.isLabel)a.ShowIcon(b)}}else{if(b.IconUrl==null)b.IconUrl=Msn.VE.API.Constants.iconurl;f=Q(b);if(f){f.style.zIndex=b.GetZIndex();g.appendChild(f);f.innerHTML=VECreateVEShapeERO(b,a.m_vemap.GUID);e._iconElement=f;h=true}}b._isDrawn=h;b._isHiddenForZoom=false;return h}}function u(f,d){var c=f.GetShapeElement();if(c){var b=f.GetPrimitive(0),g=b.points,e=false;if(l)e=E(b);d=d||e||b._isClipped;c=a.m_vemapcontrol.GetGraphic().UpdatePoints(a.m_vemapcontrol,b,c,d);b.points=g;b._isClipped=e}return c}function B(d){var b=d.GetIconElement();if(b){var c=A(d);if(c){var e=a.m_vemapcontrol.GetPushpinMapPixel(new Msn.VE.LatLong(c.Latitude,c.Longitude),a.m_vemapcontrol.GetZoomLevel());b.style.left=MathRound(e.x)-25/2+"px";b.style.top=MathRound(e.y)-25/2+"px"}else b=null}return b}function R(c){var b=c.GetShapeElement();if(b)b=a.m_vemapcontrol.GetGraphic().UpdateStyle(a.m_vemapcontrol,c.GetPrimitive(0),b);return b}function O(b){var c=b.GetIconElement();if(c){if(b.IconUrl==null)b.IconUrl=Msn.VE.API.Constants.iconurl;c.style.zIndex=b.GetZIndex();c.innerHTML=VECreateVEShapeERO(b,a.m_vemap.GUID)}return c}this.ShowShape=function(b){var a=null;if(b.GetPrimitive(0).type!=VEShapeType.Pushpin){a=b.GetShapeElement();if(a)a.style.display="block"}return a};this.HideShape=function(b){var a=null;if(b.GetPrimitive(0).type!=VEShapeType.Pushpin){a=b.GetShapeElement();if(a)a.style.display="none"}return a};this.ShowIcon=function(b){var a=b.GetIconElement();if(a)a.style.display="block";return a};this.HideIcon=function(b){var a=b.GetIconElement();if(a)a.style.display="none";return a};function Q(d){if(a.m_vemap.GetMapMode()==Msn.VE.MapActionMode.Mode3D)return null;var b=d.GetPrimitive(0),f=null,e=b.iid;if(b.type!=VEShapeType.Pushpin)e=Msn.Drawing.GetLabelUID(b.iid);var c=A(d);if(c!=null)return a.m_vemap.vemapcontrol.AddPushpin(e,c.Latitude,c.Longitude,25,25,"VEAPI_Pushpin",null,Msn.VE.API.Globals.vepushpinpanelzIndex-1,null,true);else return null}function A(a){var b=null;if(D(a))if(a._OffsetScene==currentOffetScene)b=m.Decode(a._OffsetLatLong);else n(a);else b=new VELatLong(a.Latitude,a.Longitude);return b}function D(b){if(a._useOffset==VEShapeAccuracy.None||currentOffetScene==null||b._OffsetScene==-1)return false;else if(a._useOffset==VEShapeAccuracy.Pushpin)return b.GetPrimitive(0).type==VEShapeType.Pushpin;else if(a._useOffset==VEShapeAccuracy.All)return true;else return false}function y(c,a,g,f){if(!a||!a.points||a.points.length<1||typeof a.points[0]=="undefined")return;if(a.type==VEShapeType.Pushpin&&(a.symbol==null||a.symbol!=null&&a.symbol.id==MC_PROPERTY_PUSHPIN))a.symbol=VE_MapDispatch_SymbolLib.GetMapSymbolByID(MC_PROPERTY_PUSHPIN);else if(a.symbol==null){var b=VE_MapDispatch_SymbolLib.GetCurrentDefaultSymbol();if(b)a.symbol=b.Clone()}var e=a.points,d=null;if(l)a._isClipped=E(a);d=c.GetGraphic().CreatePrimitive(c,a,f);a.points=e;return d}function U(){if(!c)return;var b=c.GetCollectionCount();if(b<1)return;for(var a=0;a<b;a++){var d=c.GetCollectionByIndex(a);i(d)}}function i(b){if(a.m_vemap.GetMapMode()==Msn.VE.MapActionMode.Mode3D)if(VE_CheckModuleStatus(VE_ModuleName.API3D)=="loaded")mvcViewFacade._curMvcView._ClearCollectionLayer(b);if(b.GetType()==MC_COL_TYPE_TILEIMAGE)return;var c=null;c=$ID(b.GetId());if(c==null)return null;if(!document.all||c&&c.hasChildNodes()){var e=b.GetShapeCount();for(var d=0;d<e;d++)q(b.Annotations[d]);c.innerHTML=""}if(b._clusterLayer)i(b._clusterLayer);return c}function q(b){if(a.m_vemap.GetMapMode()==Msn.VE.MapActionMode.Mode3D)if(VE_CheckModuleStatus(VE_ModuleName.API3D)=="loaded")mvcViewFacade._curMvcView._ClearEntity(b);z(b.GetPrimitive(0));b._isDrawn=false;b._isHiddenForZoom=false}function z(d){var a=null,b=null,e=d.iid;if(d.type!=VEShapeType.Pushpin){e=Msn.Drawing.GetLabelUID(d.iid);b=$ID(d.iid);if(b&&b.parentNode)b.parentNode.removeChild(b)}a=$ID(e);if(!a)return null;a.detachEvent("onmouseover",VEShowVEShapeERO);a.detachEvent("onmouseout",VEHideVEShapeERO);a.detachEvent("onclick",VEShowVEShapeERO);a.parentNode.removeChild(a);var c=a.vePushpin;if(typeof c!="undefined"&&c!=null){c.Destroy();c.innerHtml="";c=null}}function H(b){var a=c.ParseInternalID(b);if(a&&a[1])return parentElement=S(a[1],false,k);else return k}function S(b,d,c){var a=null;a=$ID(b);if(a&&d)a.innerHTML="";if(!a){a=document.createElement("div");a.setAttribute("id",b);c.appendChild(a)}return a}this.InitLayerManager=N;this.DrawAll=W;this.DrawLayer=F;this.DrawEntity=h;this.ClearAll=U;this.ClearLayerDom=i;this.ClearPrimitiveDom=z;this.ClearEntityDom=q;this.UpdatePoints=u;this.UpdateIconPoints=B;this.UpdateStyle=R;this.UpdateIconStyle=O;this.Draw=function(){d=GetCurrentMapViewBounds(a.m_vemapcontrol);e=GetBufferedMapViewBounds(w,d);if(!document.all)a.m_vemapcontrol.resetSvgLayer();VE_LatLongThreshold.IsNotInit=true;a.DrawAll();if(a.m_vegraphicspolylines!=null&&a.m_vegraphicspolylines.length>0){var c=a.m_vegraphicspolylines.length;for(var b=0;b<c;b++){var f=a.m_vegraphicspolylines[b];a.DrawOne(f,true,e)}}if(a.m_vegraphicspolygons!=null&&a.m_vegraphicspolygons.length>0){var h=a.m_vegraphicspolygons.length;for(var b=0;b<h;b++){var g=a.m_vegraphicspolygons[b];a.DrawOne(g,false,e)}}};this.DrawOne=function(b,i,k){if(typeof b=="undefined"||b==null)return;if(a.m_vemap.GetMapMode()==Msn.VE.MapActionMode.Mode3D){T(b,i,k);return}else a._spacecontrol=null;if(k==null){d=GetCurrentMapViewBounds(a.m_vemapcontrol);e=GetBufferedMapViewBounds(w,d)}a.m_vegraphiccanvas.resetOffset();var j=b.GetLatLongs(),c=[];for(var g=0;g<j.length;g++){var h=m.Decode(j[g]);c.push(parseFloat(h.Longitude));c.push(parseFloat(h.Latitude))}var f;if(i)f=new Msn.Drawing.PolyLine(c);else f=new Msn.Drawing.Polygon(c);a.m_vegraphiccanvas.SetZIndex(17);a.m_vegraphiccanvas.SetStroke(b.Stroke);J(f)};function T(d,g){if(typeof d=="undefined"||d==null)return;if(!a._spacecontrol)a._spacecontrol=a.m_vemapcontrol.Get3DControl();var l=d.GetLatLongs(),e=[];for(var h=0;h<l.length;h++){var i=m.Decode(l[h]);e.push(i.Longitude);e.push(i.Latitude)}var f;if(g)f=new Msn.Drawing.PolyLine(e);else f=new Msn.Drawing.Polygon(e);a.m_vegraphiccanvas.SetZIndex(17);a.m_vegraphiccanvas.SetStroke(d.Stroke);var o=d.ID,n=a._hackUniqueLayerId,k=ConvertPointArrayToView3DParameter(f.points),c=GetPrimitiveSymbolOrDefault(f,d.Stroke),p=ConvertStrokeWeightToView3DParameter(c.stroke_weight),b="Linecolor='"+c.stroke_color+"'"+" Lineweight='"+p+"'"+" Dashstyle='"+c.stroke_dashstyle+"'"+" Lineopacity='"+c.stroke_opacity+"'",j=o+a._entityIdShapePostfix;if(g)a._spacecontrol.AddPolylineWithProperties(n,j,k,b);else if(!g){b=b.concat(" Fillcolor='",c.fill_color,"'");b=b.concat(" Fillopacity='",c.fill_opacity,"'");b=b.concat(" Lineopacity='",c.stroke_opacity,"'");a._spacecontrol.AddPolygonWithProperties(n,j,k,b)}}function V(b){if(!b._isClusterLayer){var d;if(a.m_vemap.GetMapMode()!=Msn.VE.MapActionMode.Mode3D&&b._clusteringAlgorithm!=null){var h=a.m_vemap.GetZoomLevel(),j=a.m_vemap.GetMapMode(),i=a.m_vemap.GetMapStyle();if(!b._clusterLayer)b.CreateClusterLayer();if(!b._clusterLayer._clusterZoomLevel||b._clusterLayer._clusterZoomLevel!=h||b._clusterLayer._mapMode!=j||b._clusterLayer._mapStyle!=i){for(var c=0;c<b.Annotations.length;c++)b.Annotations[c]._clustered=false;b._clusterLayer._clusterZoomLevel=h;b._clusterLayer._mapMode=j;b._clusterLayer._mapStyle=i;b._clusterLayer.DeleteAllShapes();if(b._clusteringAlgorithm!=null)d=b._clusteringAlgorithm(b);if(d!=null)for(var c=0;c<d.length;c++){var e=d[c];if(e.Shapes&&e.Shapes.length>0)L(e,b._clusteringOptions)}if(b._clusteringOptions&&b._clusteringOptions.Callback)clusterDescription=b._clusteringOptions.Callback(d);var f=[];for(var c=0;c<d.length;c++){var g=d[c].GetClusterShape();if(g!=null)f.push(g)}b._clusterLayer.AddShapes(f);d=null}}else{if(b._clusterLayer)a.ClearLayerDom(b._clusterLayer);for(var c=0;c<b.Annotations.length;c++){b.Annotations[c]._clustered=false;if(b.Annotations[c]._sort)b.Annotations[c]._sort=null}}}}function L(a,f){if(a!=null){var c=a.Shapes.length,d=0,e=0;for(var b=0;b<c;b++){a.Shapes[b]._clustered=true;var j=parseFloat(a.Shapes[b].Primitives[0].points[1]),k=parseFloat(a.Shapes[b].Primitives[0].points[0]);d+=j;e+=k}if(!a.LatLong&&c>0){var h=d/c,i=e/c;a.LatLong=new VELatLong(h,i)}var g=new VEShape(VEShapeType.Pushpin,a.LatLong);a._clusterShape=g;P(a,f);K(a)}}function P(a,b){if(a!=null&&a._clusterShape!=null)if(b&&b.Icon)a._clusterShape.SetCustomIcon(b.Icon);else a._clusterShape.SetCustomIcon(Msn.VE.API.Constants.clustericonurl)}function K(b){if(b!=null&&b._clusterShape!=null){var d=L_ClusterDefaultTitle_Text.replace(/%1/g,b.Shapes.length);b._clusterShape.SetTitle(d);var c=a.m_vemap.vemapcontrol.GetCurrentMode();if(c&&a.m_vemap.GetZoomLevel()<c.GetCurrentMaxZoomLevel(a.m_vemap.vemapcontrol.GetCurrentMapView()))b._clusterShape.SetDescription(L_ClusterDefaultDescription_Text)}}}VEGraphicsManager.prototype.RemoveLine=function(a){this.RemoveLinebyId(a.ID)};VEGraphicsManager.prototype.RemoveLinebyId=function(b){if(this.m_vegraphiccanvas==null||this.m_vegraphiccanvas=="undefined"){throw new VEException("VEMap:RemoveLinebyId","err_GraphicsInitError",L_GraphicsInitError_Text);return}var c=this.m_vegraphicspolylines.length,a=0;while(a<c&&b!=this.m_vegraphicspolylines[a].ID)a++;if(a<c)this.m_vegraphicspolylines.splice(a,1);else{throw new VEException("VEMap:RemoveLinebyId","err_GraphicsInitError",L_invalidpolylineid_text);return}if(this.m_vemap.GetMapMode()==Msn.VE.MapActionMode.Mode3D)this.Clear3DShape(b);else{this.Clear();this.Draw()}};VEGraphicsManager.prototype.RemoveAllLines=function(){if(this.m_vemap.GetMapMode()==Msn.VE.MapActionMode.Mode3D)this.ClearAll3DShape();this.m_vegraphicspolylines=[];this.Clear();this.Draw()};VEGraphicsManager.prototype.DrawLine=function(a){if(this.m_vegraphiccanvas==null||this.m_vegraphiccanvas=="undefined"){throw new VEException("VEMap:DrawLine","err_GraphicsInitError",L_GraphicsInitError_Text);return}VEValidator.ValidateObject(a,"vePolyline",VEPolyline,"VEPolyline");var c=this.m_vegraphicspolylines.length;for(var b=0;b<c;b++)if(a.ID==this.m_vegraphicspolylines[b].ID)throw new VEException("VEMap:DrawLine","err_invalidpolylineid",L_invalidpolylineid_text);this.m_vegraphicspolylines.push(a);this.DrawOne(a,true)};VEGraphicsManager.prototype.RemovePolygon=function(a){this.RemovePolygonbyId(a.ID)};VEGraphicsManager.prototype.RemovePolygonbyId=function(b){if(this.m_vegraphiccanvas==null||this.m_vegraphiccanvas=="undefined"){throw new VEException("VEMap:RemovePolygonbyId","err_GraphicsInitError",L_GraphicsInitError_Text);return}var c=this.m_vegraphicspolygons.length,a=0;while(a<c&&b!=this.m_vegraphicspolygons[a].ID)a++;if(a<c)this.m_vegraphicspolygons.splice(a,1);else{throw new VEException("VEMap:RemovePolygonbyId","err_GraphicsInitError",L_invalidpolygonid_text);return}if(this.m_vemap.GetMapMode()==Msn.VE.MapActionMode.Mode3D)this.Clear3DShape(b);else{this.Clear();this.Draw()}};VEGraphicsManager.prototype.RemoveAllPolygons=function(){if(this.m_vemap.GetMapMode()==Msn.VE.MapActionMode.Mode3D)this.ClearAll3DShape();this.m_vegraphicspolygons=[];this.Clear();this.Draw()};VEGraphicsManager.prototype.DrawPolygon=function(a){if(this.m_vegraphiccanvas==null||this.m_vegraphiccanvas=="undefined"){throw new VEException("VEMap:DrawPolygon","err_GraphicsInitError",L_GraphicsInitError_Text);return}VEValidator.ValidateObject(a,"vePolygon",VEPolygon,"VEPolygon");var c=this.m_vegraphicspolygons.length;for(var b=0;b<c;b++)if(a.ID==this.m_vegraphicspolygons[b].ID)throw new VEException("VEMap:DrawPolygon","err_invalidpolygonid",L_invalidpolygonid_text);this.m_vegraphicspolygons.push(a);this.DrawOne(a,false)};VEGraphicsManager.prototype.Dispose=function(){if(this.m_vegraphiccanvas!=null){this.m_vegraphiccanvas.Clear();this.m_vegraphiccanvas.Destroy();this.m_vegraphiccanvas=null}if(this.m_vegraphicspolylines!=null&&this.m_vegraphicspolylines!="undefined"){var b=this.m_vegraphicspolylines.length;for(var a=0;a<b;a++)this.m_vegraphicspolylines.pop().Dispose()}if(this.m_vegraphicspolygons!=null&&this.m_vegraphicspolygons!="undefined"){var c=this.m_vegraphicspolygons.length;for(var a=0;a<c;a++)this.m_vegraphicspolygons.pop().Dispose()}if(this.m_vemap!=null){this.m_vemapcontrol.DetachEvent("onchangeview",this.Update);this.m_vemapcontrol.DetachEvent("onobliquechange",this.Update);this.m_vemapcontrol.DetachEvent("onstartzoom",this.Clear)}};VEGraphicsManager.prototype.DrawAll3DPushpins=function(){if(this.m_vemap.GetMapMode()!=Msn.VE.MapActionMode.Mode3D)return;if(!this.m_vemap.pushpins)return;if(typeof this._spacecontrol=="undefined"||this._spacecontrol==null)this._spacecontrol=this.m_vemapcontrol.Get3DControl();if(!this._spacecontrol)return;var c=this.m_vemap.pushpins,e=c.length;for(var a=0;a<e;a++){var b=c[a],d=b.LatLong;this.Add3DPushpin(b.ID,d.Latitude,d.Longitude,25,25,"VEAPI_Pushpin",b,Msn.VE.API.Globals.vepushpinpanelzIndex-1)}};VEGraphicsManager.prototype.Add3DPushpin=function(b,e,f,n,l,g,d,m){var h=f,j=e,k=this._hackUniqueLayerId,o='text=""',c;c=GetImageFullUrl(d.Iconurl);var i=b;this.m_vemapcontrol.Get3DControl().AddPointWithProperties(k,i,j,h,c,o);var a=null;if(!$ID(b)){a=this.m_vemapcontrol.AddPushpin(b,e,f,n,l,g,d.GetContent(),m,"VEAPI_Pushpin",false,false);if(a)a.style.display="none"}};VEGraphicsManager.prototype.Remove3DPushpin=function(a){if(typeof this._spacecontrol=="undefined"||this._spacecontrol==null)this._spacecontrol=this.m_vemapcontrol.Get3DControl();this.Clear3DShape(a);this.m_vemapcontrol.RemovePushpin(a)};VEGraphicsManager.prototype.ClearAllPushpins=function(b){if(typeof this._spacecontrol=="undefined"||this._spacecontrol==null)this._spacecontrol=this.m_vemapcontrol.Get3DControl();var d=b.length;for(var c=0;c<d;c++){var a=b.pop();if(!a.IsInLayer){this.Clear3DShape(a.ID);a.Dispose()}}this.m_vemapcontrol.ClearPushpins()};VEGraphicsManager.prototype.ClearAll3DShape=function(){var c=null,b=0;if(this.m_vegraphicspolylines!=null&&this.m_vegraphicspolylines!="undefined"){b=this.m_vegraphicspolylines.length;for(var a=0;a<b;a++){c=this.m_vegraphicspolylines[a];this.Clear3DShape(c.ID)}}if(this.m_vegraphicspolygons!=null&&this.m_vegraphicspolygons!="undefined"){b=this.m_vegraphicspolygons.length;for(var a=0;a<b;a++){c=this.m_vegraphicspolygons[a];this.Clear3DShape(c.ID)}}};VEGraphicsManager.prototype.Clear3DShape=function(c){var a=c;this._spacecontrol.DeleteGeometry(this._hackUniqueLayerId,a);var b=a+this._entityIdShapePostfix;this._spacecontrol.DeleteGeometry(this._hackUniqueLayerId,b)};function ConvertPointArrayToView3DParameter(a){var b="",c=a.length;for(i=0;i<c;i+=2){var d=a[i],e=a[i+1];b+=d+","+e+" "}return b}function ConvertStrokeWeightToView3DParameter(a){if(a==null)return "";var c=a.length,b=a.substring(0,c-2);return b+"px"}function GetPrimitiveSymbolOrDefault(c,b){var a=c.symbol;if(a==null){if(typeof b!="undefined"){c.symbol=new VEShapeStyle;a=c.symbol;a.stroke_weight=b.width+"pt";a.joinstyle=b.linejoin;a.stroke_color=b.color.ToHexString();a.stroke_dashstyle=b.linecap;a.stroke_opacity=b.color.A.toString();a.fill_color=b.fillcolor.ToHexString();a.fill_opacity=b.fillcolor.A.toString();return a}else if(_defaultSymbol==null){_defaultSymbol=new VEShapeStyle;_defaultSymbol.id=MC_PROPERTY_DEFAULT;c.symbol=_defaultSymbol}return _defaultSymbol}return a}function VELatLong(b,a,c,d){this.Latitude=null;this.Longitude=null;this.Altitude=null;this.AltitudeMode=null;this._reserved=null;if(b!=null){VEValidator.ValidateFloat(b,"latitude");this.Latitude=b}if(a!=null){VEValidator.ValidateFloat(a,"longitude");this.Longitude=a}if(c!=null)this.SetAltitude(c,d)}VELatLong.prototype.SetAltitude=function(b,a){VEValidator.ValidateFloat(b,"altitude");this.Altitude=b;if(a!=null){VEValidator.ValidateAltitudeMode(a,"altitudeMode");this.AltitudeMode=a}else this.AltitudeMode=VEAltitudeMode.Default};VELatLong.prototype.HasAltitude=function(){return this.Altitude!=null};function Clone(){var a=new VELatLong;a.Latitude=this.Latitude;a.Longitude=this.Longitude;a._reserved=this._reserved;a.Altitude=this.Altitude;a.AltitudeMode=this.AltitudeMode;return a}function toString(){var a="";if(this.Latitude!=null&&this.Longitude!=null)a=this.Latitude+", "+this.Longitude;if(this.Altitude!=null)a+=", "+this.Altitude;return a}VELatLong.prototype.toString=toString;VELatLong.prototype.Clone=Clone;function VELatLongRectangle(d,c,b,a){VEValidator.ValidateObject(d,"topLeftLatLong",VELatLong,"VELatLong");VEValidator.ValidateObject(c,"bottomRightLatLong",VELatLong,"VELatLong");this.TopLeftLatLong=d;this.BottomRightLatLong=c;if(b!=null&&b!="undefined"){VEValidator.ValidateObject(b,"topRightLatLong",VELatLong,"VELatLong");this.TopRightLatLong=b}if(a!=null&&a!="undefined"){VEValidator.ValidateObject(a,"bottomLeftLatLong",VELatLong,"VELatLong");this.BottomLeftLatLong=a}}VEAltitudeMode=new function(){this.Default="Ground";this.Absolute="Datum";this.RelativeToGround="Ground"};function _xy1(){var a=new _xz1;this.Decode=function(c){VEValidator.ValidateObject(c,"veLatLong",VELatLong,"VELatLong");var b=c.Clone();if(b.Latitude==null||b.Longitude==null&&b._reserved!=null){var d=a.Decode(b._reserved);b.Latitude=d[0];b.Longitude=d[1];b._reserved=null}return b}}function VELatLongFactoryAlwaysEncodeSpec(){this.IsEncode=function(){return true}}function VELatLongFactorySpecFromMap(a){VEValidator.ValidateObject(a,"vemap",VEMap,"VEMap");var b=a;this.IsEncode=function(){var a=b.GetMapStyle();return a==VEMapStyle.Birdseye||a==VEMapStyle.BirdseyeHybrid}}function VELatLongFactorySpecFromMapView(a){VEValidator.ValidateNonNull(a,"mapView");var b=a;this.IsEncode=function(){return Msn.VE.MapStyle.IsViewOblique(b.mapStyle)}}function VELatLongFactory(a){VEValidator.ValidateNonNull(a,"veLatLongFactorySpec");var c=a,b=new _xz1;this.CreateVELatLong=function(e,d){var a=null;if(c.IsEncode()){a=new VELatLong;a._reserved=b.Encode(e,d)}else a=new VELatLong(e,d);return a}}function VEPolyline(d,c,a,b){VEValidator.ValidateNonNull(d,"id");VEValidator.ValidateNonNull(c,"arrVELatLong");this.ID=d;this.LatLongs=c;this.Stroke=new Msn.Drawing.Stroke;if(a==null||a=="undefined")a=new VEColor(17,221,17,.7);this.SetColor(a);if(b==null||b=="undefined")b=6;this.SetWidth(b)}function SetColor(a){VEValidator.ValidateNonNull(a);this.Stroke.color=new Msn.Drawing.Color(a.R,a.G,a.B,a.A)}function SetWidth(a){VEValidator.ValidateInt(a,"width");this.Stroke.width=a}function GetLatLongs(){return this.LatLongs}function Dispose(){this.ID=null;this.LatLongs=null;this.Stroke=null}VEPolyline.prototype.SetColor=SetColor;VEPolyline.prototype.SetWidth=SetWidth;VEPolyline.prototype.GetLatLongs=GetLatLongs;VEPolyline.prototype.Dispose=Dispose;function VEPolygon(e,d,c,a,b){VEValidator.ValidateNonNull(e,"id");VEValidator.ValidateNonNull(d,"arrVELatLong");this.ID=e;this.LatLongs=d;this.Stroke=new Msn.Drawing.Stroke;if(c==null||c=="undefined")c=new VEColor(17,221,17,.7);this.SetFillColor(c);if(a==null||a=="undefined")a=new VEColor(17,221,17,.7);this.SetOutlineColor(a);if(b==null||b=="undefined")b=6;this.SetOutlineWidth(b)}function SetFillColor(a){VEValidator.ValidateNonNull(a);this.Stroke.fillcolor=new Msn.Drawing.Color(a.R,a.G,a.B,a.A)}function SetOutlineColor(a){VEValidator.ValidateNonNull(a);this.Stroke.color=new Msn.Drawing.Color(a.R,a.G,a.B,a.A)}function SetOutlineWidth(a){VEValidator.ValidateInt(a,"width");this.Stroke.width=a}function GetLatLongs(){return this.LatLongs}function Dispose(){this.ID=null;this.LatLongs=null;this.Stroke=null}VEPolygon.prototype.SetFillColor=SetFillColor;VEPolygon.prototype.SetOutlineColor=SetOutlineColor;VEPolygon.prototype.SetOutlineWidth=SetOutlineWidth;VEPolygon.prototype.GetLatLongs=GetLatLongs;VEPolygon.prototype.Dispose=Dispose;function VEColor(d,c,b,a){VEValidator.ValidateInt(d,"r");VEValidator.ValidateBetween(d,"r",0,255);VEValidator.ValidateInt(c,"g");VEValidator.ValidateBetween(c,"g",0,255);VEValidator.ValidateInt(b,"b");VEValidator.ValidateBetween(b,"b",0,255);VEValidator.ValidateFloat(a,"a");VEValidator.ValidateBetween(a,"a",0,1);Msn.Drawing.Color.call(this,d,c,b,a)}var L_integerencodingoutofrange_text="VEIntegerEncoding: The number encoded is out of supported range",L_floatintegermapencodingoutofrange_text="VEFloatIntegerMap: The number encoded is out of supported range",L_integerencodinginvalidstringlength_text="VEIntegerEncoding: Invalid string length",L_integerencodingunknowndigit_text="VEIntegerEncoding: The encoded string has an unknown digit";function VEIntegerEncoding(g,j){var e=g,d=g.length,a=j,h=1;for(var i=0;i<a;++i)h*=d;var f=h-1,c=[];for(var b=0;b<e.length;++b)c[e.substr(b,1)]=b;this.MaxValue=function(){return f};this.ValueLength=function(){return a};this.Encode=function(c){if(c<=f){var h="",g=[];for(var b=0;b<a;++b)g[b]=0;var i=a-1;while(c>0){g[i]=Math.floor(c%d);c=Math.floor(c/d);--i}for(var b=0;b<g.length;++b)h+=e.substr(g[b],1);return h}else throw L_integerencodingoutofrange_text};this.Decode=function(c){if(c.length==a){var b=0;for(var e=0;e<c.length;++e){b*=d;b+=this.DigitValue(c.substr(e,1))}return b}else throw L_integerencodinginvalidstringlength_text};this.DigitValue=function(a){if(c[a]!=null&&c[a]!="undefined")return c[a];else throw L_integerencodingunknowndigit_text}}function VEFloatIntegerMap(e,d,f){var a=e,c=d,b=f;this.MinFloat=function(){return a};this.MaxFloat=function(){return c};this.MaxInt=function(){return b};this.FloatToInt=function(d){if(d>=a&&d<=c){var e=(d-a)/(c-a),f=e*b+.5;return Math.min(Math.floor(f),b)}else throw L_floatintegermapencodingoutofrange_text};this.IntToFloat=function(d){if(d<=b){var f=d/b,e=a+f*(c-a);return e}else throw L_floatintegermapencodingoutofrange_text}}var L_velatlongencodinginvalidstringlength_text="_xz1: Invalid string length";function _xz1(b){var i=-90,h=90,g=-180,f=180,j="0123456789bcdfghjkmnpqrstvwxyz",e=6;if(b!=null&&typeof b!="undefined")e=b;var a=new VEIntegerEncoding(j,e),d=new VEFloatIntegerMap(i,h,a.MaxValue()),c=new VEFloatIntegerMap(g,f,a.MaxValue());this.Encode=function(e,b){var f=a.Encode(d.FloatToInt(e))+a.Encode(c.FloatToInt(b));return f};this.Decode=function(f){if(f.length==2*a.ValueLength()){var e=a.ValueLength(),j=f.substr(0,e),h=f.substr(e,e),i=a.Decode(j),g=a.Decode(h),b=[];b[0]=d.IntToFloat(i);b[1]=c.IntToFloat(g);return b}else throw L_velatlongencodinginvalidstringlength_text}}function _xz1ForMobile(){_xz1.call(this,5)}VEMapMode=new function(){this.Mode2D=1;this.Mode3D=2};function VEMapViewSpecification(c,d,e,g,f){this.LatLong=null;this.ZoomLevel=null;this.Altitude=null;this.Pitch=null;this.Heading=null;if(c!=null&&c!="undefined"){VEValidator.ValidateObject(c,"veLatLong",VELatLong,"VELatLong");this.LatLong=c}if(d!=null&&d!="undefined"){VEValidator.ValidateNonNegativeInt(d,"zoomLevel");this.ZoomLevel=d}if(e!=null&&e!="undefined"){VEValidator.ValidateFloat(e,"altitude");this.Altitude=parseFloat(e)}if(g!=null&&g!="undefined"){VEValidator.ValidateFloat(g,"pitch");var a=parseFloat(g);a=a%360;if(a<-90)a=-90;if(a>90)a=90;this.Pitch=a}if(f!=null&&f!="undefined"){VEValidator.ValidateFloat(f,"heading");var b=parseFloat(f);b=b%360;if(b<0)b+=360;this.Heading=b}}function MapViewSpecClone(){var a=new VEMapViewSpecification;a.LatLong=this.LatLong.Clone();a.Altitude=this.Altitude;a.Pitch=this.Pitch;a.Heading=this.Heading;return veLatLong}VEMapViewSpecification.prototype.Clone=MapViewSpecClone;VEMapStyle=new function(){this.Road=Msn.VE.MapStyle.Road;this.Shaded=Msn.VE.MapStyle.Shaded;this.Aerial=Msn.VE.MapStyle.Aerial;this.Hybrid=Msn.VE.MapStyle.Hybrid;this.Oblique=Msn.VE.MapStyle.Oblique;this.Birdseye=Msn.VE.MapStyle.Oblique;this.BirdseyeHybrid=Msn.VE.MapStyle.ObliqueHybrid};VEOrientation=new function(){this.North=Msn.VE.Orientation.North;this.East=Msn.VE.Orientation.East;this.West=Msn.VE.Orientation.West;this.South=Msn.VE.Orientation.South};function VEBirdseyeScene(d){VEValidator.ValidateNonNull(d,"obliqueScene");var a=d,f=null,c=null,e=new VELatLongFactory(new VELatLongFactoryAlwaysEncodeSpec),b=new _xy1;this.PixelToLatLong=function(d,b,f){if(b!=null){VEValidator.ValidateNonNegativeInt(b,"zoomLevel");b=parseInt(b)}else b=VEMap._GetMapFromGUID(c).GetZoomLevel();if(f){VEValidator.ValidateObjectArray(d,"pixelArray",VEPixel,"VEPixel array");VEValidator.ValidateFunction(f,"callback");this.PixelToLatLongAsync(d,b,f)}else{VEValidator.ValidateObject(d,"pixel",VEPixel,"VEPixel");var g=a.PixelToLatLong(d,b);return e.CreateVELatLong(g.latitude,g.longitude)}};this.PixelToLatLongAsync=function(b,c,d){a.PixelToLatLongAsync(b,c,d)};this.LatLongToPixel=function(e,d,f){if(d!=null){VEValidator.ValidateNonNegativeInt(d,"zoomLevel");d=parseInt(d)}else d=VEMap._GetMapFromGUID(c).GetZoomLevel();if(f){VEValidator.ValidateObjectArray(e,"veLatLongArray",VELatLong,"VELatLong array");VEValidator.ValidateFunction(f,"callback");this.LatLongToPixelAsync(e,d,f)}else{VEValidator.ValidateObject(e,"veLatLong",VELatLong,"VELatLong");var g=b.Decode(e),h=new Msn.VE.LatLong(g.Latitude,g.Longitude);return a.LatLongToPixel(h,d)}};this.LatLongToPixelAsync=function(e,g,h){var f=[];for(var c=0;c<e.length;++c){var d=b.Decode(e[c]);f[c]=new Msn.VE.LatLong(d.Latitude,d.Longitude)}a.LatLongToPixelAsync(f,g,h)};this.IsValidTile=function(c,d,b){return a.IsValidTile(c,d,b)};this.GetID=function(){return a.GetID()};this.GetTileFilename=function(){return a.GetTileFilename()};this.GetThumbnailFilename=function(){return a.GetThumbnailFilename()};this.GetOrientation=function(){return a.GetOrientation()};this.GetBounds=function(){return a.GetBounds()};this.GetWidth=function(){return a.GetWidth()};this.GetHeight=function(){return a.GetHeight()};this.ContainsLatLong=function(d){VEValidator.ValidateObject(d,"veLatLong",VELatLong,"VELatLong");var c=b.Decode(d),e=new Msn.VE.LatLong(c.Latitude,c.Longitude);return a.ContainsLatLong(e)};this.ContainsPixel=function(d,e,b){var c=new VEPixel(d,e);return a.ContainsPixel(c,b)};this.SetClientToken=function(b){f=b;a.SetClientToken(b)};this.SetGUID=function(b){c=b;a.SetGUID(b)};this.GetBoundingRectangle=function(){var g=a.PixelToLatLong(new VEPixel(0,0),2),h=a.PixelToLatLong(new VEPixel(a.GetWidth(),a.GetHeight()),2),i=null;if(g&&h){var b=100,c=g.latitude,d=h.latitude,e=g.longitude,f=h.longitude;if(c<d){c=Math.floor(c*b)/b;d=Math.ceil(d*b)/b}else{c=Math.ceil(c*b)/b;d=Math.floor(d*b)/b}if(e<f){e=Math.floor(e*b)/b;f=Math.ceil(f*b)/b}else{e=Math.ceil(e*b)/b;f=Math.floor(f*b)/b}i=new VELatLongRectangle(new VELatLong(c,e),new VELatLong(d,f))}return i};this.GetBoundingRectangleNorthFacing=function(){var b=this.GetBoundingRectangle(),c=null;switch(a.GetOrientation()){case Msn.VE.Orientation.East:c=new VELatLongRectangle(new VELatLong(b.TopLeftLatLong.Latitude,b.BottomRightLatLong.Longitude),new VELatLong(b.BottomRightLatLong.Latitude,b.TopLeftLatLong.Longitude));break;case Msn.VE.Orientation.South:c=new VELatLongRectangle(new VELatLong(b.BottomRightLatLong.Latitude,b.BottomRightLatLong.Longitude),new VELatLong(b.TopLeftLatLong.Latitude,b.TopLeftLatLong.Longitude));break;case Msn.VE.Orientation.West:c=new VELatLongRectangle(new VELatLong(b.BottomRightLatLong.Latitude,b.TopLeftLatLong.Longitude),new VELatLong(b.TopLeftLatLong.Latitude,b.BottomRightLatLong.Longitude));break;default:c=b}return c}}VEMap.prototype.__HandleAuthentication=function(a){if(this.vemapcontrol)this.vemapcontrol.__HandleAuthentication(a)};function $VE_A(){}$VE_A.PgName={Ads:"Ads Response",AdsListing:"Ads",Business:"Business Listing",BusinessWebsite:"Business Website",Call:"Click to Call",CategoryBrowser:"Category Browser",Collection:"Collections",ColBrowser:"Collection Browser",DD:"Driving Directions",Default:"Default",Details:"Details",Email:"Email",ERO:"ERO",Fav:"Favorites",Help:"Help",Home:"Home Page",LLC:"Local Listing Center",MAB:"Map Action Bar",Map:"Map Control",Mobile:"Send to Mobile",Car:"Send To Car",PartyMap:"Party Map",PersonalLocations:"Personal Locations",PLink:"Permalink",Print:"Print",SP:"Scratchpad",SReq:"Search Request",SRes:"Search Response",Traffic:"Traffic",WIP:"Welcome Panel",Inst3D:"Install 3D",Model3D:"3D Models",Quality3D:"3D Performance Options",Movie3D:"Movie Tour",HiRes3D:"3D HiRes",TD:"Transit Directions",YP:"YellowPages"};$VE_A.MapMode=["ModeUnknown","Mode2D","Mode3D","ModeOblique"];$VE_A.analyticsEnabled=Msn.VE.API?false:true;$VE_A.logDelay=500;$VE_A.LogHelp=function(){$VE_A.Log($VE_A.PgName.Help,"Help")};function TrimLocationName(a){if(typeof a!="undefined"&&a!=null){var b=a.toString();if(b.indexOf("Location")>0)return b.replace("Location","");else return "MRU"}return ""}$VE_A.last3DPanTimestamp=0;function $VE_A_FireLog3DPan(){var a=(new Date).getTime();if(a-$VE_A.last3DPanTimestamp>=2000){$VE_A.last3DPanTimestamp=a;$VE_A.Log($VE_A.PgName.Map,"3D PAN")}}$VE_A.LogCategoryBrowser=function(a){if(a==null||typeof a=="undefined")return;if(a.EntryPoint!=null)s.prop17=a.EntryPoint;if(a.CategoryMode!=null)s.eVar13=a.CategoryMode;if(a.SearchId!=null)s.eVar15=a.SearchId;var b;if(a.IsSearchRequest){s.events="Event8";b=$VE_A.PgName.SReq;s.eVar24="Category"}else b=$VE_A.PgName.CategoryBrowser;if(a.CategoryId!=null)s.eVar14=a.CategoryId;$VE_A.Log(b,a.NavAction)};$VE_A.LogSearchResponse=function(a){if(a==null||typeof a=="undefined")return;s.events="Event10";if(a.CenterPoint!=null)$VE_A.SetProperties(null,map.GetMapMode()==Msn.VE.MapActionMode.ModeOblique?1:map.GetZoomLevel(),a.CenterPoint.Latitude,a.CenterPoint.Longitude);if(a.BoundingBox!=null){var b=a.BoundingBox.NorthEastCorner,c=a.BoundingBox.SouthWestCorner;s.prop30="("+b.Latitude+","+b.Longitude+"),("+c.Latitude+","+c.Longitude+")"}if(a.WhatString!=null&&a.WhatString!="")s.eVar22=a.WhatString;if(a.WhereString!=null&&a.WhereString!="")s.eVar23=a.WhereString;if(a.Classification!=null&&a.Classification!="")s.eVar25=a.Classification;if(a.SearchId!=null&&a.SearchId!="")s.eVar15=a.SearchId;if(a.PageNumber!=null&&a.PageNumber!=-1)s.prop7=a.PageNumber;if(a.LocalSearchResultCount!=null&&a.LocalSearchResultCount!=-1)s.prop27=a.LocalSearchResultCount;if(a.SortOrder!=null&&a.SortOrder!="")s.prop28=a.SortOrder;if(a.SuggestedSearchTerm!=null&&a.SuggestedSearchTerm!="")s.eVar19=a.SuggestedSearchTerm;if(a.DisambiguationCase!=null&&a.DisambiguationCase!="")s.prop41=a.DisambiguationCase;$VE_A.Log($VE_A.PgName.SRes,a.NavAction)};$VE_A.LogSearchNavAction=function(f,e,a,b,c,d){if(a!=null&&typeof a!="undefined")s.prop17=a;if(VE_SearchManager.searchId!=null)s.eVar15=VE_SearchManager.searchId;if(b!=null&&typeof b!="undefined")s.prop12=b;if(c!=null&&typeof c!="undefined")s.prop38=c;if(d!=null&&typeof d!="undefined")s.prop21=d;$VE_A.Log(f,e)};$VE_A.LogAdsResponse=function(k,j,m,l,o,p,i,f,h,d,c,b,g,a,e){if(i||b||a){s.events=i;var q=$VE_A.PgName.Ads,n="Ads Results";$VE_A.SetProperties(p,o,m,l);if(k!=null)s.eVar22=k;if(j!=null)s.eVar9=j;if(f!=null)s.eVar8=f;if(isFinite(parseInt(d)))s.eVar10=d;if(isFinite(parseInt(c)))s.eVar16=c;if(h!=null)s.eVar12=h;if(b!=null)s.prop18=b;if(g!=null)s.prop25=g;if(a!=null)s.prop19=a;if(e!=null)s.prop26=e;$VE_A.Log(q,n)}};$VE_A.LogUIPrint=function(a){s.events="Event11";s.eVar34=a;$VE_A.Log($VE_A.PgName.Print,"Print page invoked.")};$VE_A.LogAdClick=function(i,h,d,g,e,c,f){var a="Ad Click",b;switch(d){case 1:a+=" - click on title";b=$VE_A.PgName.BusinessWebsite;break;case 2:a+=" - click on Directions link";b=$VE_A.PgName.DD;break;case 3:a+=" - click on Website link";b=$VE_A.PgName.BusinessWebsite;break;case 8:a+=" - click on Phone link";b=$VE_A.PgName.AdsListing;break;case 10:a+=" - click on pushpin";b=$VE_A.PgName.ERO;break;case 64:a+=" - click on Audio link";b=$VE_A.PgName.BusinessWebsite;break;case 65:a+=" - click on Print Ad link";b=$VE_A.PgName.BusinessWebsite;break;case 66:a+=" - click on Coupon link";b=$VE_A.PgName.BusinessWebsite}$VE_A.SetAdClickProperties(i,h,g,e,c,f);$VE_A.Log(b,a,$VE_A.PgName.AdsListing)};$VE_A.LogAdEROClick=function(f,e,c,i,h,g,b,a,d){$VE_A.SetAdClickProperties(i,h,g,b,a,d);$VE_A.Log(f,e,c)};$VE_A.SetAdClickProperties=function(f,a,e,c,b,d){s.events="Event6";s.eVar12=c;s.eVar11=e;s.eVar30=b;s.eVar29=d;s.eVar8=f;if(a!=null)s.eVar9=a};$VE_A.SetProperties=function(d,c,b,a){if(d!=null)s.prop3=d;if(c!=null)s.prop4=c;if(b!=null&&a!=null)s.prop5=$VE_A.FormatLatLong(b,a)};$VE_A.LogSearch=function(){var b="",d="",c=$get("taskBar_Scopes_cs").value;if(c=="Places")c="Location";s.eVar13="Single Box";if(Search_oneBox==="true")if(isFrontDoor)b=$get("sb_form_q").value;else b=$get("taskBar_qparam").value;else{s.eVar13="Double Box";if(isFrontDoor){b=$get("sb_form_q").value;d=$get("sb_form_q2").value}else{b=$get("taskBar_what").value;d=$get("taskBar_where").value}}var e=$get("taskBar_searchid");s.eVar15=e.value;s.events="Event8";s.eVar24=c;s.prop8=b?b:"";s.prop9=d?d:"";var a=getSearchMapRect();if(a!=null)if(a.northwest!=null&&a.northwest.latitude!=null&&a.northwest.longitude!=null&&a.southeast!=null&&a.southeast.latitude!=null&&a.southeast.longitude!=null){var f=a.northwest.latitude,h=a.southeast.longitude,g=a.southeast.latitude,i=a.northwest.longitude;s.prop30="("+f+","+h+"),("+g+","+i+")"}$VE_A.Log($VE_A.PgName.SReq,"Search Request - "+c)};$VE_A.LogSearchFromPermaLink=function(a){var c=a.WhatString,b;s.eVar13="Single Box";if(a.WhereString){b=a.WhereString;if(c)s.eVar13="Double Box"}s.eVar15=a.SearchId;s.events="Event8";s.eVar24=a.Classification;s.prop3=a.MapStyle;s.prop4=a.ZoomLevel;if(a.CenterPoint)s.prop5=$VE_A.FormatLatLong(a.CenterPoint.Latitude,a.CenterPoint.Longitude);s.prop8=c;s.prop9=b;$VE_A.Log($VE_A.PgName.SReq,"Search Request - "+a.Classification)};$VE_A.LogCollectionId=function(c,b,a){if(a)s.prop39=a;$VE_A.Log(c,b)};$VE_A.LogClick2Call=function(){if(VE_SearchManager.searchId!=null)s.eVar15=VE_SearchManager.searchId;if(VE_SearchManager.activeEntityId!=null)s.prop38=VE_SearchManager.activeEntityId;if(VE_SearchManager.activeIndex!=-1)s.prop12=VE_SearchManager.activeIndex;if(VE_SearchManager.activeBrandId!=null)s.prop21=VE_SearchManager.activeBrandId;if(ero.isInUse()){s.prop17=$VE_A.PgName.ERO;var a=VE_SearchManager.activeBrandId==null?"Search":VE_SearchManager.activeIsExploration?"Branded Exploration":"Branded Search";$VE_A.Log($VE_A.PgName.Call,a+" Result ERO - click on C2C")}else{s.prop17=$VE_A.PgName.SRes;$VE_A.Log($VE_A.PgName.Call,"Result item: click on C2C")}};$VE_A.LogSearchSend2Phone=function(){if(VE_SearchManager.searchId!=null)s.eVar15=VE_SearchManager.searchId;if(VE_SearchManager.activeEntityId!=null)s.prop38=VE_SearchManager.activeEntityId;if(VE_SearchManager.activeIndex!=-1)s.prop12=VE_SearchManager.activeIndex;if(VE_SearchManager.activeBrandId!=null)s.prop21=VE_SearchManager.activeBrandId;if(ero.isInUse()){s.prop17=$VE_A.PgName.ERO;var a=VE_SearchManager.activeBrandId==null?"Search":VE_SearchManager.activeIsExploration?"Branded Exploration":"Branded Search";$VE_A.Log($VE_A.PgName.Mobile,a+" Result ERO - click on S2M")}else{s.prop17=$VE_A.PgName.SRes;$VE_A.Log($VE_A.PgName.Mobile,"Result item: click on S2M")}};$VE_A.LogSendToCar=function(c,b){var d=$VE_A.PgName,e=d.Car,a="";switch(c){case SendToEntryPoints.Directions:a=VE_Directions.NavigationAction.SendToCar;break;case SendToEntryPoints.CollectionEditor:a="SP-Send to Car";break;case SendToEntryPoints.LocalSearchResult:a=b?"Search Result ERO - Send to car":"Search Result Panel - Send to car";break;case SendToEntryPoints.CollectionSearchResult:a=b?"Collection ERO - Send to car":"Collection Search Result Panel - Send to car";break;case SendToEntryPoints.LocationResult:a=b?"Place Result ERO - Send to car":"Place Result Panel - Send to car";break;case SendToEntryPoints.CollectionItem:a="Pushpin-Send to Car"}$VE_A.Log(e,a)};$VE_A.FormatLatLong=function(b,a){if(!b||!a){if(state&&state.GetLatitude()&&state.GetLongitude())return state.GetLatitude().toFixed(3)+","+state.GetLongitude().toFixed(3);return "0.0,0.0"}return b.toFixed(3)+","+a.toFixed(3)};$VE_A.LogTrafficActivation=function(a){if(s.events=="undefined"||s.events==null||s.events=="")s.events="Event12";else s.events+=",Event12";s.eVar1=a;if(window["map"])s.eVar3=map.GetCenterLatitude()+","+map.GetCenterLongitude();$VE_A.Log($VE_A.PgName.Traffic,"Traffic activated",a)};$VE_A.LogDirections=function(d,h,f,g,c,e,a,b,i){s.events="Event3";s.eVar1=d;s.eVar2=h;s.eVar3=f;s.eVar4=g;s.eVar5=c;s.eVar6=e;s.eVar31=a;s.eVar32=b;s.eVar33=i;$VE_A.Log($VE_A.PgName.DD,VE_Directions.NavigationAction.GetDirections)};$VE_A.LogMultipointDirections=function(d,a,e,b,c){if(VE_Directions.IsItemValid(d)){waypointCount=VE_Directions.GetWaypointCount();s.eVar35=waypointCount==0?"0":waypointCount;switch(d){case VE_Directions.NavigationAction.ReverseRoute:case VE_Directions.NavigationAction.ReverseLanding:case VE_Directions.NavigationAction.RoundtripRoute:case VE_Directions.NavigationAction.RoundtripLanding:case VE_Directions.NavigationAction.AddStopLanding:case VE_Directions.NavigationAction.CollapseAllSegments:case VE_Directions.NavigationAction.ExpandAllSegments:break;case VE_Directions.NavigationAction.AddStopRoute:case VE_Directions.NavigationAction.AddStopEnd:case VE_Directions.NavigationAction.AddStopCancel:case VE_Directions.NavigationAction.CollapseSegment:case VE_Directions.NavigationAction.ExpandSegment:s.eVar38=a;break;case VE_Directions.NavigationAction.DriveToMap:case VE_Directions.NavigationAction.DriveFromMap:case VE_Directions.NavigationAction.AddStopMap:s.eVar3=e;break;case VE_Directions.NavigationAction.DeleteStop:s.eVar3=VE_Directions.GetWaypointLatLongAddressForLog(a);s.eVar38=a;break;case VE_Directions.NavigationAction.ReorderMoveUp:case VE_Directions.NavigationAction.ReorderMoveDown:case VE_Directions.NavigationAction.ReorderDragDrop:s.eVar3=VE_Directions.GetWaypointLatLongAddressForLog(b);s.eVar39="S:"+b+",E:"+(b<c?c-1:c);break;case VE_Directions.NavigationAction.AddStopGetDirections:case VE_Directions.NavigationAction.EditGetDirections:s.eVar3=VE_Directions.GetAllDirectionWaypointsForLog();s.eVar38=a;break;case VE_Directions.NavigationAction.GetDirections:s.eVar3=VE_Directions.GetAllDirectionWaypointsForLog();break;default:s.prop6="";s.eVar35="";s.eVar3="";s.eVar38="";s.eVar39=""}$VE_A.Log($VE_A.PgName.DD,d)}};$VE_A.LogTDEntryPoint=function(a){s.prop17=a;$VE_A.Log($VE_A.PgName.TD,"Open Transit Panel",a)};$VE_A.LogTDNavigationAction=function(b,a){if(a!=null)s.eVar36=a+1;$VE_A.Log($VE_A.PgName.TD,b)};$VE_A.LogTDirections=function(g,h,i,d,e,f,b,a,c){s.events="Event15";s.eVar2=g;s.eVar3=d+"/"+e;s.eVar4=f;s.eVar5=b;s.eVar6=c;s.eVar7=a;s.eVar26=h+"/"+i;$VE_A.Log($VE_A.PgName.TD,VE_Transit.NavigationAction.GetDirections)};$VE_A.LogTDSend2Phone=function(){s.prop17=$VE_A.PgName.TD;$VE_A.Log($VE_A.PgName.Mobile,VE_Transit.NavigationAction.Send2Phone)};$VE_A.LogPartyMap=function(b,d,c,a){s.events="Event16";s.eVar1=b;s.eVar2=d;s.eVar3=c;s.eVar6=a;$VE_A.Log($VE_A.PgName.PartyMap,"Party Map Invoked")};$VE_A.LogSystemCapabilities=function(b,a){if(typeof b=="string")s.eVar47=b;if(typeof a=="string")s.prop44=a;$VE_A.Log("3D Hardware Config","3DModeStart")};$VE_A.Log3DTour=function(c,b,a){if(typeof b=="string")s.prop17=b;if(typeof a=="string")s.prop44=a;$VE_A.Log($VE_A.PgName.Collection,"3DTour "+c)};$VE_A.Log3DTourVideo=function(b,a){if(typeof a=="string")s.prop37=a;$VE_A.Log($VE_A.PgName.Movie3D,b)};$VE_A.Log3DOblique=function(f,a,b,d,e,c){if($VE_A.analyticsEnabled&&typeof s!="undefined"&&s!=null){if(a!=null)s.prop46=a;if(b!=null)s.prop47=b;if(d!=null&&e!=null&&c!=null)s.prop49=d+","+e+","+c;$VE_A.Log($VE_A.PgName.Map,f)}};$VE_A.LogPersonalLocation=function(a,b,c){var d=a+" - "+c+" location";s.eVar20=TrimLocationName(b);$VE_A.Log($VE_A.PgName.PersonalLocations,d)};$VE_A.LogDisambiguation=function(g,f,e,h,c,d,i,a,b){if(i)s.events="Event14";if(a&&a!=""){s.eVar13="Disambiguation";s.eVar25=a}s.eVar15=h;s.prop8=f;s.prop9=e;s.prop41=c;s.prop42=d;if(b)s.prop12=b;$VE_A.Log($VE_A.PgName.SRes,"Search Results: Disambiguation - "+g,"Disambiguation")};$VE_A.Log=function(f,d,c){if(window.s=="undefined"||window.s==null)return;if(!$VE_A.analyticsEnabled)return;s.pageName=f;if(s.events=="undefined"||s.events==null||s.events=="")s.events="Event9";else s.events+=",Event9";s.prop1="VirtualEarth";s.prop2=window.locale.toLowerCase();if(s.prop3=="")s.prop3=window["map"]?map.GetMapStyle():"";if(s.prop4=="")s.prop4=window["map"]?map.GetZoomLevel():"";if(s.prop5=="")s.prop5=window["map"]?$VE_A.FormatLatLong(map.GetCenterLatitude(),map.GetCenterLongitude()):"";s.prop6=d?d:"";s.prop13=window["map"]?$VE_A.MapMode[map.GetMode()]:"";s.prop36=window.usertype==undefined?1:usertype;s.charSet="UTF-8";s.prop50=g_omniFlightSuite;if(s.prop13==$VE_A.MapMode[Msn.VE.MapActionMode.Mode3D]){var a=map.GetCurrentMapView(),b=null;if(a.cameraLatlong!=null&&a.cameraLatlong!="undefined")b=a.cameraLatlong.latitude.toFixed(3)+","+a.cameraLatlong.longitude.toFixed(3);else b=a.latlong.latitude.toFixed(3)+","+a.latlong.longitude.toFixed(3);s.prop14=b+","+a.GetAltitude().toFixed(0)+","+a.GetTilt().toFixed(1)+","+a.GetDirection().toFixed(1)}else s.prop14="";if(!s.prop17&&c!=null)s.prop17=c;var e=$ID("logging");if(e)e.innerHTML=s.t();$VE_A.ResetLogProps()};$VE_A.ResetLogProps=function(){s.prop3="";s.prop4="";s.prop5="";s.prop6="";s.prop7="";s.prop8="";s.prop9="";s.prop10="";s.prop11="";s.prop12="";s.prop13="";s.prop14="";s.prop17="";s.prop18="";s.prop19="";s.prop21="";s.prop25="";s.prop26="";s.prop27="";s.prop28="";s.prop29="";s.prop30="";s.prop32="";s.prop33="";s.prop34="";s.prop35="";s.prop36="";s.prop37="";s.prop38="";s.prop39="";s.prop41="";s.prop42="";s.prop44="";s.prop45="";s.prop46="";s.prop47="";s.prop48="";s.prop49="";s.prop50="";s.prop51="";s.events="";s.eVar1="";s.eVar2="";s.eVar3="";s.eVar4="";s.eVar5="";s.eVar6="";s.eVar7="";s.eVar8="";s.eVar9="";s.eVar10="";s.eVar11="";s.eVar12="";s.eVar13="";s.eVar14="";s.eVar15="";s.eVar16="";s.eVar19="";s.eVar20="";s.eVar22="";s.eVar23="";s.eVar24="";s.eVar25="";s.eVar26="";s.eVar29="";s.eVar30="";s.eVar31="";s.eVar32="";s.eVar33="";s.eVar34="";s.eVar35="";s.eVar36="";s.eVar38="";s.eVar39="";s.eVar47="";s.campaign=""};var VE_ModuleName={APICORE:"__core__",APICONTROLS:"__controls__",APIBIRDSEYE:"__birdseye__",APILAYERS:"__layers__",APIFIND:"__find__",APIROUTING:"__routing__",APITRAFFIC:"__traffic__",API3D:"__3d__",APITILES:"__tiles__"},_VE_ModuleStatus={"__core__":"loaded","__layers__":null,"__controls__":null,"__find__":null,"__routing__":null,"__traffic__":null,"___3d__":null,"__birdseye__":null,"__tiles__":null};function _VE_InitAllModules(a){if(Msn.VE.API.Globals.vemapinstances||a==null){var b=Msn.VE.API.Globals.vemapinstances;for(var c in b)if(b[c]instanceof VEMap)b[c]._InitializeModules(a.split(","))}if(_VEDownloadQueue)_VEDownloadQueue.Fire(a)}function VE_GetLoadedAPIModules(){var a=[];if(Msn.VE.API.Globals.locale=="zh-cn")a=[VE_ModuleName.APICORE,VE_ModuleName.APICONTROLS,VE_ModuleName.APILAYERS,VE_ModuleName.APIFIND,VE_ModuleName.APITILES];else a=[VE_ModuleName.APICORE,VE_ModuleName.APICONTROLS,VE_ModuleName.APIBIRDSEYE,VE_ModuleName.APILAYERS,VE_ModuleName.APIFIND,VE_ModuleName.APIROUTING,VE_ModuleName.APITRAFFIC,VE_ModuleName.API3D,VE_ModuleName.APITILES];var c=[],d=a.length;for(var b=0;b<d;b++)if(VE_CheckModuleStatus(a[b])=="loaded")c.push(a[b]);return c}function VE_CheckModuleStatus(a){if(a==VE_ModuleName.API3D)a="_"+a;return _VE_ModuleStatus[a]}function VE_SetModuleStatus(a,b){if(a==null&&typeof _VE_ModuleStatus[a]=="undefined")return;if(a==VE_ModuleName.API3D)a="_"+a;_VE_ModuleStatus[a]=b}VE_RequestUrl=Msn.VE.API.Globals.vecurrentdomain+"/veapi.ashx?VEAPI_DisableAtlasCompat=true&v="+Msn.VE.API.Globals.vecurrentversion+"&__load__";function VEOndemandJsDownloads(l,a,d,g){var e=null;if(a==null||typeof a!="string"||typeof d!="object")throw new VEException("VEJsDownloadQueue:Fire","err_invalidmoduleurl",L_noscripturl_text);if(typeof g!="object")g=null;var j=false,h=false,b=null;b=a.split(",");var m=b.length,i=true,f=null;for(var c=0;c<m;c++){f=VE_CheckModuleStatus(b[c]);if(typeof f=="undefined")throw new VEException("VEJsDownloadQueue:Fire","err_invalidmoduleurl",L_noscripturl_text);else if(f==null){if(i){a=b[0];i=false}else a+=","+b[c];j=true;VE_SetModuleStatus(b[c],"loading")}else if(f=="loading")h=true}if(j){if(_VEDownloadQueue==null)_VEDownloadQueue=new VEJsDownloadQueue;var k=VE_RequestUrl+"="+a;_VEDownloadQueue.Push(a,d.GUID,g);if(l)VENetwork.DownloadScript(k);else VENetwork.DownloadScript(k,_VEDownloadQueue.Fire,a);e=null}else if(h){_VEDownloadQueue.Push(a,d.GUID,g);e=null}else e=d;return e}function VEJsDownloadQueue(){var a=[],c=[],b=[];this.Dispose=function(){a=[];c=[];b=[]};this.Push=function(d,f,e){if(typeof mapContext=="undefined")mapContext=null;a.push(e);c.push(d);b.push(f)};this.Fire=function(f){if(a.length==0)return;for(var d=0;d<a.length;d++)if(c[d]==f){if(b[d]){var e=null;e=Msn.VE.API.Globals.vemapinstances[b[d]];if(e&&typeof a[d][0]=="function")a[d][0].call(e,a[d][1],a[d][2],a[d][3],a[d][4]);else throw new VEException("VEJsDownloadQueue:Fire","err_invalidinvoketarget",L_invalidinvoketarget_text)}else a[d][0](a[d][1],a[d][2],a[d][3],a[d][4]);a.splice(d,1);c.splice(d,1);b.splice(d,1);d--}}}var _VEDownloadQueue=null;_VERegisterNamespaces("Msn.VE");Msn.VE.Animation={Animation:function(h,f){var b=false;this.Running=b;var e=h,d=f,a=null;function c(){if(b){e();a=setTimeout(c,d)}else a=null}function g(){if(!b){b=true;c();a=window.setTimeout(c,d)}}this.Start=g;function i(){if(a!=null){window.clearTimeout(a);a=null}b=false}this.Stop=i},AccelerationFunction:function(e){var b=null,a=200,d=e;this.setSteps=function(d){a=d;b=null;c()};this.getSteps=function(){return a};this.getValue=function(e){if(!b)c();var d=parseInt(Math.round(e*a));if(d<0)d=0;if(d>a)d=a;return b[d]};this.getTotal=function(){return this.getValue(1)};function c(){b=[];b[0]=0;for(var c=1;c<=a;c++)b[c]=b[c-1]+d(c/a)}},Movie:function(b,g){var a=this;this.Repeat=true;this.AppendContent=true;var e=[],c=-1,d=null;this.addFrame=function(b,a){if(a==null)a=true;var c={data:b,append:a};e.push(c)};this.start=function(){a.stop();a.show();a.clear();c=-1;d=setInterval(h,g)};this.stop=function(){if(d)clearInterval(d)};this.end=function(){a.stop();f(e.length-1)};this.show=function(){b.style.visibility="visible"};this.hide=function(){b.style.visibility="hidden"};this.clear=function(){b.innerHTML=""};function h(){c++;if(c>e.length-1){c=0;if(!a.Repeat){clearInterval(d);return}else a.clear()}f(c)}function f(c){var a=