﻿function e(id){return document.getElementById(id);};function initUI(){var dJ=e("AutoCheckBox");var dy=e("ManualCheckBox");if(dJ){dJ.checked=true;dy.checked=false;var iz=e("ctl00_CH1_KmlTextBox").value;if(iz==""){dy.disabled=true;}}};function closeUI(){GUnload();};function kmlInfo(iL){var kT=e("kmlMoreDiv");var kS=e("kmlInfoDiv");kT.style.display=(iL==0)?"inline":"none";kS.style.display=(iL>0)?"inline":"none";};function uiHi(a){a.style.backgroundColor="aliceblue";};function uiLo(a){a.style.backgroundColor="white";};function eQ(pFloat,pDp){var m=Math.pow(10,pDp);return parseInt(pFloat*m,10)/m;};var bA=null;var cW=null;var oY=2;function initialView(ox){var dJ=e("AutoCheckBox");var dy=e("ManualCheckBox");var bE=parseInt(e("ctl00_CH1_DisplayWidthTextBox").value)-10;var kP=e("ctl00_CH1_ShowSidebarDropDownList");if(kP.selectedIndex=="0"){var lJ=parseInt(e("ctl00_CH1_DisplaySideWidthTextBox").value);bE-=lJ;}var pB=parseInt(e("ctl00_CH1_DisplaySideWidthTextBox").value);var dO=parseInt(e("ctl00_CH1_DisplayHeightTextBox").value);var eT=e("navDiv");eT.style.width=bE+"px";eT.style.height=dO+"px";if(ox==0){dJ.checked=true;dy.checked=false;eT.style.display="none";e("ctl00_CH1_CXbox").value="0";e("ctl00_CH1_CYbox").value="0";e("ctl00_CH1_ZoomBox").value="0";}else{dJ.checked=false;dy.checked=true;var eT=e("navDiv");eT.style.display="block";if(bA==null){initialView2();}}};function initialView2(){var dL=[G_NORMAL_MAP,G_SATELLITE_MAP,G_HYBRID_MAP];var eT=e("navDiv");var nK=parseFloat(e("ctl00_CH1_SWXbox").value);var nJ=parseFloat(e("ctl00_CH1_SWYbox").value);var nH=parseFloat(e("ctl00_CH1_NEXbox").value);var nG=parseFloat(e("ctl00_CH1_NEYbox").value);var mZ=parseFloat(e("ctl00_CH1_CXbox").value);var nx=parseFloat(e("ctl00_CH1_CYbox").value);var hw=parseInt(e("ctl00_CH1_ZoomBox").value);var mI=parseInt(e("ctl00_CH1_DisplayMapTypeDropDownList").selectedIndex);cW=new GLatLng(nx,mZ);bA=new GMap2(eT);bA.addControl(new GMapTypeControl());bA.addControl(new GLargeMapControl());bA.addControl(new GScaleControl());bA.enableDoubleClickZoom();if(hw==0){mZ=(nK+nH)/2;nx=(nJ+nG)/2;var iN=new GLatLng(nJ,nK);var iO=new GLatLng(nG,nH);cW=new GLatLng(nx,mZ);var aA=new GLatLngBounds(iN,iO);var hw=bA.getBoundsZoomLevel(aA);}bA.setCenter(cW,hw);bA.setMapType(dL[mI]);var iz=e("ctl00_CH1_KmlTextBox").value;var kU=new GGeoXml(iz);bA.addOverlay(kU);GEvent.addListener(bA,"moveend",function(){bA.checkResize();cW=bA.getCenter();e("ctl00_CH1_CXbox").value=cW.lng();e("ctl00_CH1_CYbox").value=cW.lat();e("ctl00_CH1_ZoomBox").value=bA.getZoom();});GEvent.addListener(bA,"move",function(){bA.checkResize();cW=bA.getCenter();var kK="<b>Lat Long Zoom :</b> "+eQ(cW.lat(),5)+" "+eQ(cW.lng(),5)+" "+bA.getZoom();e("latLongDiv").innerHTML=kK;});bA.checkResize();var kN=e("navResetDiv");kN.innerHTML="<br />"+"<table style='width:100%'><tr><td style='width:100%' align='center'>"+"<input type='button' onclick='zoomToFitView()' value='Zoom To Fit' />"+"</td></tr></table><br />";};function zoomToFitView(){var oQ=parseFloat(e("ctl00_CH1_SWXbox").value);var oU=parseFloat(e("ctl00_CH1_SWYbox").value);var oX=parseFloat(e("ctl00_CH1_NEXbox").value);var oV=parseFloat(e("ctl00_CH1_NEYbox").value);var aA=new GLatLngBounds();aA.extend(new GLatLng(oV,oX));aA.extend(new GLatLng(oU,oQ));var bW=bA.getBoundsZoomLevel(aA);var dw=(aA.getNorthEast().lat()+aA.getSouthWest().lat())/2;var du=(aA.getNorthEast().lng()+aA.getSouthWest().lng())/2;var bK=new GLatLng(dw,du);bA.setCenter(bK,bW);};function fU(){var gu=new Date();var nP="?dd="+gu.getDate()+gu.getMonth();return nP;}