﻿var seui=null;function initPage(){seui=new SEUI();seui.ci=seui.e("seID").innerHTML;seui.aE=seui.e("verDiv").innerHTML;seui.cn();seui.previewClick();};function closePage(){GUnload();};function SEUI(){this.map=null;this.ci="";this.aE="";this.mapHeight=720;this.x= -122.420000;this.y=37.779170;this.z=15;this.mapType=0;this.wheelScroll=0;this.trafficLayer=1;this.streetviewLayer=1;this.streetviewMarker=0;this.orbitRate=0;this.pitch=45;this.range=1000;this.heading=0;this.cW="";this.controlCity=1;this.controlView=1;this.controlOrbit=1;this.controlGeocoder=0;this.cP=1;};SEUI.prototype.e=function(a){return document.getElementById(a);};SEUI.prototype.cA=function(a){GLog.write(a);};SEUI.prototype.aJ=function(pFloat,pDp){var m=Math.pow(10,pDp);return parseInt(pFloat*m,10)/m;};SEUI.prototype.locKeyPress=function(aC){var aG=aC.keyCode;if(aG==13){gotoLocation();return false;}return true;};SEUI.prototype.gotoLocation=function(){var x=parseFloat(this.e("xLoc").value);var y=parseFloat(this.e("yLoc").value);var z=parseFloat(this.e("zLoc").value);this.map.setCenter(new GLatLng(y,x),z);};SEUI.prototype.geoKeyPress=function(aC){var aG=aC.keyCode;if(aG==13){this.geocodeFind();return false;}return true;};SEUI.prototype.geocodeFind=function(){var ay=this.e("geocodeName").value;var aK=new GClientGeocoder(new GGeocodeCache());aK.getLatLng(ay,function(ap){var ab=[];ab[G_GEO_SUCCESS]="Success";ab[G_GEO_MISSING_ADDRESS]="Missing Address: The address was either missing or had no value.";ab[G_GEO_UNKNOWN_ADDRESS]="Unknown Address:  No corresponding geographic location could be found for the specified address.";ab[G_GEO_UNAVAILABLE_ADDRESS]="Unavailable Address:  The geocode for the given address cannot be returned due to legal or contractual reasons.";ab[G_GEO_BAD_KEY]="Bad Key: The API key is either invalid or does not match the domain for which it was given";ab[G_GEO_TOO_MANY_QUERIES]="Too Many Queries: The daily geocoding quota for this site has been exceeded.";ab[G_GEO_SERVER_ERROR]="Server error: The geocoding request could not be successfully processed.";if(ap){seui.map.setCenter(ap);seui.bf(true);}else{var aj=aK.getCache().get(ay);var at="";if(aj){var at="Error "+aj.Status.code+" : ";if(ab[aj.Status.code]){at+=ab[aj.Status.code];}alert(at);}}});};SEUI.prototype.cn=function(){var ba=this.e("mapDiv");var ct=new GLatLng(this.y,this.x);var map=new GMap2(ba);this.map=map;map.addControl(new GSmallMapControl());map.addControl(new GMapTypeControl());map.enableDoubleClickZoom();map.enableContinuousZoom();map.setCenter(ct,this.z);map.setMapType(G_NORMAL_MAP);GEvent.addListener(map,"moveend",function(){seui.bf(true);});this.bf(false);};SEUI.prototype.bf=function(){var an=this.map.getCenter();var x=an.lng();var y=an.lat();var z=this.map.getZoom();seui.e("xMap").value=this.aJ(x,7);seui.e("yMap").value=this.aJ(y,7);seui.e("zMap").value=z;};SEUI.prototype.xyzView=function(){var x=parseFloat(this.e("xMap").value);var y=parseFloat(this.e("yMap").value);var z=parseInt(this.e("zMap").value);if(isNaN(x)){alert("invalid x value : "+this.e("xMap").value);}else if(isNaN(y)){alert("invalid y value : "+this.e("yMap").value);}else if(isNaN(z)){alert("invalid z value : "+this.e("zMap").value);}else{this.map.setCenter(new GLatLng(y,x),z);}};SEUI.prototype.previewClick=function(){this.x=parseFloat(this.e("xMap").value);this.y=parseFloat(this.e("yMap").value);this.z=parseInt(this.e("zMap").value);this.mapType=this.e("gmType").selectedIndex;this.mapWidth=parseInt(this.e("pxWidth").value)+"px";if(this.e("fullWidth").checked){this.mapWidth="100%";}this.mapHeight=parseInt(this.e("pxHeight").value);this.pitch=parseInt(this.e("pitchText").value);this.heading=parseInt(this.e("headingText").value);this.range=parseInt(this.e("rangeText").value);this.orbitRate=parseInt(this.e("orbitRateText").value);this.wheelScroll=this.e("wheelscrollSelect").selectedIndex==0?0:1;this.streetviewLayer=this.e("streetviewSelect").selectedIndex;this.trafficLayer=this.e("trafficSelect").selectedIndex;this.streetviewMarker=this.e("streetviewMarkerSelect").selectedIndex;this.controlOrbit=this.e("controlOrbitSelect").selectedIndex;this.controlView=this.e("controlViewSelect").selectedIndex;this.controlGeocoder=this.e("controlGeocoderSelect").selectedIndex;this.controlCity=this.e("controlCitySelect").selectedIndex;if(isNaN(this.x)){alert("invalid x value : "+this.e("xMap").value);return;}if(isNaN(this.y)){alert("invalid y value : "+this.e("yMap").value);return;}if(isNaN(this.z)){alert("invalid zoom value : "+this.e("zMap").value);return;}if(isNaN(this.mapHeight)){alert("invalid height value : "+this.e("pxHeight").value);return;}var ac=this.aE+"?mx="+this.x+"&my="+this.y+"&mz="+this.z+"&mt="+this.mapType;if(this.streetviewLayer!=1){ac+="&sv="+this.streetviewLayer;}if(this.trafficLayer!=0){ac+="&tr="+this.trafficLayer;}if(this.streetviewMarker>0){ac+="&sm="+this.streetviewMarker;}if(this.wheelScroll==0){ac+="&ws="+this.wheelScroll;}if(this.orbitRate!=0){ac+="&vo="+this.orbitRate;}if(this.heading!=0){ac+="&vh="+this.heading;}if(this.pitch!=45){ac+="&vp="+this.pitch;}if(this.range!=1000){ac+="&vr="+this.range;}if(this.controlGeocoder==0){ac+="&cg="+this.controlGeocoder;}if(this.controlCity==0){ac+="&cc="+this.controlCity;}if(this.controlView==0){ac+="&cv="+this.controlView;}if(this.controlOrbit==0){ac+="&co="+this.controlOrbit;}var bW="<iframe style=\"width:"+this.mapWidth+";height:"+this.mapHeight+"px;padding:0;border:solid 1px black\" "+"src=\""+ac+"\" "+"marginwidth=\"0\" marginheight=\"0\" frameborder=\"0\" scrolling=\"no\"></iframe>";var cs="<a target=\"_blank\" href=\""+ac+"\" >View in Google Street View and Google Earth</a>";this.e("scriptText").value=bW;this.e("linkText").value=cs;this.e("previewDiv").innerHTML=bW;};SEUI.prototype.click100=function(a){this.e("pxWidth").disabled=a.checked;}