function ImageZoomControl(){}ImageZoomControl.prototype=new GControl();ImageZoomControl.prototype.initialize=function(d){var b=document.createElement("div");var c=document.createElement("div");this.setButtonStyle_(c);c.id="zoomBtnIn";b.appendChild(c);GEvent.addDomListener(c,"click",function(){d.closeExtInfoWindow();d.zoomIn()});var a=document.createElement("div");this.setButtonStyle_(a);a.id="zoomBtnOut";b.appendChild(a);GEvent.addDomListener(a,"click",function(){d.closeExtInfoWindow();d.zoomOut()});d.getContainer().appendChild(b);return b};ImageZoomControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(12,12))};ImageZoomControl.prototype.setButtonStyle_=function(a){a.style.cssFloat="left";a.style.styleFloat="left";a.style.height="22px";a.style.width="28px";a.style.cursor="pointer"};function ImageMapTypeControl(){}ImageMapTypeControl.prototype=new GControl();ImageMapTypeControl.prototype.initialize=function(d){var a=document.createElement("div");var b=document.createElement("div");this.setButtonStyle_(b);b.id="typeBtnMap";b.style.width="59px";a.appendChild(b);GEvent.addDomListener(b,"click",function(){d.setMapType(G_NORMAL_MAP)});var c=document.createElement("div");this.setButtonStyle_(c);c.id="typeBtnHybrid";c.style.width="66px";a.appendChild(c);GEvent.addDomListener(c,"click",function(){d.setMapType(G_HYBRID_MAP)});d.getContainer().appendChild(a);return a};ImageMapTypeControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(11,11))};ImageMapTypeControl.prototype.setButtonStyle_=function(a){a.style.cssFloat="left";a.style.styleFloat="left";a.style.height="25px";a.style.cursor="pointer"};function ImageLegendControl(){}ImageLegendControl.prototype=new GControl();ImageLegendControl.prototype.initialize=function(e){var a=document.createElement("div");if(YAHOO.env.ua.ie!=6){var d=document.createElement("div");this.setButtonStyle_(d);d.id="helpButton";d.style.width="59px";a.appendChild(d);var c=document.createElement("div");this.setButtonStyle_(c);c.id="legendButton";c.style.width="66px";a.appendChild(c);e.getContainer().appendChild(a);var b='<div class="legend legGreen">Active Listings</div>';b+='<div class="legend legBlue">New Listings</div>';b+='<div class="legend legOrange">Open House</div>';b+='<div class="legend legRed space">Under Contract Listings</div>';b+='<div class="legend legDetached">Detached Home</div>';b+='<div class="legend legAttached">Townhouse</div>';b+='<div class="legend legCondo">Garden / Midrise / Highrise</div>';b+='<div class="legend legLand">Land</div>';$("#helpButton").qtip({content:{url:"/server/realestate/map-help",method:"get"},show:{when:{event:"click"},effect:{type:"fade",length:500}},hide:{when:{event:"unfocus"},effect:{type:"fade",length:500}},style:{border:{width:3,radius:4,color:"#355b8a"},width:618,background:"#ffffff"},position:{corner:{target:"topRight",tooltip:"bottomRight"},adjust:{x:63,y:-12}}});$("#legendButton").qtip({content:b,show:{when:{event:"click"},effect:{type:"fade",length:500}},hide:{when:{event:"unfocus"},effect:{type:"fade",length:500}},style:{border:{width:3,radius:4,color:"#355b8a"},width:210,background:"#ffffff"},position:{corner:{target:"topRight",tooltip:"bottomRight"},adjust:{x:-3,y:-12}}});$("div.qtip").bind("mousedown",function(f){$("#legendButton").qtip("hide");$("#helpButton").qtip("hide")})}return a};ImageLegendControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_BOTTOM_RIGHT,new GSize(11,19))};ImageLegendControl.prototype.setButtonStyle_=function(a){a.style.cssFloat="left";a.style.styleFloat="left";a.style.height="25px";a.style.cursor="pointer"};ImageLegendControl.prototype.setMenuStyle_=function(a){a.style.textDecoration="none";a.style.color="#000000";a.style.background="transparent url(/resources/images/maps/legend-menu.png) no-repeat 0 0";a.style.font="12px Helvetica";a.style.padding="18px 10px";a.style.textAlign="left";a.style.cssFloat="right";a.style.styleFloat="right";a.style.position="relative";a.style.clear="both";a.style.height="180px";a.style.width="170px";a.style.marginBottom="10px";a.style.opacity="0.90";a.style.filter="alpha(opacity=90)"};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="contentsItem";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.className=i+"Item";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(YAHOO.lang.hasOwnProperty(this.wrapperParts,i)){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.className=i+"Item";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="containerItem";this.container_.className=this.infoWindowId_;var containerWidth=this.getStyle_(document.getElementById("containerItem"),"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.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_-8;this.wrapperParts.close.t=this.borderSize_-8;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(YAHOO.lang.hasOwnProperty(this.wrapperParts,d)){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.className=d+"Item";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-40+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;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.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()}};