var cU=null;var fN=null;var fK=48;var fS="./img/construction1"+fK+"x"+fK+".png";var fO=false;function J(fQ,fP,fR){var fM=new T();fM.gc=fR;cU.addControl(fM);fM.gb(fQ);fM.gd(fP);};function aN(fT,fL){if(fL>=12){m("Zoom",fL.toString());}fO=true;gz=fL;var gf=(cU.getBounds().getSouthWest().distanceFrom(cU.getBounds().getNorthEast()))/1000;if(!bx(gf)&&fL>=12){A(false,false);}if(fc&&cQ){cQ.aN(fL);}if(cQ){var bounds=cU.getBounds();var northEast=bounds.getNorthEast();var fV=cQ.dY.getPoint().distanceFrom(cU.getCenter());var fU=northEast.distanceFrom(cU.getCenter());if(fV<=fU){cU.setCenter(cQ.dY.getPoint());}}if(!dc||dc.length==0){return;}var fX="";var sPrevKey="";for(fX in dc){dc[fX].aN(fL);}};function bU(){cU.closeInfoWindow();};function bg(){V();};function cb(){};function bl(point){var fW=new GIcon();var fW=new GIcon();fW.image="./img/construction_screen48x48.png";fW.shadow="./img/shadow_screen.png";fW.iconSize=new GSize(fK,fK);fW.shadowSize=new GSize(87,fK);fW.iconAnchor=new GPoint(fK/2,fK);fW.infoWindowAnchor=new GPoint(9,2);cQ=new bc();if(!cQ.Init(point)){return false;}cR.AddMarker(cQ.eJ(),cQ.eo);return true;};function bC(marker,point){if(!marker){if(!fa|| !cQ){return;}cQ.eJ().setPoint(point);V();}};function cd(point){var dR=document.getElementById("address").value;if(!point){g(dR+" - Not found.\nPlease check address spelling and try again.","Address not found",ICO_WARNING);}else{cU.setCenter(point,13);}};function L(dp){if(gD&&gE){gD.hide();gE.hide();}var dR=document.getElementById("address").value;if(dm){delete dm;}dm=dp;cU.setCenter(dm.dI);if(cU.getZoom()<14){cU.setZoom(14);}cU.openInfoWindowHtml(dm.dI,dR,null);dm.dT();};function be(response){hB=false;var dR=document.getElementById("address").value;var point=null;if(!response||response.Status.code!=200){bd(dR);return;}else{place=response.Placemark[0];var dj="";var fZ=null;if(place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea){fZ=place.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality;}else{fZ=place.AddressDetails.Country.AdministrativeArea.Locality;}if(fZ){dj=fZ.LocalityName;var sStreetOrIntersection="";if(fZ.Thoroughfare!=null&&fZ.Thoroughfare!=undefined){if(fZ.Thoroughfare.ThoroughfareName){sStreetOrIntersection=fZ.Thoroughfare.ThoroughfareName;}}}point=new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);var dp=new O();dp.dL=place.AddressDetails.Country.CountryNameCode;dp.dK=place.AddressDetails.Country.AdministrativeArea.AdministrativeAreaName;dp.dM=dj;dp.dJ=sStreetOrIntersection;dp.dI=point;L(dp);}};var hB=false;function d(sAddress){if(fY){fY.hide();}dz=true;if(sAddress==undefined||sAddress==""){sAddress=document.getElementById("address").value;if(sAddress==undefined||sAddress==""){g("Please enter an address, or intersection to look for.","No address",ICO_ERROR);return;}}else document.getElementById("address").value=sAddress;dx=true;if(fN){var addr=sAddress.toLowerCase();hB=true;fN.getLocations(addr,be);}};function T(){this.ga=null;this.gd=function(fP){if(this.ga){this.ga.title=fP;}};this.gb=function(ij){if(this.ga){this.ga.innerText=ij;this.ga.innerHTML=ij;}};this.initialize=function(map){var container=document.getElementById("divMapTypeBtnHolder");var oDiv=document.createElement("div");this.ga=oDiv;oDiv.className="button";container.appendChild(oDiv);GEvent.addDomListener(oDiv,"click",this.gc);X(oDiv);map.getContainer().appendChild(container);return container;};this.gc=function(){}};function aM(){if(!cU){return;}cU.setMapType(G_NORMAL_MAP);};function az(){if(!cU){return;}cU.setMapType(G_SATELLITE_MAP);};function aL(){if(!cU){return;}cU.setMapType(G_HYBRID_MAP);};function at(){if(!ge){return;}if(gg){gg=false;ge.hide();}else{gg=true;ge.show();}};T.prototype=new GControl();T.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(30,0));};am.prototype=new GControl();function am(){this.ga=document.createElement("div");this.gb=function(ij){this.ga.innerHTML=ij;};this.gc=function(){if(!fa){fc=true;aw();}else{var hy=(fc==true);an(hy);}};this.initialize=function(map){var container=document.getElementById("divMapTypeBtnHolder");var oDiv=document.createElement("div");this.ga=oDiv;oDiv.className="buttonDown";container.appendChild(oDiv);oDiv.innerHTML="Jot New Alert&nbsp;&nbsp;&nbsp;";GEvent.addDomListener(oDiv,"click",this.gc);map.getContainer().appendChild(container);return container;}};am.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(60,0));};function aZ(){var bounds=cU.getBounds();var southWest=bounds.getSouthWest();var northEast=bounds.getNorthEast();var lngSpan=northEast.lng()-southWest.lng();var latSpan=northEast.lat()-southWest.lat();var dg=cU.getCenter();var point=new GLatLng(dg.lat()+(latSpan/4)*ce(-1,1),dg.lng()+(lngSpan/4)*ce(-1,1));return point;};function ay(){if(!cQ){return;}if(!fc){var gq=cQ.dY.getPoint().lat();var gn=cQ.eh.dI.lat();var gp=cQ.dY.getPoint().lng();var gm=cQ.eh.dI.lng();if(gq==gn&&gp==gm){return;}cQ.eh.dJ=document.getElementById("edtLocation").value;}if(dm){if(cQ.dY.getPoint().distanceFrom(dm.dI)<=200){cQ.eh=dm;if(document.getElementById("edtLocation").value!=""){cQ.eh.dJ=document.getElementById("edtLocation").value;}return;}}cQ.eh=new O();cQ.eh.dJ=document.getElementById("edtLocation").value;cQ.eh.dI=new GLatLng(cQ.dY.getPoint().lat(),cQ.dY.getPoint().lng());};function aS(hT){if(!cU){return;}var gk=bL(hT);if(!gk){return;}gk.fr();};function bx(gf){if(!db){return false;}var gh=(db.distanceFrom(cU.getCenter()))/1000;if(gh==0&&da==gf){return true;}var gl=(gh<(da-gf));return gl;};function bJ(){if(cU.getZoom()>=12){m("CurMapCenter",cU.getCenter().toUrlValue());}if(fO){fO=false;return;}if(hB){return;}if(cU.getZoom()<12){return;}var gs=cU.getBounds().getSouthWest();var gr=cU.getBounds().getNorthEast();var ltlgSouthEast=new GLatLng(gs.lat(),gr.lng());var gu=new GLatLng(gr.lat(),gs.lng());var gw=false;if(db){gw=(gs.distanceFrom(db)/1000)>da||(ltlgSouthEast.distanceFrom(db)/1000)>da||(gu.distanceFrom(db)/1000)>da||(gr.distanceFrom(db)/1000)>da;}else{gw=fb;if(fb)fb=false;}if(gw){A(false,false||dz);if(dx){return;}}if(fc&&cQ){cQ.fI();}if(!dc||dc.length==0){return;}var fX;for(fX in dc){dc[fX].fI();}}
