"use strict";if(typeof window.PB==="undefined"||!PB){window.PB={};}PB.Geocode=function(c,a,b){this.lat=$(c);this.lng=$(a);this.btn=$(b);this.onChange=new YAHOO.util.CustomEvent("change");
if(this.btn){Event.addListener(this.btn,"click",this.open,this,true);}};PB.Geocode.prototype.setValue=function(b,a){if(isNaN(b)||isNaN(a)||b===null||a===null){this.lat.value="";
this.lng.value="";}else{this.lat.value=b.toString();this.lng.value=a.toString();}};PB.Geocode.prototype.destroy=function(){if(this.btn){Event.removeListener(this.btn,"click",this.open);
}this.onChange.unsubscribeAll();delete this.onChange;delete this.btn;delete this.lng;delete this.lat;};PB.Geocode.prototype.open=function(){var d=parseFloat(this.lat.value);
var b=parseFloat(this.lng.value);var a={};if(!(isNaN(d)||isNaN(b))){a.lat=d;a.lng=b;a.marker=true;}var c=window.open("/Window-Geocode.asp","geocode","menubar=no,location=no,resizable=yes,scrollbars=no,status=no,width=650,height=550");
c.CONFIG=Lang.merge(a,{scope:this,onMarker:this.setValue,onClear:this.setValue,onAccept:function(f,e){this.setValue(f,e);this.onChange.fire(f,e);}});};PB.Geocode.prototype.search=function(a){var b=window.open("/Window-Geocode.asp","geocode","menubar=no,location=no,resizable=yes,scrollbars=no,status=no,width=650,height=550");
b.CONFIG={scope:this,marker:false,search:a,onMarker:this.setValue,onClear:this.setValue,onAccept:function(d,c){this.setValue(d,c);this.onChange.fire(d,c);window.setTimeout(function(){b.close();
},10);}};};PB.Geocode.prototype.staticURL=function(a,i,h,c){var b,k,j,d,f=parseFloat(this.lat.value),g=parseFloat(this.lng.value),e={zoom:12,marker:"blue"};if(c){e=Lang.merge(e,c);
}if(isNaN(f)||isNaN(g)||!h||h.length===0){return null;}b=encodeURIComponent(f)+","+encodeURIComponent(g);k=encodeURIComponent(a)+"x"+encodeURIComponent(i);j=encodeURIComponent(e.zoom);
d=b+","+encodeURIComponent(e.marker);if(e.letter){d+=encodeURIComponent(e.letter);}return"http://maps.google.com/staticmap?center="+b+"&zoom="+j+"&size="+k+"&markers="+d+"&key="+encodeURIComponent(h);
};YAHOO.register("Geocode",PB.Geocode,{version:"0.4",build:"10"});if(window.log){window.log("Loaded geocoding utility");}