function ExtInfoWindow(A,B,C,D){this.html_=C;
this.marker_=A;
this.infoWindowId_=B;
this.options_=D==null?{}:D;
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(map){this.map_=map;
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 tempElement=document.createElement("div");
tempElement.id=this.infoWindowId_+"_"+i;
tempElement.style.visibility="hidden";
document.body.appendChild(tempElement);
tempElement=document.getElementById(this.infoWindowId_+"_"+i);
var tempWrapperPart=eval("this.wrapperParts."+i);
tempWrapperPart.w=parseInt(this.getStyle_(tempElement,"width"));
tempWrapperPart.h=parseInt(this.getStyle_(tempElement,"height"));
document.body.removeChild(tempElement)
}for(var i in this.wrapperParts){if(i=="close"){this.wrapperDiv_.appendChild(this.contentDiv_)
}var wrapperPartsDiv=null;
if(this.wrapperParts[i].domElement==null){wrapperPartsDiv=document.createElement("div");
this.wrapperDiv_.appendChild(wrapperPartsDiv)
}else{wrapperPartsDiv=this.wrapperParts[i].domElement
}wrapperPartsDiv.id=this.infoWindowId_+"_"+i;
wrapperPartsDiv.style.position="absolute";
wrapperPartsDiv.style.width=this.wrapperParts[i].w+"px";
wrapperPartsDiv.style.height=this.wrapperParts[i].h+"px";
wrapperPartsDiv.style.top=this.wrapperParts[i].t+"px";
wrapperPartsDiv.style.left=this.wrapperParts[i].l+"px";
this.wrapperParts[i].domElement=wrapperPartsDiv
}this.map_.getPane(G_MAP_FLOAT_PANE).appendChild(this.container_);
this.container_.id=this.infoWindowId_;
var containerWidth=this.getStyle_(document.getElementById(this.infoWindowId_),"width");
this.container_.style.width=(containerWidth==null?this.defaultStyles.containerWidth:containerWidth);
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.map_.getExtInfoWindow().contentDiv_.innerHTML="<div>Loading ...</div>";
this.ajaxRequest_(this.ajaxUrl_)
}};
ExtInfoWindow.prototype.onClick_=function(A){if(navigator.userAgent.toLowerCase().indexOf("msie")!=-1&&document.all){window.event.cancelBubble=true;
window.event.returnValue=false
}else{A.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(F){if(!F||this.container_==null){return 
}var E=this.contentDiv_.offsetHeight;
this.contentDiv_.style.height=E+"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=E;
this.wrapperParts.r.l=this.contentWidth+this.wrapperParts.l.w;
this.wrapperParts.r.t=this.wrapperParts.tr.h;
this.wrapperParts.r.h=E;
this.wrapperParts.bl.t=E+this.wrapperParts.tl.h;
this.wrapperParts.b.l=this.wrapperParts.bl.w;
this.wrapperParts.b.t=E+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=E+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 D in this.wrapperParts){if(D=="close"){this.wrapperDiv_.insertBefore(this.contentDiv_,this.wrapperParts[D].domElement)
}var C=null;
if(this.wrapperParts[D].domElement==null){C=document.createElement("div");
this.wrapperDiv_.appendChild(C)
}else{C=this.wrapperParts[D].domElement
}C.id=this.infoWindowId_+"_"+D;
C.style.position="absolute";
C.style.width=this.wrapperParts[D].w+"px";
C.style.height=this.wrapperParts[D].h+"px";
C.style.top=this.wrapperParts[D].t+"px";
C.style.left=this.wrapperParts[D].l+"px";
this.wrapperParts[D].domElement=C
}var H=this.marker_;
var G=this.map_;
GEvent.addDomListener(this.wrapperParts.close.domElement,"click",function(){G.closeExtInfoWindow()
});
var B=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());
this.container_.style.position="absolute";
var A=this.marker_.getIcon();
this.container_.style.left=(B.x-(this.contentWidth/2)-A.iconAnchor.x+A.infoWindowAnchor.x)+"px";
this.container_.style.top=(B.y-this.wrapperParts.bl.h-E-this.wrapperParts.tl.h-this.wrapperParts.beak.h-A.iconAnchor.y+A.infoWindowAnchor.y+this.borderSize_)+"px";
this.container_.style.display="block";
if(this.map_.getExtInfoWindow()!=null){this.repositionMap_()
}};
ExtInfoWindow.prototype.resize=function(){var A=this.contentDiv_.cloneNode(true);
A.id=this.infoWindowId_+"_tempContents";
A.style.visibility="hidden";
A.style.height="auto";
document.body.appendChild(A);
A=document.getElementById(this.infoWindowId_+"_tempContents");
var E=A.offsetHeight;
E=E*1.08;
document.body.removeChild(A);
this.contentDiv_.style.height=E+"px";
var B=this.contentDiv_.offsetWidth;
var D=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());
var C=this.wrapperParts.t.domElement.offsetHeight+this.wrapperParts.l.domElement.offsetHeight+this.wrapperParts.b.domElement.offsetHeight;
var G=this.wrapperParts.t.domElement.offsetTop;
this.wrapperParts.l.domElement.style.height=E+"px";
this.wrapperParts.r.domElement.style.height=E+"px";
var F=this.wrapperParts.b.domElement.offsetTop-E;
this.wrapperParts.l.domElement.style.top=F+"px";
this.wrapperParts.r.domElement.style.top=F+"px";
this.contentDiv_.style.top=F+"px";
windowTHeight=parseInt(this.wrapperParts.t.domElement.style.height);
F-=windowTHeight;
this.wrapperParts.close.domElement.style.top=F+this.borderSize_+"px";
this.wrapperParts.tl.domElement.style.top=F+"px";
this.wrapperParts.t.domElement.style.top=F+"px";
this.wrapperParts.tr.domElement.style.top=F+"px";
this.repositionMap_()
};
ExtInfoWindow.prototype.repositionMap_=function(){var J=this.map_.fromLatLngToDivPixel(this.map_.getBounds().getNorthEast());
var A=this.map_.fromLatLngToDivPixel(this.map_.getBounds().getSouthWest());
var H=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());
var P=0;
var N=0;
var L=this.paddingX_;
var K=this.paddingY_;
var D=this.marker_.getIcon().infoWindowAnchor;
var C=this.marker_.getIcon().iconAnchor;
var F=this.wrapperParts.t.domElement;
var I=this.wrapperParts.l.domElement;
var Q=this.wrapperParts.b.domElement;
var G=this.wrapperParts.r.domElement;
var B=this.wrapperParts.beak.domElement;
var M=H.y-(-D.y+C.y+this.getDimensions_(B).height+this.getDimensions_(Q).height+this.getDimensions_(I).height+this.getDimensions_(F).height+this.paddingY_);
if(M<J.y){N=J.y-M
}else{var R=H.y+this.paddingY_;
if(R>=A.y){N=-(R-A.y)
}}var O=Math.round(H.x+this.getDimensions_(this.container_).width/2+this.getDimensions_(G).width+this.paddingX_+D.x-C.x);
if(O>J.x){P=-(O-J.x)
}else{var E=-(Math.round((this.getDimensions_(this.container_).width/2-this.marker_.getIcon().iconSize.width/2)+this.getDimensions_(I).width+this.borderSize_+this.paddingX_)-H.x-D.x+C.x);
if(E<A.x){P=A.x-E
}}if(P!=0||N!=0&&this.map_.getExtInfoWindow()!=null){this.map_.panBy(new GSize(P,N))
}};
ExtInfoWindow.prototype.ajaxRequest_=function(A){var C=this.map_;
var B=this.callback_;
GDownloadUrl(A,function(E,D){var F=document.getElementById(C.getExtInfoWindow().infoWindowId_+"_contents");
if(E==null||D==-1){F.innerHTML='<span class="error">ERROR: The Ajax request failed to get HTML content from "'+A+'"</span>'
}else{F.innerHTML=E
}if(B!=null){B()
}C.getExtInfoWindow().resize();
GEvent.trigger(C,"extinfowindowupdate")
})
};
ExtInfoWindow.prototype.getDimensions_=function(C){var G=this.getStyle_(C,"display");
if(G!="none"&&G!=null){return{width:C.offsetWidth,height:C.offsetHeight}
}var B=C.style;
var F=B.visibility;
var D=B.position;
var A=B.display;
B.visibility="hidden";
B.position="absolute";
B.display="block";
var H=C.clientWidth;
var E=C.clientHeight;
B.display=A;
B.position=D;
B.visibility=F;
return{width:H,height:E}
};
ExtInfoWindow.prototype.getStyle_=function(B,C){var E=false;
C=this.camelize_(C);
var D=B.style[C];
if(!D){if(document.defaultView&&document.defaultView.getComputedStyle){var A=document.defaultView.getComputedStyle(B,null);
D=A?A[C]:null
}else{if(B.currentStyle){D=B.currentStyle[C]
}}}if((D=="auto")&&(C=="width"||C=="height")&&(this.getStyle_(B,"display")!="none")){if(C=="width"){D=B.offsetWidth
}else{D=B.offsetHeight
}}return(D=="auto")?null:D
};
ExtInfoWindow.prototype.camelize_=function(C){var E=C.split("-"),A=E.length;
if(A==1){return E[0]
}var D=C.charAt(0)=="-"?E[0].charAt(0).toUpperCase()+E[0].substring(1):E[0];
for(var B=1;
B<A;
B++){D+=E[B].charAt(0).toUpperCase()+E[B].substring(1)
}return D
};
GMap.prototype.ExtInfoWindowInstance_=null;
GMap.prototype.ClickListener_=null;
GMap.prototype.InfoWindowListener_=null;
GMarker.prototype.openExtInfoWindow=function(B,D,A,C){if(B==null){throw"Error in GMarker.openExtInfoWindow: map cannot be null";
return false
}if(D==null||D==""){throw"Error in GMarker.openExtInfoWindow: must specify a cssId";
return false
}B.closeInfoWindow();
if(B.getExtInfoWindow()!=null){B.closeExtInfoWindow()
}if(B.getExtInfoWindow()==null){B.setExtInfoWindow_(new ExtInfoWindow(this,D,A,C));
if(B.ClickListener_==null){B.ClickListener_=GEvent.addListener(B,"click",function(E){if(!E&&B.getExtInfoWindow()!=null){B.closeExtInfoWindow()
}})
}if(B.InfoWindowListener_==null){B.InfoWindowListener_=GEvent.addListener(B,"infowindowopen",function(E){if(B.getExtInfoWindow()!=null){B.closeExtInfoWindow()
}})
}B.addOverlay(B.getExtInfoWindow())
}};
GMarker.prototype.closeExtInfoWindow=function(A){if(A.getExtInfoWindow()!=null){A.closeExtInfoWindow()
}};
GMap2.prototype.getExtInfoWindow=function(){return this.ExtInfoWindowInstance_
};
GMap2.prototype.setExtInfoWindow_=function(A){this.ExtInfoWindowInstance_=A
};
GMap2.prototype.closeExtInfoWindow=function(){if(this.getExtInfoWindow()!=null){this.ExtInfoWindowInstance_.remove()
}};