var BOUNDS_BOX_VERSION="1.1b";function BoundsBox(c,a,b){this.bounds_=a;this.setMap(c);this.opts=b||{};if(this.opts.fit){c.fitBounds(a)}this.map=c}BoundsBox.prototype=new google.maps.OverlayView();BoundsBox.prototype.draw=function(){var c=this;var g=this.div_;var e=this.image_;if(!g){g=this.div_=document.createElement("div");g.style.position="absolute";g.style.overflow="hidden";this.zIndex=this.opts.zIndex||0;g.style.zIndex=this.zIndex;g.className=this.opts.cssClass||this.opts.className||"bounds-box";g.innerHTML=this.opts.html||"";google.maps.event.addDomListener(g,"click",function(h){google.maps.event.trigger(c,"click",h)});var b=this.getPanes();var a=this.opts.pane||"overlayLayer";b[a].appendChild(g);if(this.opts.imageSrc){e=this.image_=new Image();e.src=this.opts.imageSrc;e.alt="";e.onload=function(){google.maps.event.trigger(c,"imageloaded")};e.onerror=function(){google.maps.event.trigger(c,"imageloaderror")};g.appendChild(e)}this.opacity=this.opts.opacity*1||1;this.div_.style.filter="alpha(opacity:"+this.opacity*100+")";this.div_.style.opacity=this.opacity}var f=this.getProjection().fromLatLngToDivPixel(this.bounds_.getSouthWest());var d=this.getProjection().fromLatLngToDivPixel(this.bounds_.getNorthEast());this.divSize=new google.maps.Size((d.x-f.x),(f.y-d.y));g.style.left=f.x+"px";g.style.top=d.y+"px";g.style.width=this.divSize.width+"px";g.style.height=this.divSize.height+"px";g.style.zIndex=this.zIndex;if(!!e){e.width=this.divSize.width;e.height=this.divSize.height}this.image_=e};BoundsBox.prototype.remove=function(){if(!this.div_){return false}this.div_.parentNode.removeChild(this.div_);this.div_=null;return true};BoundsBox.prototype.setClassName=function(a){if(!this.div_){return false}this.div_.className=a;return true};BoundsBox.prototype.setContent=function(a){if(!this.div_){return false}this.div_.innerHTML=a;return true};BoundsBox.prototype.setImageSrc=function(a){if(!this.image_){return false}this.image_.src=a;return true};BoundsBox.prototype.setOpacity=function(a){if(!this.div_){return false}this.div_.style.filter="alpha(opacity:"+a*100+")";this.div_.style.opacity=a*1;this.opacity=a*1;return true};BoundsBox.prototype.setZIndex=function(a){if(!this.div_){return false}this.div_.style.zIndex=a;this.zIndex=a;return true};BoundsBox.prototype.getPosition=function(){if(!this.div_){return null}return this.bounds_.getCenter()};BoundsBox.prototype.get_position=function(){if(!this.div_){return null}return this.bounds_.getCenter()};BoundsBox.prototype.getContent=function(){if(!this.div_){return null}return this.div_.innerHTML};BoundsBox.prototype.getDiv=function(){if(!this.div_){return null}return this.div_};BoundsBox.prototype.getSize=function(){if(!this.div_){return null}return this.divSize};BoundsBox.prototype.getImage=function(){if(!this.image_){return null}return this.image_};BoundsBox.prototype.getClassName=function(){if(!this.div_){return null}return this.div_.className};BoundsBox.prototype.getZIndex=function(){if(!this.div_){return null}return this.zIndex};BoundsBox.prototype.getBounds=function(){return this.bounds_};google.maps.LatLng.prototype.destinationLatLng=function(i,e){var d=6371;var f=Math.PI/180;var c=this.lat()*f;var h=this.lng()*f;i=i*f;var b=Math.asin(Math.sin(c)*Math.cos(e/d)+Math.cos(c)*Math.sin(e/d)*Math.cos(i));var g=h+Math.atan2(Math.sin(i)*Math.sin(e/d)*Math.cos(c),Math.cos(e/d)-Math.sin(c)*Math.sin(b));g=(g+Math.PI)%(2*Math.PI)-Math.PI;var a=new google.maps.LatLng(b/f,g/f);return a};function KmBox(a,g,i){this.opts=i||{};var d=this.opts.kmX||this.opts.miX*1.609344||1;var c=this.opts.kmY||this.opts.miY*1.609344||d;var h=g.destinationLatLng(270,d/2).lng();var f=g.destinationLatLng(90,d/2).lng();var b=g.destinationLatLng(0,c/2).lat();var e=g.destinationLatLng(180,c/2).lat();this.bounds_=new google.maps.LatLngBounds();this.bounds_.extend(new google.maps.LatLng(e,h));this.bounds_.extend(new google.maps.LatLng(b,f));this.setMap(a);if(this.opts.fit){a.fitBounds(this.bounds_)}this.map=a}KmBox.prototype=BoundsBox.prototype;

