// Copyright 2005 Microsoft Corporation
// Version number : 1.3.20070327220207.22
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_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_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="Invalid client token.",L_ClientTokenExpired="Expired client token.",L_Shp_IncorrectPoints="The number of points does not match the specified VEShape type.",L_Shp_IncorrectLineWidth="The line width must be a positive integer.",L_Shp_IncorrectZoomLevel="The specified  zoom level is invalid.  The valid range is 1 to 21,inclusive.",L_Shp_IncorrectZoomLevel2="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_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_DashboardRoad_Text="Road",L_DashboardAerial_Text="Aerial",L_DashboardBirdsEye_Text="Bird's eye",L_DashboardBirdsEyeText_Text="See this location in bird's eye view",L_Dashboard3DText_Text="See this location in Virtual Earth 3D",L_DashboardShowLabels_Text="Show labels",L_ObliqueZoomBarSelectZoom_Text="Choose the zoom level",L_ObliqueCompassSelectDirection_Text="Change the direction of the view",L_ObliqueSelectorSelectThumbnail_Text="Choose a thumbnail to display an image from the surrounding area",L_ObliqueModeImageNotAvailable_Text="Bird's eye images are not available for this area.",L_MinimapHybrid_Text="H",L_MinimapRoad_Text="R",L_MinimapHideToolTip_Text="Hide mini map",L_MinimapShowToolTip_Text="Show mini map",L_MinimapLargerToolTip_Text="Larger mini map",L_MinimapSmallerToolTip_Text="Smaller mini map",L_MinimapRoadToolTip_Text="Switch the mini map to road view.",L_MinimapHybridToolTip_Text="Switch the mini map 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_NavActionHideToolTip_Text="Minimize navigation control",L_NavActionShowToolTip_Text="Maximize navigation control",L_NavActionFlatlandToolTip_Text="See maps in 2D view.",L_NavActionView3DToolTip_Text="See maps in 3D view with Virtual Earth 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_ZoomBarMinusToolTip_Text="Zoom out",L_ZoomBarPlusToolTip_Text="Zoom in",L_ZoomBarSliderToolTip_Text="Move slider to zoom in or zoom out.",L_NavActionTitleAlternate_Text="Choose view",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_x64BrowserNotSupported_Text="To use this feature, open Live Search in the 32-bit version of Windows Internet Explorer.",L_NoHardwareAcceleration_Text="Virtual Earth 3D has detected that hardware acceleration is turned off.",L_GeoRssInvalidFormatError_Text="The GeoRSS file you have tried to import is improperly formatted.",L_MapControlNavteq_Text="&copy; 2006 NAVTEQ",L_MapControlImageCourtesyOfNASA_Text="Image courtesy of NASA",L_MapControlHarrisCorp_Text="&copy; Harris Corp, Earthstar Geographics LLC",L_MapControlImageCourtesyOfUSGS_Text="Image courtesy of USGS",L_MapControlImageCourtesyOfPictometry_Text="&copy; 2007 Pictometry International Corp.",L_MapControlImageCourtesyOfEarthData_Text="&copy; EarthData",L_MapControlImageCourtesyOfGetmapping_Text="&copy; Getmapping plc",L_MapControlImageCourtesyOfAND_Text="&copy; AND",L_MapControlImageCourtesyOfBlom_Text="&copy; 2006 Blom",L_MapCopyrightMicrosoft="&copy; 2007 Microsoft Corporation",L_MapControlPlatformName_Text="Virtual Earth",L_MapControlImageCourtesyOfGeoEye_Text="&copy; 2006 GeoEye",L_MapControlImageCourtesyOfMapDataSciences_Text="&copy; 2006 MapData Sciences Pty Ltd",L_MapControlImageCourtesyOfZenrin_Text="&copy; 2006 Zenrin",L_MapControlImageCourtesyOfPasco_Text="&copy; 2005 Pasco",L_MapControlImageCourtesyOfIntergraph_Text="&copy; GeoContent / (p) Intergraph",L_MapControlImageCourtesyOfTerraItaly_Text="&copy; 2007 TerraItaly",L_MapControlImageCourtesyOfIntermap_Text="&copy; 2007 Intermap",L_MapControlImageCourtesyOfStateofIndiana_Text="&copy; 2007 State of Indiana",L_SupportedBrowserDownloadUrl_Text="http://www.microsoft.com/windows/ie/downloads/default.mspx";
_VERegisterNamespaces("MapControl");
MapControl.Features={PlatformName:L_MapControlPlatformName_Text,Copyright:{Navteq:L_MapControlNavteq_Text,ImageCourtesyOfNASA:L_MapControlImageCourtesyOfNASA_Text,HarrisCorp:L_MapControlHarrisCorp_Text,ImageCourtesyOfUSGS:L_MapControlImageCourtesyOfUSGS_Text,ImageCourtesyOfPictometry:L_MapControlImageCourtesyOfPictometry_Text},Image:{PoweredLogo:"logo_powered_by.png"},MapStyle:{Road:true,Shaded:true,Aerial:true,Hybrid:true,BirdsEye:true,View3D:true},BirdsEyeAtZoomLevel:10,ScaleBarKilometers:false,Traffic:{Flow:{Slow:"0-25 mph",Moderate:"25-45 mph",Fast:"45+ mph"}}};
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]]=new Object;
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 GetMouseX(a){var b=0;
if(a.pageX)b=a.pageX;else if(a.clientX)if(document.documentElement&&document.documentElement.scrollLeft)b=a.clientX+document.documentElement.scrollLeft;else if(document.body)b=a.clientX+document.body.scrollLeft;
return b}function GetMouseY(a){var b=0;
if(a.pageY)b=a.pageY;else if(a.clientY)if(document.documentElement&&document.documentElement.scrollTop)b=a.clientY+document.documentElement.scrollTop;else if(document.body)b=a.clientY+document.body.scrollTop;
return b}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.button==0;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.button==2;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.button==1;else return false}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(a.nodeType==3)a=targ.parentNode;
return a}function GetLeftPosition(c){var a=c,b=0;
while(a){b+=a.offsetLeft;
a=a.offsetParent}if(navigator.userAgent.indexOf("Mac")!=-1&&typeof document.body.leftMargin!="undefined")b+=document.body.leftMargin;
return b}function GetTopPosition(c){var a=c,b=0;
while(a){b+=a.offsetTop;
a=a.offsetParent}if(navigator.userAgent.indexOf("Mac")!=-1&&typeof document.body.topMargin!="undefined")b+=document.body.topMargin;
return b}_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;
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,c,h,g){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.Globals.veonbegininvokeevent)Msn.VE.API.Globals.veonbegininvokeevent();
var e=VENetwork.GetExecutionID();
if(c){var b=this.ServiceUrl+"?";
for(var d=0;d<c.length;d++){b=b+c[d].Name;
b=b+"=";
b=b+c[d].Value;
b=b+"&"}}else var b=this.ServiceUrl;
if(Msn.VE.API.Globals.vedebug)alert(b);
var a=document.createElement("script");
a.type="text/javascript";
a.language="javascript";
a.id=e;
a.src=b;
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,e)}};else a.onload=function(){a.onload=null;
EndInvoke(g,h,f,a,e)};
VENetwork.GetAttachTarget().appendChild(a)}function EndInvoke(endInvokeTarget,fnCallback,endInvokeMethod,elScript,executionId){var objects=null;
if(endInvokeMethod)eval("if(typeof "+endInvokeMethod+" == 'function') {objects = "+endInvokeMethod+"();}");
document.getElementsByTagName("head")[0].removeChild(elScript);
elScript=null;
if(fnCallback!=null&&fnCallback!="undefined")fnCallback(objects,endInvokeTarget);
if(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;
try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(c){a=null}}if(!a&&typeof XMLHttpRequest!="undefined")a=new XMLHttpRequest;
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};
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;
_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"};
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++;
break}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.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};
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.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.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.minX=null;
this.minY=null;
this.maxX=null;
this.maxY=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.labelPosX=null;
Msn.Drawing.Polygon.prototype.labelPosY=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.minX=null;
this.minY=null;
this.maxX=null;
this.maxY=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 "#"+Number(this.R).toString(16)+(this.R<16?"0":"")+Number(this.G).toString(16)+(this.G<16?"0":"")+Number(this.B).toString(16)+(this.B<16?"0":"")}};
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_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="red";
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="blue";
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_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(f,c){if(document.all)return new Msn.Drawing.VMLGraphic(f,c);else{var b=0,e=0,g=new RegExp("Firefox/(.*)"),d=g.exec(navigator.userAgent);
if(d[1]){var a=d[1].split(".");
if(a){b=a[0];
e=a[1];
if(parseInt(b)>0&&parseInt(e)>=5||parseInt(b)>=2)return new Msn.Drawing.SVGGraphic(f,c)}}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");
var g=null;
g=GetVmlPath(d,a);
var h=d.GetMapWidth(),i=d.GetMapHeight();
b.style.top=d.GetOffsetY()+"px";
b.style.left=d.GetOffsetX()+"px";
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;
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.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.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]=new Array("Solid","none");
a[1]=new Array("ShortDash","6,2");
a[2]=new Array("ShortDot","2,2");
a[3]=new Array("ShortDashDot","6,2,2,2");
a[4]=new Array("ShortDashDotDot","6,2,2,2,2,2");
a[5]=new Array("Dot","2,6");
a[6]=new Array("Dash","10,6");
a[7]=new Array("LongDash","20,6");
a[8]=new Array("DashDot","10,6,2,6");
a[9]=new Array("LongDashDot","20,6,2,6");
a[10]=new Array("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 h=LatLongtoRoundedPixel(c,e.points[1],e.points[0]);
a.setAttribute("x",h.x-6);
a.setAttribute("y",h.y-6);
a.setAttribute("width","6pt");
a.setAttribute("height","6pt");
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){a=document.createElementNS("http://www.w3.org/2000/svg","polyline");
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(e.type==VEShapeType.Polyline)a.setAttribute("fill","none");else{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=0.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}};
function GetSvgPath(f,c){var b="",a=0,d=c.length/2,g=0;
while(a<d){var e=LatLongtoRoundedPixel(f,c[a*2+1],c[a*2]);
b=b.concat(e.x,",",e.y);
a++;
if(a<d)b+=","}return b}function LatLongtoRoundedPixel(b,d,e){var c;
if(typeof VEMap!="undefined"&&VEMap.prototype.isPrototypeOf(b))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}function GetVmlPath(g,a){var c=a.points;
if(!c)return null;
var d=["m "],b=0,h=c.length;
if(h>=4){var e=LatLongtoRoundedPixel(g,c[b*2+1],c[b*2]);
if(!e)return null;
d.push(e.x);
d.push(",");
d.push(e.y);
d.push(" l ");
++b}var f=false;
if(a.type!=VEShapeType.Pushpin)if(a.minX==null||a.minY==null||a.maxX==null||a.maxY==null){f=false;
a.minX=360;
a.minY=360;
a.maxX=-360;
a.maxY=-360}else f=true;
while(b<h/2){if(!f){a.minX=Math.min(a.minX,c[b*2]);
a.minY=Math.min(a.minY,c[b*2+1]);
a.maxX=Math.max(a.maxX,c[b*2]);
a.maxY=Math.max(a.maxY,c[b*2+1]);
}var e=LatLongtoRoundedPixel(g,c[b*2+1],c[b*2]);
if(!e)return null;
d.push(e.x);
d.push(",");
d.push(e.y);
d.push(" ");
++b}d.push(" e");
return d.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(q=="o"){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 "#"+Number(c).toString(16)+(c<16?"0":"")+Number(b).toString(16)+(b<16?"0":"")+Number(a).toString(16)+(a<16?"0":"")}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;
_VERegisterNamespaces("Msn.VE.UI");
Msn.VE.UI.IEGlyphStates={Unselected:"-unselected",Hover:"-hover",Pressed:"-pressed"};
Msn.VE.UI.IEGlyph=function(j,l){var k=Msn.VE.UI,a,d,c,b;
m();
function m(){a=document.createElement("div");
if(j)a.id=j;
b=l||"ieglyph";
d=b+k.IEGlyphStates.Hover;
c=b+k.IEGlyphStates.Pressed;
a.className=b;
if(!document.all)return;
a.attachEvent("onmouseover",e);
a.attachEvent("onmousedown",i);
a.attachEvent("onmouseup",e);
a.attachEvent("onmouseout",f);
window.attachEvent("onunload",n)}this.getElement=function(){return a};
this.setContent=function(b){a.innerHTML=b};
function n(){a.detachEvent("onmouseover",e);
a.detachEvent("onmousedown",i);
a.detachEvent("onmouseup",e);
a.detachEvent("onmouseout",f);
a=null;
d=null;
c=null;
b=null}function e(){f();
h(d)}function i(){h(c)}function f(){g(d);
g(c)}function h(b){a.className+=" "+b}function g(b){var c=new RegExp(" "+b,"g");
a.className=a.className.replace(c,"")}};
function setScrollPosition(a,b,c){if(!a)return;
a.scrollTop=c;
a.scrollLeft=b}function pseudoHover(a){if(!document.all)return;
var c=function(){a.className+=" ms_pseudoHover"},b=function(){a.className=a.className.replace(/\s*ms_pseudoHover/g,"")};
a.attachEvent("onmouseenter",c);
a.attachEvent("onmouseleave",b);
window.attachEvent("onunload",d);
function d(){a.detachEvent("onmouseenter",c);
a.detachEvent("onmouseleave",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,"")}function setElementCursor(b,a){b.style.cursor=a}function setElementStyle(c,h,b,a){var i=Msn.VE.Css;
if(!a)a=Msn.VE.Css.Units.Pixels;
switch(h){case style.Height:d(c,b,a);
break;case style.Width:e(c,b,a);
break;case style.Top:g(c,b,a);
break;case style.Left:f(c,b,a);
break}function d(c,a,b){try{c.style.height=a+b}catch(d){}}function e(c,b,a){try{c.style.width=b+a}catch(d){}}function g(b,c,a){try{b.style.top=c+a}catch(d){}}function f(b,c,a){try{b.style.left=c+a}catch(d){}}}_VERegisterNamespaces("Msn.VE.Css");
Msn.VE.CurrentDomain=typeof Msn.VE.API!="undefined"&&Msn.VE.API!=null?Msn.VE.API.Globals.vecurrentdomain:".";
Msn.VE.Css={Style:{Height:0,Width:1,Top:2,Left:3,Bottom:4,Right:5,Position:6,Margin:7,Padding:8,Display:9,Visibility:10},Units:{Auto:"auto",Pixels:"px",Points:"pt",Ems:"em",Percentage:"%"},Position:{Static:"static",Relative:"relative",Absolute:"absolute"},Display:{None:"none",Block:"block",Table:"table",Inline:"inline"},Visibility:{Visible:"visible",Hidden:"hidden"},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];
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=Msn.VE.Css.Functions.getComputedStyle(d,"clip");
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 c=0,e=0,f=new RegExp("Firefox/(.*)"),d=f.exec(a.UserAgent);
if(d[1]){var b=d[1].split(".");
if(b){c=b[0];
e=b[1];
if(parseInt(c)>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;
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[1])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[1])a.Locale=b[1].substring(b[1].lastIndexOf(" "),b[1].length+1)}else a.Locale="en-US"}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;
_VERegisterNamespaces("Msn.VE");
Msn.VE.PushPinTypes={Default:0,SearchResult:1,Annotation:2,Direction:3,DirectionTemp:4,TrafficLight:5,TrafficOthers:6,YouAreHere:7,AdStandard:8,AdWide:9,AdCategory:10,AdRoofStandard:11,AdRoofWide:12,DirectionStep:13,Context:14};
Msn.VE.MapActionMode={ModeUnknown:0,Mode2D:1,Mode3D:2,ModeOblique:3};
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*0.5,minZoom=1,maxZoom=19,emptyTile="http://virtualearth.msn.com/i/spacer.gif",minLatitude=-85,maxLatitude=85,minLongitude=-180,maxLongitude=180,tileSize=256,generations=new Object,vemanifestdomain="http://dev.virtualearth.net/legacyService",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="r",shadedStyle="s",hybridStyle="h",aerialStyle="a",obliqueStyle="o",mapTiles="Road",trafficTiles="Traffic",marketMaxZoom=1,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,copyright=null,dashboardContainer=null,dashboard=null,minimapControl=null,minimapContainer=null,mouseZoomDisabled=false,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,view3DCreated=false,spacecontrol=false,spacediv=null,spaceCameraIsFlying=false,init3dparam=null,resizeTimer=null,traffic3dAdded=false,initial3dView=null,cameraUpdateCount=0;
function SetChildDiv(a){map.appendChild(a)}function EnableGeoCommunity(a){hijackMouseMove=a}function IsGeoCommunityEnabled(){return hijackMouseMove}function GetOffsetX(){return offsetX}function GetOffsetY(){return offsetY}this.Init=function(){generations[roadStyle]=167;
generations[aerialStyle]=167;
generations[hybridStyle]=167;
generations[obliqueStyle]=167;
orthoMode=new OrthoMode;
orthoMode.Init();
if(p_htParams.clientToken)m_clientToken=p_htParams.clientToken;
if(p_htParams.obliqueEnabled&&p_htParams.obliqueUrl){obliqueMode=new ObliqueMode;
obliqueMode.SetGUID(p_htParams.mapGUID);
obliqueMode.SetClientToken(p_htParams.clientToken);
obliqueMode.Init(p_htParams.obliqueUrl)}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";
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;
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){SetMapTiles();
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);
if(p_htParams.boundingBox){initialView.SetLatLongRectangle(p_htParams.boundingBox);
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(!startIn3DMode)SetMapTiles();
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(typeof p_htParams.showMinimap!="undefined"&&p_htParams.showMinimap){var loadMinimapNow=false;
if(obliqueMode!=null&&p_htParams.mapstyle==obliqueStyle)loadMinimapNow=true;
CreateMinimap(null,null,null,loadMinimapNow)}if(p_htParams.showMapModeSwitch!=false)p_htParams.showMapModeSwitch=true;
if(p_htParams.showDashboard)CreateDashboard(p_htParams.dashboardX,p_htParams.dashboardY,p_htParams.dashboardSize,p_htParams.dashboardId,p_htParams.showMapModeSwitch);
if(startIn3DMode)copyright.Hide();
p_this.SetCursor(cssCursors.Grab)};
AttachEvent("onstartmapstyleoblique",function(){targetTool.trackMovement()});
AttachEvent("onendmapstyleoblique",function(){targetTool.ignoreMovement()});
AttachEvent("onchangeview",function(){if(currentView.mapStyle==obliqueStyle){var b=GetObliqueScene();
if(b!=null){var a=Msn.VE.Geometry,c=new a.Point(GetLeftPosition(p_elSource)+(map.offsetLeft-originX),GetTopPosition(p_elSource)+(map.offsetTop-originY)),d=2/currentView.zoomLevel,f=new a.Point(c.x+b.GetWidth()/d,c.y+b.GetHeight()/d),e=new a.Rectangle(c,f);
e.scale(-256);
targetTool.setBoundingArea(e);
a=null;
b=null}}});
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);
if(window.addEventListener&&navigator.product&&navigator.product=="Gecko")p_elSource.addEventListener("DOMMouseScroll",MouseWheel,false)}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;
SetMapTiles();
if(currentView==null)SetDefaultView();else{if(a==true||!Initialized2D){SetView(currentView);
Initialized2D=true}SetView(null)}if(p_htParams.showScaleBar){scaleBar=new ScaleBar(p_elSource);
scaleBar.Init();
scaleBar.SetOffset(0,10);
AttachEvent("onendzoom",scaleBar.Update);
AttachEvent("onendpan",scaleBar.Update);
AttachEvent("onobliquechange",scaleBar.Update);
AttachEvent("onresize",scaleBar.Reposition)}Fire("oninitmode",Msn.VE.MapActionMode.Mode2D)};
this.Init3DOnly=function(){if(dashboardContainer)if(window.navigator.userAgent.indexOf("Firefox")<0)UpdateIFrameShim(dashboardContainer);
var b;
try{if(currentView==null)b=SetDefaultView();else{var a=currentView.MakeCopy();
if(currentView.mapStyle==obliqueStyle){a.SetMapStyle(lastOrthoMapStyle);
a.SetZoomLevel(a.GetZoomLevel()+zoomLevelToAdjustObliqueToOrthro)}a.SetCenterLatLong(new Msn.VE.LatLong(currentView.latlong.latitude,currentView.latlong.longitude));
b=SetView(a)}}catch(d){b=false}if(!b){this._Disable3DMode(true);
return}if(!view3DCreated)return;
mvcViewFacade.OnSwitchToView3D(spacecontrol);
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(window.locale){spacecontrol.CurrentLocale=window.locale;
spacecontrol.DisplayMetricUnits=MapControl.Features.ScaleBarKilometers}var c="http://go.microsoft.com/fwlink/?LinkID=98770";
if(currentView.mapStyle=="a"){c="http://go.microsoft.com/fwlink/?LinkID=98771";
spacecontrol.ShowAtmosphere=true}if(currentView.mapStyle=="h"){c="http://go.microsoft.com/fwlink/?LinkID=98772";
spacecontrol.ShowAtmosphere=true}if(currentView.mapStyle=="r"){spacecontrol.TexturesVisible=false;
if(spacecontrol.HardwareClassificationLevel<3)c="http://go.microsoft.com/fwlink/?LinkID=98769";
spacecontrol.ShowAtmosphere=false}else spacecontrol.TexturesVisible=true;
spacecontrol.AddImageSource("Terrain","Texture",c,0,1);
if(3==spacecontrol.HardwareClassificationLevel){spacecontrol.AddElevationSource("Terrain","DEM","http://go.microsoft.com/fwlink/?LinkID=98774",0);
spacecontrol.AddModelSource("Model","Model","http://go.microsoft.com/fwlink/?LinkID=98775")}else if(2==spacecontrol.HardwareClassificationLevel){spacecontrol.AddElevationSource("Terrain","DEM","http://go.microsoft.com/fwlink/?LinkID=98773",0);
spacecontrol.AddModelSource("Model","Model","http://go.microsoft.com/fwlink/?LinkID=98776")}else spacecontrol.AddElevationSource("Terrain","DEM","http://go.microsoft.com/fwlink/?LinkID=98773",0);
tileLayerManager.AddAllTileSourcesTo3D(spacecontrol);
spacecontrol.AttachEvent("OnCameraChanged","OnView3DUpdateViewpoint");
spacecontrol.AttachEvent("OnHardwareCapabilitiesUpdate","OnHardwareCapabilitiesUpdate");
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")}else spacecontrol.FixedView=true;
traffic3dAdded=false;
if(typeof VE_TrafficManager!="undefined"&&VE_TrafficManager!=null)VE_TrafficManager.GetTrafficInfo(false);
if(typeof VE_BrandFinderAdManager!="undefined"&&VE_BrandFinderAdManager!=null)VE_BrandFinderAdManager.Clear();
if(!init3dparam)Relay3DPushpins();
Fire("oninitmode",Msn.VE.MapActionMode.Mode3D)};
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;
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"};
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"}};
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.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){dashboard.Destroy();
dashboard=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",IgnoreEvent);
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;
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("onresize",scaleBar.Reposition);
scaleBar.Destroy();
scaleBar=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(){view3DCreated=false;
try{spacecontrol.Close()}catch(a){}spacecontrol=false;
window.status="";
if(spacediv!=null){spacediv.removeNode(true);
spacediv=null}if(dashboardContainer)destroyIFrameShim(dashboardContainer.id);
Fire("ondestroymode",Msn.VE.MapActionMode.Mode3D)};
function UpdateFromParent(){x=GetLeftPosition(p_elSource);
y=GetTopPosition(p_elSource);
width=p_elSource.offsetWidth;
height=p_elSource.offsetHeight}function CreateDashboard(d,e,a,b,c){if(typeof a=="undefined"||a==null)a=Msn.VE.DashboardSize.Normal;
dashboardContainer=document.createElement("div");
if(typeof b=="undefined"||b==null)b="MSVE_dashboardId";
dashboardContainer.id=b;
p_elSource.appendChild(dashboardContainer);
dashboardContainer.style.top=e+"px";
dashboardContainer.style.left=d+"px";
dashboardContainer.attachEvent("onmousedown",IgnoreEvent);
dashboardContainer.attachEvent("onmouseup",IgnoreEvent);
dashboardContainer.attachEvent("onmousemove",DashboardContainerMouseMoveEvent);
dashboardContainer.attachEvent("onmousewheel",IgnoreEvent);
dashboardContainer.attachEvent("ondblclick",IgnoreEvent);
dashboardContainer.attachEvent("oncontextmenu",IgnoreEvent);
dashboardContainer.attachEvent("onkeydown",IgnoreEvent);
dashboardContainer.attachEvent("onkeyup",IgnoreEvent);
if(typeof view3DMode!="undefined"){if(currentMode==threeDMode&&currentMode!=null)a=Msn.VE.DashboardSize.Normal;
dashboard=new Msn.VE.NavAction(dashboardContainer,p_this,a,c);
dashboard.Init()}else{dashboard=new Msn.VE.Dashboard(dashboardContainer,p_this,a);
dashboard.Init()}}function DashboardContainerMouseMoveEvent(a){a=GetEvent(a);
return false}function CreateMinimap(a,b,e,c,d){minimapContainer=document.createElement("div");
minimapContainer.id="MSVE_minimap";
p_elSource.appendChild(minimapContainer);
minimapContainer.className="expanded MSVE_smallMinimap";
minimapContainer.attachEvent("onmousedown",IgnoreEvent);
minimapContainer.attachEvent("onmouseup",IgnoreEvent);
minimapContainer.attachEvent("onmousemove",IgnoreEvent);
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,d);
if(c)minimapControl.Init();
if(a!=null&&typeof a!="undefined"&&b!=null&&typeof b!="undefined")minimapControl.SetPosition(a,b);
return minimapControl}function SetDefaultView(){var a=new Msn.VE.MapView(p_this);
a.SetCenterLatLong(new Msn.VE.LatLong(0,0));
a.SetZoomLevel(1);
a.SetMapStyle(roadStyle);
SetMapTiles();
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 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,e,d){Sync3dView();
var a=currentView.MakeCopy();
a.SetMapStyle(ValidateMapStyle(b),e,d);
if(currentView.mapStyle!=b)if(b==obliqueStyle){Fire("onstartmapstyleoblique");
a.SetZoomLevel(1);
lastOrthoZoomLevel=currentView.zoomLevel;
lastOrthoMapStyle=currentView.mapStyle}else if(currentView.mapStyle==obliqueStyle){Fire("onendmapstyleoblique");
a.SetZoomLevel(lastOrthoZoomLevel)}var c=currentView.GetCenterLatLong();
a.latlong.latitude=c.latitude;
a.latlong.longitude=c.longitude;
SetView(a)}function SetScaleBarDistanceUnit(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 ValidateMapStyle(a){if(a==aerialStyle||a==hybridStyle||a==obliqueStyle||a==shadedStyle)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);
if(obliqueMode)obliqueMode.UpdateAvailability()}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 GetAltitude(){return currentView.GetAltitude()}function GetTilt(){return currentView.GetTilt()}function GetDirection(){return currentView.GetDirection()}function EnableMode(c,a){switch(c){case Msn.VE.MapActionMode.Mode3D:var b=window.navigator.userAgent;
if(b.indexOf("MSIE")!=-1)this._Enable3DMode(a);else if(b.indexOf("Firefox")!=-1)this._Enable3DMode(a);else ShowNonIENotSupportedDialog();
break;case Msn.VE.MapActionMode.Mode2D:default:this._Disable3DMode(a);
UnHidePins();
break}}function _Enable3DMode(a){if(currentMode!=threeDMode&&currentMode!=null){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;
break}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","http://go.microsoft.com/fwlink/?LinkID=98777",1,0.6);
traffic3dAdded=true}}function Remove3DTraffic(){if(view3DCreated&&traffic3dAdded){spacecontrol.RemoveImageSource("Terrain","Traffic");
traffic3dAdded=false}}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 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,d,c;
if(!b||b<=0)d="100%";else d=b+"px";
if(!a||a<=0)c="100%";else c=a+"px";
p_elSource.style.width=d;
p_elSource.style.height=c;
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(!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 SetObliqueOrientation(a){if(obliqueMode)SetMapStyle(obliqueStyle,null,a)}function Debug(a){debug=a}function SetCopyrightOffset(a,b){if(copyright)copyright.SetOffset(a,b);
if(scaleBar)scaleBar.SetOffset(a,b)}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 ShowIEx64NotSupportedDialog(){Fire("onerror",CreateEvent(currentView.latlong,currentView.zoomLevel,L_x64BrowserNotSupported_Text))}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(obliqueMode)obliqueMode.SetClientToken(m_clientToken)}function GetTopPx(){if(typeof p_elSource!="undefined"&&p_elSource!=null)return GetTopPosition(p_elSource);else return 0}function GetLeftPx(){if(typeof p_elSource!="undefined"&&p_elSource!=null)return GetLeftPosition(p_elSource);else return 0}function GetObliqueAvailability(b,a){if(obliqueMode)obliqueMode.GetObliqueAvailability(b,a);else if(typeof a=="function")a(false)}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,j){var c=tileSize*i*Math.pow(2,g-f),e=tileSize*h*Math.pow(2,g-f);
if(j==obliqueStyle){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 b=[];
b[Msn.VE.MapStyle.Oblique]=[L_MapControlImageCourtesyOfPictometry_Text,L_MapControlImageCourtesyOfBlom_Text];
b[Msn.VE.MapStyle.Road]=[L_MapControlNavteq_Text,L_MapControlImageCourtesyOfAND_Text,L_MapControlImageCourtesyOfMapDataSciences_Text,L_MapControlImageCourtesyOfZenrin_Text,L_MapControlImageCourtesyOfIntermap_Text];
b[Msn.VE.MapStyle.Aerial]=[L_MapControlImageCourtesyOfNASA_Text,L_MapControlHarrisCorp_Text,L_MapControlImageCourtesyOfUSGS_Text,L_MapControlImageCourtesyOfEarthData_Text,L_MapControlImageCourtesyOfGetmapping_Text,L_MapControlImageCourtesyOfGeoEye_Text,L_MapControlImageCourtesyOfPasco_Text,L_MapControlImageCourtesyOfIntergraph_Text,L_MapControlImageCourtesyOfTerraItaly_Text,L_MapControlImageCourtesyOfIntermap_Text];
var a=[];
a[Msn.VE.MapStyle.Oblique]=[];
a[Msn.VE.MapStyle.Oblique][L_MapControlImageCourtesyOfPictometry_Text]=[];
a[Msn.VE.MapStyle.Oblique][L_MapControlImageCourtesyOfBlom_Text]=[];
a[Msn.VE.MapStyle.Road]=[];
a[Msn.VE.MapStyle.Road][L_MapControlNavteq_Text]=[];
a[Msn.VE.MapStyle.Road][L_MapControlImageCourtesyOfAND_Text]=[];
a[Msn.VE.MapStyle.Road][L_MapControlImageCourtesyOfMapDataSciences_Text]=[];
a[Msn.VE.MapStyle.Road][L_MapControlImageCourtesyOfZenrin_Text]=[];
a[Msn.VE.MapStyle.Road][L_MapControlImageCourtesyOfIntermap_Text]=[];
a[Msn.VE.MapStyle.Aerial]=[];
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfNASA_Text]=[];
a[Msn.VE.MapStyle.Aerial][L_MapControlHarrisCorp_Text]=[];
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfUSGS_Text]=[];
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfEarthData_Text]=[];
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGetmapping_Text]=[];
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text]=[];
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfPasco_Text]=[];
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIntergraph_Text]=[];
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfTerraItaly_Text]=[];
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIntermap_Text]=[];
a[Msn.VE.MapStyle.Oblique][L_MapControlImageCourtesyOfPictometry_Text].push(new VECopyrightTableEntry(1,20,24,-125,49,-66));
a[Msn.VE.MapStyle.Oblique][L_MapControlImageCourtesyOfBlom_Text].push(new VECopyrightTableEntry(1,20,34,-13,72,35));
a[Msn.VE.MapStyle.Road][L_MapControlNavteq_Text].push(new VECopyrightTableEntry(1,9,-90,-180,90,180));
a[Msn.VE.MapStyle.Road][L_MapControlNavteq_Text].push(new VECopyrightTableEntry(10,19,16,-180,90,-50));
a[Msn.VE.MapStyle.Road][L_MapControlNavteq_Text].push(new VECopyrightTableEntry(10,19,27,-32,40,-13));
a[Msn.VE.MapStyle.Road][L_MapControlNavteq_Text].push(new VECopyrightTableEntry(10,19,35,-11,72,20));
a[Msn.VE.MapStyle.Road][L_MapControlNavteq_Text].push(new VECopyrightTableEntry(10,19,21,20,72,32));
a[Msn.VE.MapStyle.Road][L_MapControlNavteq_Text].push(new VECopyrightTableEntry(10,17,21.92,113.14,22.79,114.52));
a[Msn.VE.MapStyle.Road][L_MapControlNavteq_Text].push(new VECopyrightTableEntry(10,17,21.73,119.7,25.65,122.39));
a[Msn.VE.MapStyle.Road][L_MapControlNavteq_Text].push(new VECopyrightTableEntry(10,17,0,98.7,8,120.17));
a[Msn.VE.MapStyle.Road][L_MapControlNavteq_Text].push(new VECopyrightTableEntry(10,17,0.86,103.2,1.92,104.45));
a[Msn.VE.MapStyle.Road][L_MapControlImageCourtesyOfAND_Text].push(new VECopyrightTableEntry(10,19,-90,-180,90,180));
a[Msn.VE.MapStyle.Road][L_MapControlImageCourtesyOfMapDataSciences_Text].push(new VECopyrightTableEntry(5,17,-45,111,-9,156));
a[Msn.VE.MapStyle.Road][L_MapControlImageCourtesyOfMapDataSciences_Text].push(new VECopyrightTableEntry(5,17,-49.7,164.42,-30.82,180));
a[Msn.VE.MapStyle.Road][L_MapControlImageCourtesyOfZenrin_Text].push(new VECopyrightTableEntry(4,18,23.5,122.5,46.65,151.66));
a[Msn.VE.MapStyle.Road][L_MapControlImageCourtesyOfIntermap_Text].push(new VECopyrightTableEntry(1,21,49,-11,60,2));
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfNASA_Text].push(new VECopyrightTableEntry(1,8,-90,-180,90,180));
a[Msn.VE.MapStyle.Aerial][L_MapControlHarrisCorp_Text].push(new VECopyrightTableEntry(9,13,-90,-180,90,180));
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfUSGS_Text].push(new VECopyrightTableEntry(14,19,17.99,-150.11,61.39,-65.57));
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfEarthData_Text].push(new VECopyrightTableEntry(14,19,21.25,-158.3,21.72,-157.64));
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfEarthData_Text].push(new VECopyrightTableEntry(14,19,39.99,-80.53,40.87,-79.43));
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfEarthData_Text].push(new VECopyrightTableEntry(14,19,34.86,-90.27,35.39,-89.6));
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGetmapping_Text].push(new VECopyrightTableEntry(14,19,49.94,-6.35,58.71,1.78));
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push(new VECopyrightTableEntry(14,17,44.43,-63.75,45.06,-63.45));
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push(new VECopyrightTableEntry(14,17,45.39,-73.78,45.66,-73.4));
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push(new VECopyrightTableEntry(14,17,45.2,-75.92,45.59,-75.55));
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push(new VECopyrightTableEntry(14,17,42.95,-79.81,44.06,-79.42));
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push(new VECopyrightTableEntry(14,17,50.35,-114.26,51.25,-113.82));
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push(new VECopyrightTableEntry(14,17,48.96,-123.33,49.54,-122.97));
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push(new VECopyrightTableEntry(14,17,-35.42,138.32,-34.47,139.07));
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push(new VECopyrightTableEntry(14,17,-32.64,115.58,-32.38,115.85));
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push(new VECopyrightTableEntry(14,17,-34.44,150.17,-33.27,151.49));
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfGeoEye_Text].push(new VECopyrightTableEntry(14,17,-28.3,152.62,-26.94,153.64));
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfEarthData_Text].push(new VECopyrightTableEntry(14,19,40.6,-74.18,41.37,-73.51));
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfPasco_Text].push(new VECopyrightTableEntry(14,17,23.5,122.5,46.65,151.66));
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIntergraph_Text].push(new VECopyrightTableEntry(14,19,47,5,55.5,16));
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfTerraItaly_Text].push(new VECopyrightTableEntry(14,21,43.15,6.5,47.15,14));
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfTerraItaly_Text].push(new VECopyrightTableEntry(14,21,41.3,9.9,43.15,16.4));
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfTerraItaly_Text].push(new VECopyrightTableEntry(14,21,36.5,7.9,41.3,18.7));
a[Msn.VE.MapStyle.Aerial][L_MapControlImageCourtesyOfIntermap_Text].push(new VECopyrightTableEntry(1,21,49,-11,60,2));
this.CreditsFor=function(c,k,l,j){var g=[];
if(c!="undefined"&&c!=null&&typeof b[c]!="undefined"&&b[c]!=null){var m=b[c].length;
for(var e=0;e<m;++e){var h=b[c][e],f=a[c][h],i=f.length;
for(var d=0;d<i;++d)if(f[d].IsMatch(k,l,j)){g.push(h);
break}}}return g};
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 b=b.concat(this.CreditsFor(a.mapStyle,a.zoomLevel,a.latlong.latitude,a.latlong.longitude));
return b}}var g_sVECopyrightTable=new VECopyrightTable;
function Copyright(e){var a=document.createElement("div"),b=document.createElement("div"),c=13,h=0,f=0;
this.Show=function(){e.appendChild(a);
e.appendChild(b)};
this.Hide=function(){try{e.removeChild(a);
e.removeChild(b)}catch(c){}};
this.Init=function(){a.className="MSVE_Copyright MSVE_CopyrightBackground";
b.className="MSVE_Copyright MSVE_CopyrightForeground";
d();
this.Show()};
this.Destroy=function(){this.Hide();
a=b=null};
function d(){a.style.bottom=3+f+(c<=13?4:0)+"px";
a.style.height=c+"px";
b.style.bottom=3+1+f+(c<=13?4:0)+"px";
b.style.height=c+"px"}function i(){var h=g_sVECopyrightTable.CreditsForView(currentView),g="",f="";
for(var e=0;e<h.length;++e){if(e>0)if(e==2){f+="<br/>";
g+="\n"}else{f+="&nbsp;&nbsp;";
g+="  "}f+=h[e];
g+=h[e]}if(view3DCreated)spacecontrol.SetCopyrightString(g);
if(h.length<=2)c=13;else c=21;
a.innerHTML=f;
b.innerHTML=f;
d()}function g(a,b){h=a;
f=b;
d()}this.Reposition=d;
this.Update=i;
this.SetOffset=g}function MapEvent(f,d,e,a,c,b){this.view=f;
this.oblique=d;
this.error=e;
this.requestedView=a;
this.elementID=c;
this.mouseButton=b}function CreateEvent(a,f,c,d,e,k){var b=currentView.MakeCopy();
if(a!=null&&a instanceof Msn.VE.LatLong)if(Msn.VE.API!=null){var j=new VELatLongFactory(new VELatLongFactorySpecFromMapView(b));
b.LatLong=j.CreateVELatLong(a.latitude,a.longitude)}else b.latlong=a;
if(f!=null&&typeof f=="number")b.zoomLevel=f;
if(c==null||typeof c=="undefined")c="";
var h=null;
if(obliqueMode)h=obliqueMode.GetEventInfo();
var g=null;
if(d!=null&&d instanceof Msn.VE.MapView)g=d.MakeCopy();
var i=null;
if(typeof e!="undefined"&&e!=null)i=e;
return new MapEvent(b,h,c,g,i,k)}function CreateCustomEvent(e,b,d){var a=new MapEvent;
if(d)a.error=d.error;
a.eventName=e;
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;
a.clientX=GetMouseX(b);
a.clientY=GetMouseY(b);
a.mapX=a.clientX-GetLeftPosition(p_elSource);
a.mapY=a.clientY-GetTopPosition(p_elSource);
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){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(b,a){var c=false,d=customEventTable[b];
if(d){var g=window.event;
if(a&&MapEvent.prototype.isPrototypeOf(a))a=CreateCustomEvent(b,g,a);else a=CreateCustomEvent(b,g,null);
var f=true;
if(Msn.VE.API!=null)if(b=="onmouseover")if(currentShapeID==a.elementID){f=false;
c=true}else currentShapeID=a.elementID;else if(b=="onmouseout")currentShapeID=null;
for(var e=0;e<d.length&&f;e++)c=c|d[e](a)}return c}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 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();
break;case 109:case 189:a=0;
b=0;
ZoomOut();
break;case 65:a=0;
b=0;
SetMapStyle(aerialStyle);
break;case 72:a=0;
b=0;
SetMapStyle(hybridStyle);
break;case 82:a=0;
b=0;
SetMapStyle(roadStyle);
break;case 66:case 79:a=0;
b=0;
SetMapStyle(obliqueStyle);
break;case 51:case 99:p_this.EnableMode(Msn.VE.MapActionMode.Mode3D);
break;default:break}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;
break}if(d)ContinuousPan(b,c,null,true);
if(FireCustomEvent("onkeypress",a))return false}var northLatitude=0,southLatitude=0,westLongitude=0,eastLongitude=0;
function AddLine(h,f,g,k,m,l,a,d,i,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,k,m,l,e,d,i,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(){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()}function UpdateLines(){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 v=5,m=new Msn.Drawing.Color(0,169,235,0.7),d=new Msn.Drawing.Stroke,H=4,c=null,e="",g=true,A="",o="",t=0,y=0,x=0,B=0,z=0,a=null,b=null,j=null,i=null,I=0,J=0,f=null,p=false;
function F(l,u,w,c,g,h,q,r,k,n){if(!c)c=v;
if(!g)g=m;
if(!h)h=defaultZIndex;
p=n;
this.id=l;
e=l;
if(k)d.linejoin=k;
A=c+"pt";
o=g;
t=h;
a=u;
b=w;
i=r;
j=q;
y=a[0];
x=b[0];
B=a[a.length-1];
z=b[b.length-1];
f=currentView.MakeCopy();
d.color=m;
d.width=c;
s();
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);
n();
a=b=j=c=f=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,o,0.75,d.width)}};
function n(){if(graphicCanvas)graphicCanvas.Clear()}function G(){if(!g){h();
return}if(c)c.style.display="block"}function h(){if(c)c.style.display="none"}function w(a){g=a;
if(!g)h()}function s(){l();
q();
f.Copy(currentView)}function D(){l();
q();
f=currentView.MakeCopy();
}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 q(){if(currentView.mapStyle==obliqueStyle){graphicCanvas.Clear();
return}if(view3DCreated)return;
var b=[],a=i.length-1;
while(i[a]<currentView.zoomLevel&&a>=0)a--;
k(j[a],b);
C(b)}function k(f,c){if(u(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(r(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(r(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(b){if(!graphicCanvas)return;
h();
graphicCanvas.Clear();
var a=new Msn.Drawing.PolyLine(b);
a.id=e;
d.width=4;
graphicCanvas.SetZIndex(t);
graphicCanvas.SetStroke(d);
graphicCanvas.DrawPrimitive(a,p);
c=$ID(e);
if(g)c.style.display="block";else c.style.display="none"}function r(a,b){return a>=southLatitude&&a<=northLatitude&&b>=westLongitude&&b<=eastLongitude}function u(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=n;
this.Show=G;
this.Hide=h;
this.ChangeVisibility=w;
this.StartLine=s;
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");
var d="http://"+location.host,c="";
if(Msn.VE.API!=null){d=Msn.VE.API.Globals.vecurrentdomain;
c=Msn.VE.API.Globals.vecurrentversion}else c=window.buildVersion;
a.src=d+"/i/bin/"+c+"/"+MapControl.Features.Image.PoweredLogo;
a.className="MSVE_PoweredByLogo"}b.appendChild(a)};
this.Destroy=function(){a=null}}var hijackMouseMove=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.altKey)currentTool=boxTool;
if(!document.all&&!isEnablingDefaultDblClick){isEnablingDefaultDblClick=true;
return false}dragging=true;
var b=typeof a.which!="undefined"?a.which:a.button;
if(!hijackMouseMove&&b==1)p_this.SetCursor(cssCursors.Grabbing);
currentTool.OnMouseDown(a);
return false}function MouseMove(a){a=GetEvent(a);
if(currentMode!=threeDMode&&FireCustomEvent("onmousemove",a))return false;
if(hijackMouseMove){a=GetEvent(a);
CancelEvent(a);
x=GetLeftPosition(p_elSource);
y=GetTopPosition(p_elSource);
var c=originX+offsetX+GetMouseX(a)-x,d=originY+offsetY+GetMouseY(a)-y,b=CreateEvent(currentMode.PixelToLatLong(new VEPixel(c,d),currentView.zoomLevel));
FireDefaultEvent("onmousemove",b);
return}if(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)p_this.SetCursor(cssCursors.Grab);
var b=currentTool.OnMouseUp(a);
if(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}var isEnablingDefaultDblClick=true;
function MouseDoubleClick(a){a=GetEvent(a);
CancelEvent(a);
if(currentMode!=threeDMode&&FireCustomEvent("ondoubleclick",a))return false;
if(hijackMouseMove)return false;
if(isEnablingDefaultDblClick){UpdateFromParent();
if(panning||zooming||mouseZoomDisabled)return false;
if(GetMapStyle()!=Msn.VE.MapStyle.Oblique){var d=tileSize*Math.pow(2,currentView.zoomLevel),b=originX+offsetX+GetMouseX(a)-x;
if(b<0||b>d)return false;
b=originY+offsetY+GetMouseY(a)-y;
if(b<0||b>d)return false}var c=preferredView.MakeCopy();
c.SetCenter(new VEPixel(originX+offsetX+GetMouseX(a)-x-mapCenterOffset.x,originY+offsetY+GetMouseY(a)-y-mapCenterOffset.y));
if(a.altKey)c.SetZoomLevel(currentView.zoomLevel-1);else c.SetZoomLevel(currentView.zoomLevel+1);
SetView(c);
return false}else isEnablingDefaultDblClick=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 b=GetMouseScrollDelta(a);
if(b>0)ZoomIn();else if(b<0)ZoomOut();
return false}function ContextMenu(a){if(mouseZoomDisabled)return false;
a=GetEvent(a);
CancelEvent(a);
if(currentMode!=threeDMode&&FireCustomEvent("onclick",a))return false;
x=GetLeftPosition(p_elSource);
y=GetTopPosition(p_elSource);
var b,c;
if(currentMode==threeDMode){b=GetMouseX(a)-x;
c=GetMouseY(a)-y}else{b=originX+offsetX+GetMouseX(a)-x;
c=originY+offsetY+GetMouseY(a)-y}var d=currentMode.PixelToLatLong(new VEPixel(b,c),currentView.zoomLevel);
if(d!=null){var e=CreateEvent(d);
FireDefaultEvent("oncontextmenu",e)}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);
CancelEvent(a);
var b=a&&a.srcElement&&a.srcElement.tagName;
if(currentMode!=threeDMode&&(b=="shape"||b=="polyline")&&FireCustomEvent("onmouseout",a))return false}function MouseOver(a){a=GetEvent(a);
CancelEvent(a);
var b=a&&a.srcElement&&a.srcElement.tagName;
if(currentMode!=threeDMode&&(b=="shape"||b=="polyline")&&FireCustomEvent("onmouseover",a))return false}function MouseEnter(a){a=GetEvent(a);
CancelEvent(a);
var b=a.relatedTarget||a.fromElement;
if(currentMode!=threeDMode&&b!=null&&FireCustomEvent("onmouseover",a))return false}function MouseLeave(a){a=GetEvent(a);
CancelEvent(a);
if(currentMode!=threeDMode&&FireCustomEvent("onmouseout",a))return false}var obliqueLoop=0;
function PanMap(c,d){if(c==0&&d==0)return false;
if(currentMode!=threeDMode){var a=ShiftView(currentView,currentBounds,c,d);
if(typeof a!="undefined"&&a!=null){map.style.left=map.offsetLeft-a.x+"px";
map.style.top=map.offsetTop-a.y+"px";
offsetX=-map.offsetLeft;
offsetY=-map.offsetTop;
var b=new VEPixel(width/2+originX+offsetX,height/2+originY+offsetY);
if(keyboardPan&&a.x==0&&a.y==0){if(typeof currentMode.RequestPending!="undefined"&&!currentMode.RequestPending()){b.x+=c;
b.y+=d;
var e=PixelToLatLong(b);
targetTool.centeringTrigger=true;
SetCenter(e.latitude,e.longitude)}}else{currentView.SetCenter(b);
preferredView.SetCenter(new VEPixel(b.x,b.y));
window.setTimeout(tileLayerManager.PanView,1)}}}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){PanMap(panningX,panningY);
if(panCounter>0)panCounter--;
if(panCounter!=0)window.setTimeout(StepPan,10);else StopContinuousPan()}}function StopContinuousPan(){panningX=0;
panningY=0;
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;
PanToPixel(LatLongToPixel(new Msn.VE.LatLong(b,a)),c)}}function PanToView(a){var b=a.center.x-(originX+offsetX),c=a.center.y-(originY+offsetY);
PanToPixel(new VEPixel(b,c))}function PanToPixel(a,j){if(currentView.mapStyle==obliqueStyle){obliqueLoop++;
if(obliqueLoop>30){obliqueLoop=0;
return}var h=obliqueMode.GetScene();
if(!h||!h.ContainsPixel(a,currentView.zoomLevel)){var d=preferredView.MakeCopy();
d.sceneId=null;
d.SetCenterLatLong(PixelToLatLong(a));
SetView(d);
if(resizeInProgress)resizeInProgress=false;
return}}var b=a.x-width/2,c=a.y-height/2,e=Math.sqrt(b*b+c*c);
if(!j&&(!IsAnimationEnabled()||MathAbs(b)>2*width||MathAbs(c)>2*height||e>1.5*Math.sqrt(width*width+height*height))){var d=preferredView.MakeCopy(),k=a.x+(originX+offsetX),l=a.y+(originY+offsetY);
d.SetCenter(new VEPixel(k,l));
SetView(d);
if(resizeInProgress)resizeInProgress=false;
return}var f=Math.atan2(c,b),g=MathCeil(e/panToLatLongSpeed),i=MathRound(e/g);
b=MathRound(Math.cos(f)*i);
c=MathRound(Math.sin(f)*i);
ContinuousPan(b,c,g)}function PushPinOffset(a,b){this.x=a;
this.y=b}function getPushPinOffset(c){var b=Msn.VE.PushPinTypes,a;
switch(c){case b.Annotation:a=new PushPinOffset(-2,-29/2-5);
break;case b.SearchResult:a=new PushPinOffset(0,-29/2+3);
break;case b.Direction:a=new PushPinOffset(-3,-26/2-3);
break;case b.DirectionTemp:a=new PushPinOffset(2,-26/2+3);
break;case b.TrafficLight:a=new PushPinOffset(0,-26/2);
break;case b.TrafficOthers:a=new PushPinOffset(0,-29/2);
break;case b.YouAreHere:a=new PushPinOffset(0,-26/2);
break;case b.AdStandard:a=new PushPinOffset(0,-42/2+2);
break;case b.AdWide:a=new PushPinOffset(0,-27/2);
break;case b.Default:default:a=new PushPinOffset(0,0);
break}return a}function GetPushpins(){return pushpins}function AddPushpin(l,j,k,i,g,d,e,h,f,b,c){var a=new Pushpin;
a.Init(l,j,k,i,g,d,e,h,f);
if(typeof b=="undefined"||b==false||b==null){if(IsModeEnabled(Msn.VE.MapActionMode.Mode3D)){if(!(typeof c!="undefined"&&c==false))View3DAddPushpin(l,j,k,i,g,d,e,h,f);
map.appendChild(a.pin);
a.Hide()}else map.appendChild(a.pin);
pushpins.push(a)}return a.pin}function RemovePushpin(b){for(var a=0;a<pushpins.length;a++){var c=pushpins[a];
if(c.id==b){pushpins.splice(a,1);
if(IsModeEnabled(Msn.VE.MapActionMode.Mode3D))View3DRemovePushpin(b);
c.Destroy();
break}}}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.id,a.lat,a.lon,a.width,a.height,a.className,a.innerHtml,a.zIndex,a.pinType)}}function RepositionPushpins(){for(var a=0;a<pushpins.length;a++)pushpins[a].Reposition()}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 Pushpin(){var e=true,a=document.createElement("a");
a.href="javascript://pushin hover";
a.onclick=function(){return ParseShiftKeyForLinks(event)};
a.vePushpin=this;
this.pin=a;
var c=0,d=0,g=0,i=0,b=null,n=0,m=0,u=zoomTotalSteps+1,h=new Array(u),j=new Array(u),f;
this.Init=function(w,u,v,t,r,j,o,x,p){this.id=w;
this.lat=u;
this.lon=v;
this.width=t;
this.height=r;
this.className=j;
this.innerHtml=o;
this.zIndex=x;
this.pinType=p;
a.id=w;
a.className=j;
a.style.position="absolute";
a.innerHTML=o;
a.pinType=p||Msn.VE.PushPinTypes.Default;
f=getPushPinOffset(a.pinType);
if(!p_htParams.fixedView){a.attachEvent("ondblclick",q);
a.attachEvent("onmousewheel",s)}a.unselectable="on";
b=new Msn.VE.LatLong(u,v);
n=t;
m=r;
var h=currentMode.LatLongToPixel(b,currentView.zoomLevel);
if(h&&e){c=MathRound(h.x-originX);
d=MathRound(h.y-originY);
g=c;
i=d;
k();
l(0);
a.style.display="block"}else a.style.display="none"};
this.Destroy=function(){a.detachEvent("ondblclick",q);
a.detachEvent("onmousewheel",s);
o();
a.vePushpin=null;
a=null;
this.pin=null;
while(h.length>0)h.pop();
while(j.length>0)j.pop()};
this.GetLatitude=function(){return b.latitude};
this.GetLongitude=function(){return b.longitude};
function r(){var b=zoomTotalSteps;
for(var a=0;a<=b;a++){h[a]=c-n/2+f.x+"px";
j[a]=d-m/2+f.y+"px"}}function k(){var k=zoomTotalSteps;
for(var a=0;a<=k;a++){var b=a/k,e=1-b;
h[a]=MathFloor(e*c+b*g-n/2+f.x)+"px";
j[a]=MathFloor(e*d+b*i-m/2+f.y)+"px"}}function l(b){a.style.left=h[b];
a.style.top=j[b]}function w(){var a=0;
a=c;
c=g;
g=a;
a=d;
d=i;
i=a}function t(){var f=currentMode.LatLongToPixel(b,currentView.zoomLevel);
if(f){c=MathRound(f.x-originX);
d=MathRound(f.y-originY);
r();
l(0);
if(a.style.display!="none"&&e)a.style.display="block"}else a.style.display="none"}function x(){if(!e){a.style.display="block";
e=true}}function y(){if(e){a.style.display="none";
e=false}}function v(h,j,l){c-=offsetX;
d-=offsetY;
var f=currentMode.LatLongToPixel(b,l);
if(f){g=MathRound(f.x-h);
i=MathRound(f.y-j);
k();
if(a.style.display!="none"&&e)a.style.display="block"}else a.style.display="none"}function o(){if(a.parentNode==map)map.removeChild(a)}function q(a){a=GetEvent(a);
CancelEvent(a);
if(FireCustomEvent("ondoubleclick",a))return;
if(panning||zooming)return false;
var c=preferredView.MakeCopy();
c.SetCenterLatLong(b);
if(a.altKey)c.SetZoomLevel(currentView.zoomLevel-1);else c.SetZoomLevel(currentView.zoomLevel+1);
SetView(c);
return false}function s(a){a=GetEvent(a);
CancelEvent(a);
if(FireCustomEvent("onmousewheel",a))return;
if(panning||zooming)return false;
var b=GetMouseScrollDelta(a);
if(b>0)ZoomIn();else if(b<0)ZoomOut();
return false}function z(a){p(PixelToLatLong(a))}function p(a){b=a;
t()}this.ClearSteps=r;
this.PrecomputeSteps=k;
this.SetFactor=l;
this.SwapStates=w;
this.Reposition=t;
this.PrepareForZoom=v;
this.RemoveFromMap=o;
this.Move=z;
this.MoveToLatLon=p;
this.Hide=y;
this.UnHide=x}function ScaleBar(f){var r=0,c=0,i=null,a=document.createElement("div"),b=document.createElement("div"),d=document.createElement("div"),g=document.createElement("div"),h=150;
this.Init=function(){a.className="MSVE_ScaleBarLabel MSVE_ScaleBarLabelBackground";
b.className="MSVE_ScaleBarLabel MSVE_ScaleBarLabelForeground";
d.className="MSVE_ScaleBar MSVE_ScaleBarBackground";
g.className="MSVE_ScaleBar MSVE_ScaleBarForeground";
l();
j();
f.appendChild(a);
f.appendChild(b);
f.appendChild(d);
f.appendChild(g)};
this.Destroy=function(){a=b=d=BarFg=null};
function j(){a.style.bottom=33+c+"px";
b.style.bottom=34+c+"px";
d.style.bottom=25+c+"px";
g.style.bottom=26+c+"px"}function m(a){return a*0.001}function o(a){return a*0.000621371192}function p(a){return a*1.0936133}function n(a){i=a}function l(){try{var g=GetMetersPerPixel(),c=g*h,f;
if(i==null)f=$MVEM.IsEnabled(MapControl.Features.ScaleBarKilometers);else f=i==Msn.VE.DistanceUnit.Kilometers;
if(f){var d=L_ScaleBarKilometers_Text,b=m(c),a=e(b);
if(a<0.5){d=L_ScaleBarMeters_Text;
b=c;
a=e(b)}k("metric",d,a,Math.round(a/b*h))}else{var d=L_ScaleBarMiles_Text,b=o(c),a=e(b);
if(a<0.5){d=L_ScaleBarYards_Text;
b=p(c);
a=e(b)}k("us",d,a,Math.round(a/b*h))}}catch(j){}}function e(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)*0.5;
return f*a}function k(i,h,c,e){if(c<1)c=c.toFixed(1);
var f=c+" "+h;
a.innerHTML=f;
b.innerHTML=f;
d.style.width=e;
g.style.width=e}function q(a,b){r=a;
c=b;
j()}this.SetDistanceUnit=n;
this.Update=l;
this.Reposition=j;
this.SetOffset=q}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];
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,r=null,t=0,u=0,s=0,A=0,g=0,d=1,w=zoomTotalSteps+1,k=new Array(w),m=new Array(w),q=new Array(w),o=new Array(w),z=false,e=0,f=0,i=0,h=0,j=0,l=0,p=0,n=0,y=null,B=0;
this.Init=function(k,l,m,j,c,e,f,a,h,i){t=k;
u=l;
s=m;
A=j;
g=i;
d=h;
if(!currentMode.IsValidTile(t,u,s))return;
x(c,e,tileSize,tileSize);
F(c,e,tileSize,tileSize);
v();
if(a==mapTiles||a==trafficTiles)B=0;else B=1;
b=new Image;
b.onload=O;
b.onerror=N;
y=new Date;
b.src=currentMode.GetFilename(t,u,s,f,a)};
this.Destroy=function(){if(a)a.onmousedown=null;
E();
while(k.length>0)k.pop();
while(m.length>0)m.pop();
while(q.length>0)q.pop();
while(o.length>0)o.pop();
k=m=q=o=null};
function x(c,d,b,a){e=c;
f=d;
i=b;
h=a}this.SetCurrentState=x;
function F(c,d,b,a){j=c;
l=d;
p=b;
n=a}this.SetNextState=F;
function L(){for(var a=0;a<=zoomTotalSteps;a++){k[a]=e+"px";
m[a]=f+"px";
q[a]=i+"px";
o[a]=h+"px"}}this.ClearSteps=L;
function v(){for(var a=0;a<=zoomTotalSteps;a++){var b=a/zoomTotalSteps,c=1-b;
k[a]=MathFloor(c*e+b*j)+"px";
m[a]=MathFloor(c*f+b*l)+"px";
q[a]=MathCeil(c*i+b*p)+"px";
o[a]=MathCeil(c*h+b*n)+"px"}}this.PrecomputeSteps=v;
function H(e){if(a==null||zooming&&!z)return;
var b=a.style;
b.left=k[e];
b.top=m[e];
b.width=q[e];
b.height=o[e];
if(debug&&e==0){if(!c)D();
var f=c.style;
b.border="1px dashed red";
f.left=k[e];
f.top=m[e]}if(a.parentNode!=map){b.position="absolute";
b.zIndex=g;
if(B>0)if(b&&typeof b.filter!="undefined")if(Msn.VE.Environment.BrowserInfo.MajorVersion<=6){r=document.createElement("div");
var b=r.style;
b.left=k[e];
b.top=m[e];
b.width=q[e];
b.height=o[e];
b.position="absolute";
b.zIndex=g;
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(r)}else{b.zIndex=g;
b.filter="alpha(opacity="+d*100+");opacity:"+d+";";
map.appendChild(a)}else{b.zIndex=g;
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("."));
f.position="absolute";
f.zIndex=g+1;
map.appendChild(c)}}}this.SetFactor=H;
function G(){var a=0;
a=e;
e=j;
j=a;
a=f;
f=l;
l=a;
a=i;
i=p;
p=a;
a=h;
h=n;
n=a}this.SwapStates=G;
function E(){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(r)if(r.parentNode==map)map.removeChild(r)}this.RemoveFromMap=E;
function O(){if(currentView&&s!=currentView.zoomLevel||b==null)return;
var d=new Date,c=d.getTime()-y.getTime();
C(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)H(zoomCounter)}function N(){if(s!=currentView.zoomLevel||b==null)return;
var c=new Date,a=c.getTime()-y.getTime();
C(a);
totalRequestTime+=a;
totalRequestCount++;
totalFailureCount++;
b.onload=null;
b.onerror=null;
b=null}function C(b){for(var a=0;a<responseRangeCeilings[A].length;a++)if(b<responseRangeCeilings[A][a]){responseRangeCounts[a]++;
return}responseRangeCounts[responseRangeCounts.length-1]++}function I(k,m,r,c,d,q){x(e-offsetX,f-offsetY,i,h);
var o=q-r,b=Math.pow(2,o);
j=MathFloor((k+e)*b-c);
l=MathFloor((m+f)*b-d);
p=MathCeil((k+e+i)*b-c)-j;
n=MathCeil((m+f+h)*b-d)-l;
z=true;
v();
g=baseZIndex;
if(a!=null)a.style.zIndex=g}this.PrepareBaseTile=I;
function J(m,o,r,d,k,q){var s=r-q,a=Math.pow(2,s);
j=MathFloor((d+e)*a-m);
l=MathFloor((k+f)*a-o);
p=MathCeil((d+e+i)*a-m)-j;
n=MathCeil((k+f+h)*a-o)-l;
var c=MathCeil(tileViewportWidth*0.25),b=MathCeil(tileViewportHeight*0.25);
z=q<r&&(t<tileViewportX1+c||t>tileViewportX2-c||u<tileViewportY1+b||u>tileViewportY2-b);
G();
v();
g=swapZIndex}this.PrepareSwapTile=J;
function M(b){if(!c)D();
if(a!=null)a.style.border=b?"1px dashed red":"0px";
c.style.display=b?"block":"none"}this.Debug=M;
function K(){p=i;
n=h}this.ClearStates=K;
function D(){c=document.createElement("div");
c.style.font="7pt Verdana, sans-serif";
c.style.color="Red";
c.style.backgroundColor="White"}}function SetMapTiles(){var a=new VETileSourceSpecification;
a.ID=mapTiles;
a.SourceName="http://%1%2.ortho.tiles.virtualearth.net/tiles/%3%4.%5?g=%6";
a.GetTilePath=function(a){try{if(a!=null&&a!="undefined"){var d="",f="",b=0;
for(var c=a.ZoomLevel;c>0;c--){b=0;
var e=1<<c-1;
if((a.XPos&e)!=0)b++;
if((a.YPos&e)!=0)b+=2;
f+=b+""}var c=b%this.NumServers,g=a.MapStyle==Msn.VE.MapStyle.Road&&$MVEM.IsEnabled(MapControl.Features.MapStyle.Shaded)&&typeof currentView!="undefined"&&currentView!=null&&typeof currentView.doRoadShading!="undefined"&&currentView.doRoadShading||a.MapStyle==Msn.VE.MapStyle.Shaded,h=g&&(d!=null&&d.length>0),i=h?d:this.SourceName;
return i.replace(/%1/g,a.MapStyle).replace(/%2/g,c).replace(/%3/g,a.MapStyle).replace(/%4/g,f).replace(/%5/g,a.MapStyle==roadStyle?"png":"jpeg").replace(/%6/g,generations[a.MapStyle])}else return ""}catch(j){}};
a.NumServers=4;
tileLayerManager.AddTileSource(a)}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(a.mapStyle==obliqueStyle)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(){HandleSetViewObliqueResolve(a,c,preferredView)}a.Resolve(currentMode,width,height,b)}function HandleSetViewObliqueResolve(a,c,h){if(targetTool.centeringTrigger){targetTool.centeringTrigger=false;
obliqueMode.RequestSceneAtLatLong(c,a.sceneOrientation,true);
return true}var b=obliqueMode.GetScene();
if((!b||b.GetID()!=a.sceneId)&&a.sceneId!=null){obliqueMode.RequestScene(a.sceneId);
return true}if(!b||!b.ContainsLatLong(c,a.zoomLevel)&&b.GetID()!=a.sceneId||b.GetOrientation()!=a.sceneOrientation){obliqueMode.RequestSceneAtLatLong(c,a.sceneOrientation,true);
return true}c=a.latlong;
h.Copy(a);
currentMode.ValidateZoomLevel(a);
currentBounds=currentMode.GetBounds(a);
ClipView(a,currentBounds);
if(a.Equals(currentView)&&!resizeInProgress)return false;
var f=a.GetX(currentView.zoomLevel)-currentView.center.x,g=a.GetY(currentView.zoomLevel)-currentView.center.y,d=Math.sqrt(f*f+g*g);
previousCenter=currentView.latlong;
var e=0;
if(!previousCenter.Equals(a.latlong))e+=Msn.VE.ViewChangeType.Pan;
if(currentView.zoomLevel!=a.zoomLevel)e+=Msn.VE.ViewChangeType.Zoom;
SetLastViewChangeType(e);
var j=d<width&&d<height&&a.zoomLevel==currentView.zoomLevel&&IsAnimationEnabled()&&a.mapStyle==currentView.mapStyle&&(a.sceneId==null||a.sceneId==currentView.sceneId);
if(j){PanToPixel(new VEPixel(a.center.x-originX-offsetX,a.center.y-originY-offsetY),true);
return true}previousZoomLevel=currentView.zoomLevel;
if(currentView.zoomLevel!=a.zoomLevel){Fire("onstartzoom",CreateEvent(null,null,null,a));
zooming=true}var i=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(i){tileLayerManager.zoomView(a);
return true}UpdateTiles(a);
return true}function SetViewOrtho(a,f){currentMode=orthoMode;
if(a.mapStyle=="r"){p_elSource.style.backgroundColor="#e9e7d4";
p_elSource.style.backgroundImage="none"}else p_elSource.style.backgroundColor="black";
a.Resolve(currentMode,width,height);
f=a.latlong;
preferredView.Copy(a);
currentMode.ValidateZoomLevel(a);
currentBounds=currentMode.GetBounds(a);
ClipView(a,currentBounds);
a.Resolve(currentMode,width,height);
if(a.Equals(currentView)&&!resizeInProgress)return false;
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(a.mapStyle==obliqueStyle)currentMode=obliqueMode;else currentMode=orthoMode;
currentMode.ValidateZoomLevel(a);
UpdateTiles(a);
return true}function UpdateTiles(a){currentView.Destroy();
currentView=a;
tileLayerManager.SetViewPort();
tileLayerManager.LoadBaseLayer("Road",mapTiles,1,0);
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},getElementPosition:function(a){var b=0,c=0;
while(a&&a.offsetParent){b+=a.offsetLeft-a.scrollLeft;
c+=a.offsetTop-a.scrollTop;
a=a.offsetParent}return {x:b,y:c}},getMousePosition:function(a){if(typeof a=="undefined")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},getScrollPosition:function(){var a={x:0,y:0};
if(typeof window.pageYOffset!="undefined"){a.x=window.pageXOffset;
a.y=window.pageYOffset}else if(typeof document.documentElement.scrollTop!="undefined"&&document.documentElement>0){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},getViewportSize:function(){var a={x:0,y:0};
if(typeof window.innerWidth!="undefined"){a.x=window.innerWidth;
a.y=