function ExtInfoWindow(_1,_2,_3,_4){this.html_=_3;this.marker_=_1;this.infoWindowId_=_2;this.options_=_4==null?{}:_4;this.ajaxUrl_=this.options_.ajaxUrl==null?null:this.options_.ajaxUrl;this.callback_=this.options_.ajaxCallback==null?null:this.options_.ajaxCallback;this.borderSize_=this.options_.beakOffset==null?0:this.options_.beakOffset;this.paddingX_=this.options_.paddingX==null?0+this.borderSize_:this.options_.paddingX+this.borderSize_;this.paddingY_=this.options_.paddingY==null?0+this.borderSize_:this.options_.paddingY+this.borderSize_;this.map_=null;this.container_=document.createElement("div");this.container_.style.position="relative";this.container_.style.display="none";this.contentDiv_=document.createElement("div");this.contentDiv_.id=this.infoWindowId_+"_contents";this.contentDiv_.innerHTML=this.html_;this.contentDiv_.style.display="block";this.contentDiv_.style.visibility="hidden";this.wrapperDiv_=document.createElement("div");};ExtInfoWindow.prototype=new GOverlay();ExtInfoWindow.prototype.initialize=function(_5){this.map_=_5;this.defaultStyles={containerWidth:this.map_.getSize().width/2,borderSize:1};this.wrapperParts={tl:{t:0,l:0,w:0,h:0,domElement:null},t:{t:0,l:0,w:0,h:0,domElement:null},tr:{t:0,l:0,w:0,h:0,domElement:null},l:{t:0,l:0,w:0,h:0,domElement:null},r:{t:0,l:0,w:0,h:0,domElement:null},bl:{t:0,l:0,w:0,h:0,domElement:null},b:{t:0,l:0,w:0,h:0,domElement:null},br:{t:0,l:0,w:0,h:0,domElement:null},beak:{t:0,l:0,w:0,h:0,domElement:null},close:{t:0,l:0,w:0,h:0,domElement:null}};for(var i in this.wrapperParts){var _6=document.createElement("div");_6.id=this.infoWindowId_+"_"+i;_6.style.visibility="hidden";document.body.appendChild(_6);_6=document.getElementById(this.infoWindowId_+"_"+i);var _7=eval("this.wrapperParts."+i);_7.w=parseInt(this.getStyle_(_6,"width"));_7.h=parseInt(this.getStyle_(_6,"height"));document.body.removeChild(_6);}for(var i in this.wrapperParts){if(i=="close"){this.wrapperDiv_.appendChild(this.contentDiv_);}var _8=null;if(this.wrapperParts[i].domElement==null){_8=document.createElement("div");this.wrapperDiv_.appendChild(_8);}else{_8=this.wrapperParts[i].domElement;}_8.id=this.infoWindowId_+"_"+i;_8.style.position="absolute";_8.style.width=this.wrapperParts[i].w+"px";_8.style.height=this.wrapperParts[i].h+"px";_8.style.top=this.wrapperParts[i].t+"px";_8.style.left=this.wrapperParts[i].l+"px";this.wrapperParts[i].domElement=_8;}this.map_.getPane(G_MAP_FLOAT_PANE).appendChild(this.container_);this.container_.id=this.infoWindowId_;var _9=this.getStyle_(document.getElementById(this.infoWindowId_),"width");this.container_.style.width=(_9==null?this.defaultStyles.containerWidth:_9);this.map_.getContainer().appendChild(this.contentDiv_);this.contentWidth=this.getDimensions_(this.container_).width;this.contentDiv_.style.width=this.contentWidth+"px";this.contentDiv_.style.position="absolute";this.container_.appendChild(this.wrapperDiv_);GEvent.bindDom(this.container_,"mousedown",this,this.onClick_);GEvent.bindDom(this.container_,"dblclick",this,this.onClick_);GEvent.bindDom(this.container_,"DOMMouseScroll",this,this.onClick_);GEvent.trigger(this.map_,"extinfowindowopen");if(this.ajaxUrl_!=null){this.ajaxRequest_(this.ajaxUrl_);}};ExtInfoWindow.prototype.onClick_=function(e){if(navigator.userAgent.toLowerCase().indexOf("msie")!=-1&&document.all){window.event.cancelBubble=true;window.event.returnValue=false;}else{e.stopPropagation();}};ExtInfoWindow.prototype.remove=function(){if(this.map_.getExtInfoWindow()!=null){GEvent.trigger(this.map_,"extinfowindowbeforeclose");GEvent.clearInstanceListeners(this.container_);if(this.container_.outerHTML){this.container_.outerHTML="";}if(this.container_.parentNode){this.container_.parentNode.removeChild(this.container_);}this.container_=null;GEvent.trigger(this.map_,"extinfowindowclose");this.map_.setExtInfoWindow_(null);}};ExtInfoWindow.prototype.copy=function(){return new ExtInfoWindow(this.marker_,this.infoWindowId_,this.html_,this.options_);};ExtInfoWindow.prototype.redraw=function(_a){if(!_a||this.container_==null){return;}var _b=this.contentDiv_.offsetHeight;this.contentDiv_.style.height=_b+"px";this.contentDiv_.style.left=this.wrapperParts.l.w+"px";this.contentDiv_.style.top=this.wrapperParts.tl.h+"px";this.contentDiv_.style.visibility="visible";this.wrapperParts.tl.t=0;this.wrapperParts.tl.l=0;this.wrapperParts.t.l=this.wrapperParts.tl.w;this.wrapperParts.t.w=(this.wrapperParts.l.w+this.contentWidth+this.wrapperParts.r.w)-this.wrapperParts.tl.w-this.wrapperParts.tr.w;this.wrapperParts.t.h=this.wrapperParts.tl.h;this.wrapperParts.tr.l=this.wrapperParts.t.w+this.wrapperParts.tl.w;this.wrapperParts.l.t=this.wrapperParts.tl.h;this.wrapperParts.l.h=_b;this.wrapperParts.r.l=this.contentWidth+this.wrapperParts.l.w;this.wrapperParts.r.t=this.wrapperParts.tr.h;this.wrapperParts.r.h=_b;this.wrapperParts.bl.t=_b+this.wrapperParts.tl.h;this.wrapperParts.b.l=this.wrapperParts.bl.w;this.wrapperParts.b.t=_b+this.wrapperParts.tl.h;this.wrapperParts.b.w=(this.wrapperParts.l.w+this.contentWidth+this.wrapperParts.r.w)-this.wrapperParts.bl.w-this.wrapperParts.br.w;this.wrapperParts.b.h=this.wrapperParts.bl.h;this.wrapperParts.br.l=this.wrapperParts.b.w+this.wrapperParts.bl.w;this.wrapperParts.br.t=_b+this.wrapperParts.tr.h;this.wrapperParts.close.l=this.wrapperParts.tr.l+this.wrapperParts.tr.w-this.wrapperParts.close.w-this.borderSize_;this.wrapperParts.close.t=this.borderSize_;this.wrapperParts.beak.l=this.borderSize_+(this.contentWidth/2)-(this.wrapperParts.beak.w/2);this.wrapperParts.beak.t=this.wrapperParts.bl.t+this.wrapperParts.bl.h-this.borderSize_;for(var i in this.wrapperParts){if(i=="close"){this.wrapperDiv_.insertBefore(this.contentDiv_,this.wrapperParts[i].domElement);}var _c=null;if(this.wrapperParts[i].domElement==null){_c=document.createElement("div");this.wrapperDiv_.appendChild(_c);}else{_c=this.wrapperParts[i].domElement;}_c.id=this.infoWindowId_+"_"+i;_c.style.position="absolute";_c.style.width=this.wrapperParts[i].w+"px";_c.style.height=this.wrapperParts[i].h+"px";_c.style.top=this.wrapperParts[i].t+"px";_c.style.left=this.wrapperParts[i].l+"px";this.wrapperParts[i].domElement=_c;}var _d=this.marker_;var _e=this.map_;GEvent.addDomListener(this.wrapperParts.close.domElement,"click",function(){_e.closeExtInfoWindow();});var _f=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());this.container_.style.position="absolute";var _10=this.marker_.getIcon();this.container_.style.left=(_f.x-(this.contentWidth/2)-_10.iconAnchor.x+_10.infoWindowAnchor.x)+"px";this.container_.style.top=(_f.y-this.wrapperParts.bl.h-_b-this.wrapperParts.tl.h-this.wrapperParts.beak.h-_10.iconAnchor.y+_10.infoWindowAnchor.y+this.borderSize_)+"px";this.container_.style.display="block";if(this.map_.getExtInfoWindow()!=null){this.repositionMap_();}};ExtInfoWindow.prototype.resize=function(){var _11=this.contentDiv_.cloneNode(true);_11.id=this.infoWindowId_+"_tempContents";_11.style.visibility="hidden";_11.style.height="auto";document.body.appendChild(_11);_11=document.getElementById(this.infoWindowId_+"_tempContents");var _12=_11.offsetHeight;document.body.removeChild(_11);this.contentDiv_.style.height=_12+"px";var _13=this.contentDiv_.offsetWidth;var _14=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());var _15=this.wrapperParts.t.domElement.offsetHeight+this.wrapperParts.l.domElement.offsetHeight+this.wrapperParts.b.domElement.offsetHeight;var _16=this.wrapperParts.t.domElement.offsetTop;this.wrapperParts.l.domElement.style.height=_12+"px";this.wrapperParts.r.domElement.style.height=_12+"px";var _17=this.wrapperParts.b.domElement.offsetTop-_12;this.wrapperParts.l.domElement.style.top=_17+"px";this.wrapperParts.r.domElement.style.top=_17+"px";this.contentDiv_.style.top=_17+"px";windowTHeight=parseInt(this.wrapperParts.t.domElement.style.height);_17-=windowTHeight;this.wrapperParts.close.domElement.style.top=_17+this.borderSize_+"px";this.wrapperParts.tl.domElement.style.top=_17+"px";this.wrapperParts.t.domElement.style.top=_17+"px";this.wrapperParts.tr.domElement.style.top=_17+"px";this.repositionMap_();};ExtInfoWindow.prototype.repositionMap_=function(){var _18=this.map_.fromLatLngToDivPixel(this.map_.getBounds().getNorthEast());var _19=this.map_.fromLatLngToDivPixel(this.map_.getBounds().getSouthWest());var _1a=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());var _1b=0;var _1c=0;var _1d=this.paddingX_;var _1e=this.paddingY_;var _1f=this.marker_.getIcon().infoWindowAnchor;var _20=this.marker_.getIcon().iconAnchor;var _21=this.wrapperParts.t.domElement;var _22=this.wrapperParts.l.domElement;var _23=this.wrapperParts.b.domElement;var _24=this.wrapperParts.r.domElement;var _25=this.wrapperParts.beak.domElement;var _26=_1a.y-(-_1f.y+_20.y+this.getDimensions_(_25).height+this.getDimensions_(_23).height+this.getDimensions_(_22).height+this.getDimensions_(_21).height+this.paddingY_);if(_26<_18.y){_1c=_18.y-_26;}else{var _27=_1a.y+this.paddingY_;if(_27>=_19.y){_1c=-(_27-_19.y);}}var _28=Math.round(_1a.x+this.getDimensions_(this.container_).width/2+this.getDimensions_(_24).width+this.paddingX_+_1f.x-_20.x);if(_28>_18.x){_1b=-(_28-_18.x);}else{var _29=-(Math.round((this.getDimensions_(this.container_).width/2-this.marker_.getIcon().iconSize.width/2)+this.getDimensions_(_22).width+this.borderSize_+this.paddingX_)-_1a.x-_1f.x+_20.x);if(_29<_19.x){_1b=_19.x-_29;}}if(_1b!=0||_1c!=0&&this.map_.getExtInfoWindow()!=null){this.map_.panBy(new GSize(_1b,_1c));}};ExtInfoWindow.prototype.ajaxRequest_=function(url){var _2a=this.map_;var _2b=this.callback_;GDownloadUrl(url,function(_2c,_2d){var _2e=document.getElementById(_2a.getExtInfoWindow().infoWindowId_+"_contents");if(_2c==null||_2d==-1){_2e.innerHTML="<span class=\"error\">ERROR: The Ajax request failed to get HTML content from \""+url+"\"</span>";}else{_2e.innerHTML=_2c;}if(_2b!=null){_2b();}_2a.getExtInfoWindow().resize();GEvent.trigger(_2a,"extinfowindowupdate");});};ExtInfoWindow.prototype.getDimensions_=function(_2f){var _30=this.getStyle_(_2f,"display");if(_30!="none"&&_30!=null){return {width:_2f.offsetWidth,height:_2f.offsetHeight};}var els=_2f.style;var _31=els.visibility;var _32=els.position;var _33=els.display;els.visibility="hidden";els.position="absolute";els.display="block";var _34=_2f.clientWidth;var _35=_2f.clientHeight;els.display=_33;els.position=_32;els.visibility=_31;return {width:_34,height:_35};};ExtInfoWindow.prototype.getStyle_=function(_36,_37){var _38=false;_37=this.camelize_(_37);var _39=_36.style[_37];if(!_39){if(document.defaultView&&document.defaultView.getComputedStyle){var css=document.defaultView.getComputedStyle(_36,null);_39=css?css[_37]:null;}else{if(_36.currentStyle){_39=_36.currentStyle[_37];}}}if((_39=="auto")&&(_37=="width"||_37=="height")&&(this.getStyle_(_36,"display")!="none")){if(_37=="width"){_39=_36.offsetWidth;}else{_39=_36.offsetHeight;}}return (_39=="auto")?null:_39;};ExtInfoWindow.prototype.camelize_=function(_3a){var _3b=_3a.split("-"),len=_3b.length;if(len==1){return _3b[0];}var _3c=_3a.charAt(0)=="-"?_3b[0].charAt(0).toUpperCase()+_3b[0].substring(1):_3b[0];for(var i=1;i<len;i++){_3c+=_3b[i].charAt(0).toUpperCase()+_3b[i].substring(1);}return _3c;};GMap.prototype.ExtInfoWindowInstance_=null;GMap.prototype.ClickListener_=null;GMap.prototype.InfoWindowListener_=null;GMarker.prototype.openExtInfoWindow=function(map,_3d,_3e,_3f){if(map==null){throw "Error in GMarker.openExtInfoWindow: map cannot be null";return false;}if(_3d==null||_3d==""){throw "Error in GMarker.openExtInfoWindow: must specify a cssId";return false;}map.closeInfoWindow();if(map.getExtInfoWindow()!=null){map.closeExtInfoWindow();}if(map.getExtInfoWindow()==null){map.setExtInfoWindow_(new ExtInfoWindow(this,_3d,_3e,_3f));if(map.ClickListener_==null){map.ClickListener_=GEvent.addListener(map,"click",function(_40){if(!_40&&map.getExtInfoWindow()!=null){map.closeExtInfoWindow();}});}if(map.InfoWindowListener_==null){map.InfoWindowListener_=GEvent.addListener(map,"infowindowopen",function(_41){if(map.getExtInfoWindow()!=null){map.closeExtInfoWindow();}});}map.addOverlay(map.getExtInfoWindow());}};GMarker.prototype.closeExtInfoWindow=function(map){if(map.getExtInfWindow()!=null){map.closeExtInfoWindow();}};GMap2.prototype.getExtInfoWindow=function(){return this.ExtInfoWindowInstance_;};GMap2.prototype.setExtInfoWindow_=function(_42){this.ExtInfoWindowInstance_=_42;};GMap2.prototype.closeExtInfoWindow=function(){if(this.getExtInfoWindow()!=null){this.ExtInfoWindowInstance_.remove();}};