var geoLoaded;if(typeof geoLoaded==="undefined"||geoLoaded!==true){geoLoaded=true;function include(a){document.write("<script");document.write(' language="javascript"');document.write(' type="text/javascript"');document.write(' src="'+a+'">');document.write("<\/script>");}function pause(b){var a=new Date();var c=a.getTime()+b;while(true){a=new Date();if(a.getTime()>c){return;}}}function latLongChange(){this.lat_value=document.getElementById("latitude").value;this.long_value=document.getElementById("longitude").value;if(this.checkRange(this.long_value,180)&&this.checkRange(this.lat_value,90)){this.setMapCenter(this.lat_value,this.long_value);}}function geolocateOnEnter(b){var a,c=(window.event?window.event:b);if(window.event){a=window.event.keyCode;}else{a=b.which;}if(a===13){this.showAddress(document.getElementById("geoLocateAddress").value,this);if(c.preventDefault){c.preventDefault();}if(c.stopPropagation){c.stopPropagation();}else{c.cancelBubble=true;}c.returnValue=false;}}function checkRange(b,a){if(!isNaN(parseFloat(b))&&((b<=0+a)&&(b>=0-a))){return true;}else{return false;}}function setMapCenter(d,b){if(this.addrpnt){this.map.removeOverlay(addrpnt);}this.point=new GLatLng(d,b);try{this.map.setCenter(this.point,5);}catch(c){alert("Contact support@bepress.com-ERR:"+c.description);}this.addrpnt=new GMarker(this.point,{icon:this.icon,draggable:true,title:this.address});this.addrpnt.enableDragging();this.map.addOverlay(this.addrpnt);var a=this;GEvent.addListener(a.addrpnt,"dragend",function(){a.map.setCenter(a.addrpnt.getPoint());a.populate();document.getElementById("results").innerHTML="<p class='geo-results'>Location moved to "+a.addrpnt.getPoint().toUrlValue()+"</p>";document.getElementById("geoLocateAddress").value=a.addrpnt.getPoint().toUrlValue();});}function addKml(b){var a="http://"+window.location.hostname+b;this.map.addOverlay(new GGeoXml(a));}function infoWindowStatus(a){if(a==1){this.map.enableInfoWindow();}else{this.map.disableInfoWindow();}}function setAddress(){if(!this.point){document.getElementById("results").innerHTML="<p class='error'>"+this.address+" Not found.</p>";}else{if(this.addrpnt){this.map.removeOverlay(this.addrpnt);}}this.addrpnt=new GMarker(this.point,{icon:this.icon,draggable:true,title:this.address});this.addrpnt.enableDragging();this.map.addOverlay(this.addrpnt);this.map.setCenter(this.point,this.ZOOM_LEVEL);document.getElementById("results").innerHTML="<p class='geo-results'>"+this.address+" is located at "+this.addrpnt.getPoint().toUrlValue()+"</p>";document.getElementById("latitude").value=this.point.lat();document.getElementById("longitude").value=this.point.lng();}function showAddress(b,a){this.address=b;this.ZOOM_LEVEL=13;this.geocoder.getLatLng(this.address,function(c){a.point=c;a.setAddress();GEvent.addListener(a.addrpnt,"dragend",function(){a.map.setCenter(a.addrpnt.getPoint());a.populate();document.getElementById("results").innerHTML="<p class='geo-results'>Location moved to "+a.addrpnt.getPoint().toUrlValue()+"</p>";document.getElementById("geoLocateAddress").value=a.addrpnt.getPoint().toUrlValue();});});}function populate(){document.getElementById("longitude").value=this.addrpnt.getPoint().lng().toFixed(6);document.getElementById("latitude").value=this.addrpnt.getPoint().lat().toFixed(6);}function initialize(){this.map=new GMap2(document.getElementById(this.DIV_ID));this.start=new GLatLng(0,0);this.map.setCenter(this.start,this.ZOOM_LEVEL);this.map.setZoom(this.ZOOM_LEVEL);this.map.addMapType(G_PHYSICAL_MAP);this.map.addControl(new GSmallZoomControl());this.geocoder=new GClientGeocoder();}function googleMap(a,b){this.addrpnt;this.geocoder;this.address;this.icon;this.map;this.geoXml=false;this.show_kml=true;this.addrpnt;this.lat_value;this.long_value;this.point;this.ZOOM_LEVEL=a;this.DIV_ID=b;this.start;this.latLongChange=latLongChange;this.setMapCenter=setMapCenter;this.addKml=addKml;this.checkRange=checkRange;this.showAddress=showAddress;this.populate=populate;this.setAddress=setAddress;this.initialize=initialize;this.geolocateOnEnter=geolocateOnEnter;this.infoWindowStatus=infoWindowStatus;}}
