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.beakPosition_=this.options_.beakPosition==null?null:this.options_.beakPosition;this.transOffset_=this.options_.transOffset==null?0:this.options_.transOffset;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.topLabel_=this.options_.topLabel==null?"":this.options_.topLabel;this.wrapperDiv_=document.createElement("div")}ExtInfoWindow.prototype=new GOverlay;
ExtInfoWindow.prototype.initialize=function(a){this.map_=a;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 b in this.wrapperParts){a=document.createElement("div");a.id=this.infoWindowId_+"_"+b;a.style.visibility="hidden";document.body.appendChild(a);a=document.getElementById(this.infoWindowId_+"_"+b);var c=eval("this.wrapperParts."+b);c.w=parseInt(this.getStyle_(a,"width"));c.h=parseInt(this.getStyle_(a,"height"));document.body.removeChild(a)}for(b in this.wrapperParts){b=="close"&&this.wrapperDiv_.appendChild(this.contentDiv_);a=null;if(this.wrapperParts[b].domElement==
null){a=document.createElement("div");this.wrapperDiv_.appendChild(a)}else a=this.wrapperParts[b].domElement;a.id=this.infoWindowId_+"_"+b;a.style.position="absolute";a.style.width=this.wrapperParts[b].w+"px";a.style.height=this.wrapperParts[b].h+"px";a.style.top=this.wrapperParts[b].t+"px";a.style.left=this.wrapperParts[b].l+"px";if(b=="t"){c=document.createElement("div");c.id=this.infoWindowId_+"_topLabel";c.innerHTML=this.topLabel_;a.appendChild(c)}this.wrapperParts[b].domElement=a}this.map_.getPane(G_MAP_FLOAT_PANE).appendChild(this.container_);
this.container_.id=this.infoWindowId_;b=this.getStyle_(document.getElementById(this.infoWindowId_),"width");this.container_.style.width=b==null?this.defaultStyles.containerWidth:b;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");this.ajaxUrl_!=null&&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="";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)){a=this.contentDiv_.offsetHeight;this.contentDiv_.style.height=a+"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=a;this.wrapperParts.r.l=this.contentWidth+this.wrapperParts.l.w;this.wrapperParts.r.t=this.wrapperParts.tr.h;this.wrapperParts.r.h=a;this.wrapperParts.bl.t=a+this.wrapperParts.tl.h;this.wrapperParts.b.l=this.wrapperParts.bl.w;this.wrapperParts.b.t=a+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=a+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=5;this.wrapperParts.beak.l=this.beakPosition_==null?this.borderSize_+this.contentWidth/2-this.wrapperParts.beak.w/
2:this.beakPosition_;this.wrapperParts.beak.t=this.wrapperParts.bl.t+this.wrapperParts.bl.h-this.borderSize_;for(var b in this.wrapperParts){b=="close"&&this.wrapperDiv_.insertBefore(this.contentDiv_,this.wrapperParts[b].domElement);var c=null;if(this.wrapperParts[b].domElement==null){c=document.createElement("div");this.wrapperDiv_.appendChild(c)}else c=this.wrapperParts[b].domElement;c.id=this.infoWindowId_+"_"+b;c.style.position="absolute";c.style.width=this.wrapperParts[b].w+"px";c.style.height=
this.wrapperParts[b].h+"px";c.style.top=this.wrapperParts[b].t+"px";c.style.left=this.wrapperParts[b].l+"px";this.wrapperParts[b].domElement=c}var d=this.map_;GEvent.addDomListener(this.wrapperParts.close.domElement,"click",function(){d.closeExtInfoWindow()});b=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());this.container_.style.position="absolute";c=this.marker_.getIcon();this.container_.style.left=b.x-this.contentWidth/2-c.iconAnchor.x+c.infoWindowAnchor.x+"px";this.container_.style.top=
b.y-this.wrapperParts.bl.h-a-this.wrapperParts.tl.h-this.wrapperParts.beak.h-c.iconAnchor.y+c.infoWindowAnchor.y+this.borderSize_+"px";this.container_.style.display="block"}};
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 b=a.offsetHeight,c=this.map_.getSize();if(b>c.height-130)b=c.height-130;document.body.removeChild(a);this.contentDiv_.style.height=b+"px";this.map_.fromLatLngToDivPixel(this.marker_.getPoint());this.wrapperParts.l.domElement.style.height=
b+"px";this.wrapperParts.r.domElement.style.height=b+"px";a=this.wrapperParts.b.domElement.offsetTop-b;this.wrapperParts.l.domElement.style.top=a+"px";this.wrapperParts.r.domElement.style.top=a+"px";this.contentDiv_.style.top=a+"px";windowTHeight=parseInt(this.wrapperParts.t.domElement.style.height);a-=windowTHeight;this.wrapperParts.close.domElement.style.top=a+this.borderSize_-this.transOffset_+"px";this.wrapperParts.tl.domElement.style.top=a+"px";this.wrapperParts.t.domElement.style.top=a+"px";
this.wrapperParts.tr.domElement.style.top=a+"px";map.removeControl(controls.GSmallMapControl);this.repositionMap_()};
ExtInfoWindow.prototype.repositionMap_=function(){var a=this.map_.fromLatLngToDivPixel(this.map_.getBounds().getNorthEast());this.map_.fromLatLngToDivPixel(this.map_.getBounds().getSouthWest());var b=this.map_.fromLatLngToDivPixel(this.marker_.getPoint()),c=this.marker_.getIcon().infoWindowAnchor,d=this.marker_.getIcon().iconAnchor,e=this.wrapperParts.t.domElement,f=this.wrapperParts.l.domElement,g=this.wrapperParts.b.domElement,h=this.wrapperParts.r.domElement;this.getDimensions_(this.wrapperParts.beak.domElement);
this.getDimensions_(g);this.getDimensions_(f);this.getDimensions_(e);if(!(Math.round(b.x+this.getDimensions_(this.container_).width/2+this.getDimensions_(h).width+this.paddingX_+c.x-d.x)>a.x)){this.getDimensions_(this.container_);this.marker_.getIcon();this.getDimensions_(f)}c=0;switch(this.infoWindowId_){case "locationinfo_window":case "grouplist_window":c=0;d=this.map_.fromLatLngToDivPixel(this.map_.getBounds().getCenter());a=this.map_.fromLatLngToDivPixel(this.marker_.getLatLng());e=this.map_.fromLatLngToDivPixel(this.map_.getBounds().getSouthWest());
b=d.x+(a.x-e.x)+-1*c;c=d.y+(a.y-e.y)+c;b=a.x+0;a=new GPoint(b,c+20);a=this.map_.fromDivPixelToLatLng(a);this.map_.panTo(a);break;case "rentalspot_info_window":c=40;d=this.map_.fromLatLngToDivPixel(this.map_.getBounds().getCenter());a=this.map_.fromLatLngToDivPixel(this.marker_.getLatLng());e=this.map_.fromLatLngToDivPixel(this.map_.getBounds().getSouthWest());c=d.y+(a.y-e.y)+c;b=a.x+230;a=new GPoint(b,c);a=this.map_.fromDivPixelToLatLng(a);this.map_.panTo(a);break;default:break}return false};
ExtInfoWindow.prototype.ajaxRequest_=function(a){var b=this.map_,c=this.callback_,d=new Date;d=d.getTime();a=a+"/t/"+d;GDownloadUrl(a,function(e,f){document.getElementById(b.getExtInfoWindow().infoWindowId_+"_contents").innerHTML=e==null||f==-1?'<span class="error">ERROR: The Ajax request failed to get HTML content from "'+a+'"</span>':e;c!=null&&c();b.getExtInfoWindow().resize();GEvent.trigger(b,"extinfowindowupdate")})};
ExtInfoWindow.prototype.getDimensions_=function(a){var b=this.getStyle_(a,"display");if(b!="none"&&b!=null)return{width:a.offsetWidth,height:a.offsetHeight};b=a.style;var c=b.visibility,d=b.position,e=b.display;b.visibility="hidden";b.position="absolute";b.display="block";var f=a.clientWidth;a=a.clientHeight;b.display=e;b.position=d;b.visibility=c;return{width:f,height:a}};
ExtInfoWindow.prototype.getStyle_=function(a,b){b=this.camelize_(b);var c=a.style[b];if(!c)if(document.defaultView&&document.defaultView.getComputedStyle)c=(c=document.defaultView.getComputedStyle(a,null))?c[b]:null;else if(a.currentStyle)c=a.currentStyle[b];if(c=="auto"&&(b=="width"||b=="height")&&this.getStyle_(a,"display")!="none")c=b=="width"?a.offsetWidth:a.offsetHeight;return c=="auto"?null:c};
ExtInfoWindow.prototype.camelize_=function(a){var b=a.split("-"),c=b.length;if(c==1)return b[0];a=a.charAt(0)=="-"?b[0].charAt(0).toUpperCase()+b[0].substring(1):b[0];for(var d=1;d<c;d++)a+=b[d].charAt(0).toUpperCase()+b[d].substring(1);return a};GMap.prototype.ExtInfoWindowInstance_=null;GMap.prototype.ClickListener_=null;GMap.prototype.InfoWindowListener_=null;
GMarker.prototype.openExtInfoWindow=function(a,b,c,d){if(a==null)throw"Error in GMarker.openExtInfoWindow: map cannot be null";if(b==null||b=="")throw"Error in GMarker.openExtInfoWindow: must specify a cssId";a.closeInfoWindow();a.getExtInfoWindow()!=null&&a.closeExtInfoWindow();if(a.getExtInfoWindow()==null){a.setExtInfoWindow_(new ExtInfoWindow(this,b,c,d));if(a.ClickListener_==null)a.ClickListener_=GEvent.addListener(a,"click",function(e){!e&&a.getExtInfoWindow()!=null&&a.closeExtInfoWindow()});
if(a.InfoWindowListener_==null)a.InfoWindowListener_=GEvent.addListener(a,"infowindowopen",function(){a.getExtInfoWindow()!=null&&a.closeExtInfoWindow()});a.addOverlay(a.getExtInfoWindow())}};GMarker.prototype.closeExtInfoWindow=function(a){a.getExtInfWindow()!=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){var a=this.getExtInfoWindow();if(typeof a.options_.reset_marker!="undefined"){var b=a.marker_.getIcon(),c=new GIcon,d="";d=b.image.indexOf("tiny_pin")>=0?"tiny_pin":b.image.indexOf("full_red")>=0?"full_red":"red";switch(a.options_.reset_marker){case "details":switch(d){case "tiny_pin":c.infoWindowAnchor=new GPoint(222,0);break;case "full_red":c.infoWindowAnchor=new GPoint(228,0);break;case "red":c.infoWindowAnchor=new GPoint(228,
0);break}break;case "grouplist":switch(d){case "tiny_pin":c.infoWindowAnchor=new GPoint(4,0);break;case "full_red":c.infoWindowAnchor=new GPoint(10,0);break;case "red":c.infoWindowAnchor=new GPoint(10,0);break}break}c.image=b.image;c.iconSize=b.iconSize;c.iconAnchor=b.iconAnchor;map.removeOverlay(a.marker_);markers[a.options_.marker_id]=createMarker(markers[a.options_.marker_id].point,markers[a.options_.marker_id].title,markers[a.options_.marker_id].html,0,markers[a.options_.marker_id].opts,markers[a.options_.marker_id].maxContentURL,
markers[a.options_.marker_id].minContentURL,c);map.addOverlay(markers[a.options_.marker_id])}this.ExtInfoWindowInstance_.remove();this.addControl(controls.GSmallMapControl)}};function HoverWindow(a,b,c,d){this.marker_=a;this.options_=d==null?{}:d;this.html_=b||false;this.url_=c||false;this.callback_=this.options_.ajaxCallback==null?null:this.options_.ajaxCallback}HoverWindow.prototype=new GOverlay;
HoverWindow.prototype.initialize=function(a){var b=document.createElement("div");b.style.position="absolute";b.style.width="265px";b.style.backgroundColor="#fff";b.style.border="1px solid #f0ddae";a.getPane(G_MAP_FLOAT_PANE).appendChild(b);a.setHoverWindow_(this);this.map_=a;this.div_=b;if(this.html_)b.innerHTML=this.html_;this.url_&&this.fillContent_()};
HoverWindow.prototype.fillContent_=function(){var a=this.callback_,b=this.div_,c=this.url_,d=this.map_;GDownloadUrl(c,function(e,f){b.innerHTML=e==null||f==-1?'<span class="error">ERROR: The Ajax request failed to get HTML content from "'+c+'"</span>':e;a!=null&&a();GEvent.trigger(d,"hoverwindowcontentfilled")})};HoverWindow.prototype.hide=function(){this.grad_.style.display="none"};HoverWindow.prototype.show=function(){this.grad_.style.display="block"};
HoverWindow.prototype.remove=function(){this.div_.parentNode.removeChild(this.div_);this.map_.setHoverWindow_(null)};HoverWindow.prototype.copy=function(){return new HoverWindow(this.html_,this.url_,this.options_)};HoverWindow.prototype.resize=function(){this.bounds_=this.map_.getBounds();this.redraw(true)};
HoverWindow.prototype.redraw=function(a){if(a){a=this.map_.fromLatLngToDivPixel(this.marker_.getLatLng());var b=this.map_.getBounds(),c=this.map_.fromLatLngToDivPixel(b.getSouthWest());b=this.map_.fromLatLngToDivPixel(b.getNorthEast());var d=a.x+15,e=d+275,f=a.y+150;this.div_.style.left=e>b.x?d-(e-b.x)+"px":d+"px";this.div_.style.top=f>=c.y?a.y-120+"px":a.y+20+"px"}};GMap2.prototype.getHoverWindow=function(){return this.hoverWindowInstance_};
GMap2.prototype.setHoverWindow_=function(a){this.hoverWindowInstance_=a};function Gradient(a,b){this.img_=a;this.bounds_=b}Gradient.prototype=new GGroundOverlay;Gradient.prototype.initialize=function(a){var b=document.createElement("img");b.src=this.img_;b.style.position="absolute";a.getPane(G_MAP_OVERLAY_LAYER_PANE).appendChild(b);var c=this;a.setGradient_(c);GEvent.addListener(a,"move",function(){c.resize()});GEvent.bind(a,"resizegradient",c,c.resize);this.map_=a;this.grad_=b};Gradient.prototype.hide=function(){this.grad_.style.display="none"};
Gradient.prototype.show=function(){this.grad_.style.display="block"};Gradient.prototype.remove=function(){this.grad_.parentNode.removeChild(this.grad_);this.map_.setGradient_(null)};Gradient.prototype.copy=function(){return new Gradient(this.img_,this.bounds_)};Gradient.prototype.resize=function(){this.bounds_=this.map_.getBounds();this.redraw(true)};
Gradient.prototype.redraw=function(a){if(a){a=this.map_.fromLatLngToDivPixel(this.bounds_.getSouthWest());var b=this.map_.fromLatLngToDivPixel(this.bounds_.getNorthEast());this.grad_.style.width=Math.abs(b.x-a.x)+"px";this.grad_.style.height=Math.abs(b.y-a.y)+"px";this.grad_.style.left=Math.min(b.x,a.x)+"px";this.grad_.style.top=Math.min(b.y,a.y)+"px"}};GMap2.prototype.getGradient=function(){return this.gradientInstance_};GMap2.prototype.setGradient_=function(a){this.gradientInstance_=a};
