JSMapAPI={};JSMapAPI.CreateObject=function(B){function A(){}A.prototype=B;return new A()};JSMapAPI.JSPointLocation=function(){this.Name=null;this.Desc=null;this.Latitude=null;this.Longitude=null};JSMapAPI.JSPointLocation.prototype.Dispose=function(){this.Name=null;this.Desc=null;this.Latitude=null;this.Longitude=null};JSMapAPI.CreateJSPointLocation=function(){return JSMapAPI.CreateObject(new JSMapAPI.JSPointLocation())};JSMapAPI.JSPointLocation.prototype.GetLatLong=function(){if(JSMapAPI.Utils.IsValidLatLong(this.Latitude,this.Longitude)){return new VELatLong(this.Latitude,this.Longitude)}else{throw new Error("Error in JSMapAPI.JSPointLocation.GetLatLong():Latitude/Longitude are invalid.")}};JSMapAPI.JSMapView=function(){this.ZoomLevel=null;this.CenterLatitude=null;this.CenterLongitude=null};JSMapAPI.CreateJSMapView=function(){return JSMapAPI.CreateObject(new JSMapAPI.JSMapView())};JSMapAPI.JSMapView.prototype.Dispose=function(){this.ZoomLevel=null;this.CenterLatitude=null;this.CenterLongitude=null};JSMapAPI.JSMapView.prototype.GetZoomLevel=function(){if(this.ZoomLevel){if(!isNaN(this.ZoomLevel)){if(this.ZoomLevel<20&&this.ZoomLevel>0){return this.ZoomLevel}}}return 4};JSMapAPI.JSMapView.prototype.IsValidCenter=function(){if(JSMapAPI.Utils.IsValidLatLong(this.CenterLatitude,this.CenterLongitude)){return true}else{return false}};JSMapAPI.JSMapView.prototype.GetCenter=function(){if(this.IsValidCenter()){return new VELatLong(this.CenterLatitude,this.CenterLongitude)}else{throw new Error("Error in JSMapAPI.JSMapView.GetCenter():Center Latitude/Center Longitude are invalid.")}};JSMapAPI.JSMapSpec=function(){this.MapId=null;this.MapToken=null;this.InitialMapView=null;this.ShowAdvancedMapUI=false};JSMapAPI.CreateJSMapSpec=function(){return JSMapAPI.CreateObject(new JSMapAPI.JSMapSpec())};JSMapAPI.JSMapSpec.prototype.Dispose=function(){this.MapId=null;this.MapToken=null;this.InitialMapView=null;this.ShowAdvancedMapUI=false};JSMapAPI.JSMap=function(){this.Impl=null;this.Spec=null;this.MouseMapPixel=null;this.MouseMapLatLong=null};JSMapAPI.CreateJSMap=function(){return JSMapAPI.CreateObject(new JSMapAPI.JSMap())};JSMapAPI.JSMap.prototype.DisposeImpl=function(){this.Impl.Dispose();this.Spec.Dispose();this.MouseMapPixel=null;this.MouseMapLatLong=null};JSMapAPI.JSMap.prototype._initialize_impl=function(){try{var A=this;this.Impl=new VEMap(this.Spec.MapId);this.Impl.SetDashboardSize(VEDashboardSize.Normal);this.Impl.AttachEvent("onkeydown",this.MapOnKeyDownHandler);this.Impl.AttachEvent("onmousemove",function(D){A.MouseMapPixel=new VEPixel(D.mapX,D.mapY);A.MouseMapLatLong=A.Impl.PixelToLatLong(A.MouseMapPixel)});this._set_token();var B=new VEMapOptions();B.EnableBirdseye=this.Spec.ShowAdvancedMapUI;this.Impl.LoadMap(null,4,VEMapStyle.Road,false,VEMapMode.Mode2D,false,0,B);JSMapAPI.DhtmlUtils.SetHidden("MSVE_obliqueNotification")}catch(C){throw new Error("JSMapAPI.JSMap._initialize_impl() Error:"+C.message)}};JSMapAPI.JSMap.prototype._initialize_printable_impl=function(){try{this.Impl=new VEMap(this.Spec.MapId);this.Impl.SetPrintOptions(new VEPrintOptions(true));this._set_token();this.Impl.LoadMap(null,4,VEMapStyle.Road,true,VEMapMode.Mode2D,false,0,null)}catch(A){throw new Error("JSMapAPI.JSMap._initialize_printable_impl() Error:"+A.message)}};JSMapAPI.JSMap.prototype._adjust_map_view=function(){if(this.Spec.InitialMapView){if(this.Spec.InitialMapView instanceof JSMapAPI.JSMapView){if(this.Spec.InitialMapView.IsValidCenter()){this.Impl.SetCenterAndZoom(this.Spec.InitialMapView.GetCenter(),this.Spec.InitialMapView.GetZoomLevel())}else{this.Impl.SetZoomLevel(this.Spec.InitialMapView.GetZoomLevel())}}}};JSMapAPI.JSMap.prototype._set_token=function(){if(this.Spec.MapToken){this.Impl.SetClientToken(this.Spec.MapToken)}else{throw new Error("JSMapAPI.JSMap._init_token() Error: No Map Token.")}};JSMapAPI.JSMap.prototype.SetMapCursor=function(A){JSMapAPI.DhtmlUtils.SetCursor(this.Spec.MapId,A)};JSMapAPI.JSMap.prototype.SetPrintMode=function(A){this.Impl.SetPrintOptions(new VEPrintOptions(A))};JSMapAPI.JSMap.prototype.GetCurrentMapView=function(){var A=JSMapAPI.CreateJSMapView();A.ZoomLevel=this.Impl.GetZoomLevel();A.CenterLatitude=this.Impl.GetCenter().Latitude;A.CenterLongitude=this.Impl.GetCenter().Longitude;return A};JSMapAPI.JSMap.prototype.MapOnKeyDownHandler=function(A){if(A.keyCode==51){return true}};JSMapAPI.Utils={IsValidLatLong:function(A,B){if(A&&B){if(!isNaN(A)&&!isNaN(B)){return true}}return false}};JSMapAPI.DhtmlUtils={SetCursor:function(B,C){var A=document.getElementById(B);if(A&&A.style){A.style.cursor=C}},SetVisible:function(B){var A=document.getElementById(B);if(A&&A.style&&A.style.visibility!="visible"){A.style.visibility="visible"}},SetHidden:function(B){var A=document.getElementById(B);if(A&&A.style&&A.style.visibility!="hidden"){A.style.visibility="hidden"}},HideElement:function(B){var A=document.getElementById(B);if(A&&A.style&&A.style.visibility!="hidden"){A.style.visibility="hidden"}if(A&&A.style&&A.style.display!="none"){A.style.display="none"}},ShowBlockElement:function(B){var A=document.getElementById(B);if(A&&A.style&&A.style.visibility!="visible"){A.style.visibility="visible"}if(A&&A.style&&A.style.display!="block"){A.style.display="block"}},ShowInlineElement:function(B){var A=document.getElementById(B);if(A&&A.style&&A.style.visibility!="visible"){A.style.visibility="visible"}if(A&&A.style&&A.style.display!="Inline"){A.style.display="Inline"}}};JSMapAPI.Environment={BROWSER_OPERA:navigator.userAgent.toLowerCase().indexOf("opera")!=-1,BROWSER_SAFARI:navigator.userAgent.toLowerCase().indexOf("safari")!=-1,BROWSER_KONQUEROR:navigator.userAgent.toLowerCase().indexOf("konqueror")!=-1,BROWSER_FIREFOX:navigator.userAgent.toLowerCase().indexOf("firefox")!=-1,DECEPTIVE_USER_AGENT:this.BROWSER_OPERA||this.BROWSER_SAFARI||this.BROWSER_KONQUEROR,BROWSER_MOZILLA:!this.DECEPTIVE_USER_AGENT&&navigator.userAgent.toLowerCase().indexOf("gecko")!=-1,BROWSER_INTERNET_EXPLORER:!this.DECEPTIVE_USER_AGENT&&navigator.userAgent.toLowerCase().indexOf("msie")!=-1,BROWSER_MAJOR_VERSION:function(){var C="";var E=navigator.userAgent.toLowerCase();if(this.BROWSER_INTERNET_EXPLORER){C="msie "}else{if(this.BROWSER_FIREFOX){C="firefox/"}else{if(this.BROWSER_OPERA){C="opera/"}else{if(this.BROWSER_SAFARI){C="version/"}else{if(this.BROWSER_MOZILLA){C="rv:"}else{if(this.BROWSER_KONQUEROR){C="konqueror/"}}}}}}var B=E.indexOf(C);var A=E.indexOf(".",B);var G=E.length;if(A==-1){A=E.length}else{for(var D=A+1;D<E.length;D++){var F=E.charAt(D);if(isNaN(F)){G=D;break}}}return parseInt(E.substring(B+C.length,A))},BROWSER_MINOR_VERSION:function(){var C="";var E=navigator.userAgent.toLowerCase();if(this.BROWSER_INTERNET_EXPLORER){C="msie "}else{if(this.BROWSER_FIREFOX){C="firefox/"}else{if(this.BROWSER_OPERA){C="opera/"}else{if(this.BROWSER_SAFARI){C="version/"}else{if(this.BROWSER_MOZILLA){C="rv:"}else{if(this.BROWSER_KONQUEROR){C="konqueror/"}}}}}}var B=E.indexOf(C);var A=E.indexOf(".",B);var G=E.length;if(A==-1){A=E.length}else{for(var D=A+1;D<E.length;D++){var F=E.charAt(D);if(isNaN(F)){G=D;break}}}if(A==E.length){return 0}else{return parseInt(E.substring(A+1,G))}},IsBrowserUICompatible:function(){if(this.BROWSER_INTERNET_EXPLORER&&this.BROWSER_MAJOR_VERSION()>=6){return true}if(this.BROWSER_FIREFOX&&this.BROWSER_MAJOR_VERSION()>=2){return true}if(this.BROWSER_SAFARI&&this.BROWSER_MAJOR_VERSION()>=2){return true}return false}};