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.beakOffset_=this.options_.beakOffset==null?0:this.options_.beakOffset;this.borderSize_=this.options_.borderSize==null?this.beakOffset_:this.options_.borderSize;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";if(this.options_.width!=null){this.container_.style.width=this.options_.width+"px"}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.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.beakOffset_;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;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.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.ExtInfoWindowInstance_!=null){this.removeOverlay(this.ExtInfoWindowInstance_);if(this.ExtInfoWindowInstance_!=null){this.ExtInfoWindowInstance_.remove()}this.ExtInfoWindowInstance_=null}};function MarkerManager(d,e){var b=this;b.map_=d;b.mapZoom_=d.getZoom();b.projection_=d.getCurrentMapType().getProjection();e=e||{};b.tileSize_=MarkerManager.DEFAULT_TILE_SIZE_;var a=MarkerManager.DEFAULT_MAX_ZOOM_;if(e.maxZoom!=undefined){a=e.maxZoom}b.maxZoom_=a;b.trackMarkers_=e.trackMarkers;var c;if(typeof e.borderPadding=="number"){c=e.borderPadding}else{c=MarkerManager.DEFAULT_BORDER_PADDING_}b.swPadding_=new GSize(-c,c);b.nePadding_=new GSize(c,-c);b.borderPadding_=c;b.gridWidth_=[];b.grid_=[];b.grid_[a]=[];b.numMarkers_=[];b.numMarkers_[a]=0;GEvent.bind(d,"moveend",b,b.onMapMoveEnd_);b.removeOverlay_=function(f){d.removeOverlay(f);b.shownMarkers_--};b.addOverlay_=function(f){d.addOverlay(f);b.shownMarkers_++};b.resetManager_();b.shownMarkers_=0;b.shownBounds_=b.getMapGridBounds_()}MarkerManager.DEFAULT_TILE_SIZE_=1024;MarkerManager.DEFAULT_MAX_ZOOM_=17;MarkerManager.DEFAULT_BORDER_PADDING_=100;MarkerManager.MERCATOR_ZOOM_LEVEL_ZERO_RANGE=256;MarkerManager.prototype.resetManager_=function(){var c=this;var a=MarkerManager.MERCATOR_ZOOM_LEVEL_ZERO_RANGE;for(var b=0;b<=c.maxZoom_;++b){c.grid_[b]=[];c.numMarkers_[b]=0;c.gridWidth_[b]=Math.ceil(a/c.tileSize_);a<<=1}};MarkerManager.prototype.clearMarkers=function(){var a=this;a.processAll_(a.shownBounds_,a.removeOverlay_);a.resetManager_()};MarkerManager.prototype.getTilePoint_=function(d,b,c){var a=this.projection_.fromLatLngToPixel(d,b);return new GPoint(Math.floor((a.x+c.width)/this.tileSize_),Math.floor((a.y+c.height)/this.tileSize_))};MarkerManager.prototype.addMarkerBatch_=function(c,g,b){var f=c.getPoint();if(this.trackMarkers_){GEvent.bind(c,"changed",this,this.onMarkerMoved_)}var d=this.getTilePoint_(f,b,GSize.ZERO);for(var e=b;e>=g;e--){var a=this.getGridCellCreate_(d.x,d.y,e);a.push(c);d.x=d.x>>1;d.y=d.y>>1}};MarkerManager.prototype.isGridPointVisible_=function(b){var f=this;var d=f.shownBounds_.minY<=b.y&&b.y<=f.shownBounds_.maxY;var a=f.shownBounds_.minX;var c=a<=b.x&&b.x<=f.shownBounds_.maxX;if(!c&&a<0){var e=f.gridWidth_[f.shownBounds_.z];c=a+e<=b.x&&b.x<=e-1}return d&&c};MarkerManager.prototype.onMarkerMoved_=function(e,a,c){var g=this;var i=g.maxZoom_;var d=false;var b=g.getTilePoint_(a,i,GSize.ZERO);var f=g.getTilePoint_(c,i,GSize.ZERO);while(i>=0&&(b.x!=f.x||b.y!=f.y)){var h=g.getGridCellNoCreate_(b.x,b.y,i);if(h){if(g.removeFromArray(h,e)){g.getGridCellCreate_(f.x,f.y,i).push(e)}}if(i==g.mapZoom_){if(g.isGridPointVisible_(b)){if(!g.isGridPointVisible_(f)){g.removeOverlay_(e);d=true}}else{if(g.isGridPointVisible_(f)){g.addOverlay_(e);d=true}}}b.x=b.x>>1;b.y=b.y>>1;f.x=f.x>>1;f.y=f.y>>1;--i}if(d){g.notifyListeners_()}};MarkerManager.prototype.removeMarker=function(c){var f=this;var e=f.maxZoom_;var g=false;var b=c.getPoint();var d=f.getTilePoint_(b,e,GSize.ZERO);while(e>=0){var a=f.getGridCellNoCreate_(d.x,d.y,e);if(a){f.removeFromArray(a,c)}if(e==f.mapZoom_){if(f.isGridPointVisible_(d)){f.removeOverlay_(c);g=true}}d.x=d.x>>1;d.y=d.y>>1;--e}if(g){f.notifyListeners_()}};MarkerManager.prototype.addMarkers=function(d,e,c){var a=this.getOptMaxZoom_(c);for(var b=d.length-1;b>=0;b--){this.addMarkerBatch_(d[b],e,a)}this.numMarkers_[e]+=d.length};MarkerManager.prototype.getOptMaxZoom_=function(a){return a!=undefined?a:this.maxZoom_};MarkerManager.prototype.getMarkerCount=function(b){var a=0;for(var c=0;c<=b;c++){a+=this.numMarkers_[c]}return a};MarkerManager.prototype.addMarker=function(b,f,d){var e=this;var a=this.getOptMaxZoom_(d);e.addMarkerBatch_(b,f,a);var c=e.getTilePoint_(b.getPoint(),e.mapZoom_,GSize.ZERO);if(e.isGridPointVisible_(c)&&f<=e.shownBounds_.z&&e.shownBounds_.z<=a){e.addOverlay_(b);e.notifyListeners_()}this.numMarkers_[f]++};GBounds.prototype.containsPoint=function(a){var b=this;return(b.minX<=a.x&&b.maxX>=a.x&&b.minY<=a.y&&b.maxY>=a.y)};MarkerManager.prototype.getGridCellCreate_=function(a,f,e){var c=this.grid_[e];if(a<0){a+=this.gridWidth_[e]}var b=c[a];if(!b){b=c[a]=[];return b[f]=[]}var d=b[f];if(!d){return b[f]=[]}return d};MarkerManager.prototype.getGridCellNoCreate_=function(a,e,d){var c=this.grid_[d];if(a<0){a+=this.gridWidth_[d]}var b=c[a];return b?b[e]:undefined};MarkerManager.prototype.getGridBounds_=function(a,i,h,f){i=Math.min(i,this.maxZoom_);var b=a.getSouthWest();var e=a.getNorthEast();var g=this.getTilePoint_(b,i,h);var d=this.getTilePoint_(e,i,f);var j=this.gridWidth_[i];if(e.lng()<b.lng()||d.x<g.x){g.x-=j}if(d.x-g.x+1>=j){g.x=0;d.x=j-1}var c=new GBounds([g,d]);c.z=i;return c};MarkerManager.prototype.getMapGridBounds_=function(){var a=this;return a.getGridBounds_(a.map_.getBounds(),a.mapZoom_,a.swPadding_,a.nePadding_)};MarkerManager.prototype.onMapMoveEnd_=function(){var a=this;a.objectSetTimeout_(this,this.updateMarkers_,0)};MarkerManager.prototype.objectSetTimeout_=function(b,c,a){return window.setTimeout(function(){c.call(b)},a)};MarkerManager.prototype.refresh=function(){var a=this;if(a.shownMarkers_>0){a.processAll_(a.shownBounds_,a.removeOverlay_)}a.processAll_(a.shownBounds_,a.addOverlay_);a.notifyListeners_()};MarkerManager.prototype.updateMarkers_=function(){var a=this;a.mapZoom_=this.map_.getZoom();var b=a.getMapGridBounds_();if(b.equals(a.shownBounds_)&&b.z==a.shownBounds_.z){return}if(b.z!=a.shownBounds_.z){a.processAll_(a.shownBounds_,a.removeOverlay_);a.processAll_(b,a.addOverlay_)}else{a.rectangleDiff_(a.shownBounds_,b,a.removeCellMarkers_);a.rectangleDiff_(b,a.shownBounds_,a.addCellMarkers_)}a.shownBounds_=b;a.notifyListeners_()};MarkerManager.prototype.notifyListeners_=function(){GEvent.trigger(this,"changed",this.shownBounds_,this.shownMarkers_)};MarkerManager.prototype.processAll_=function(b,d){for(var a=b.minX;a<=b.maxX;a++){for(var c=b.minY;c<=b.maxY;c++){this.processCellMarkers_(a,c,b.z,d)}}};MarkerManager.prototype.processCellMarkers_=function(b,f,d,e){var a=this.getGridCellNoCreate_(b,f,d);if(a){for(var c=a.length-1;c>=0;c--){e(a[c])}}};MarkerManager.prototype.removeCellMarkers_=function(a,c,b){this.processCellMarkers_(a,c,b,this.removeOverlay_)};MarkerManager.prototype.addCellMarkers_=function(a,c,b){this.processCellMarkers_(a,c,b,this.addOverlay_)};MarkerManager.prototype.rectangleDiff_=function(b,a,d){var c=this;c.rectangleDiffCoords(b,a,function(e,f){d.apply(c,[e,f,b.z])})};MarkerManager.prototype.rectangleDiffCoords=function(b,a,l){var f=b.minX;var m=b.minY;var h=b.maxX;var d=b.maxY;var e=a.minX;var k=a.minY;var g=a.maxX;var c=a.maxY;for(var j=f;j<=h;j++){for(var i=m;i<=d&&i<k;i++){l(j,i)}for(var i=Math.max(c+1,m);i<=d;i++){l(j,i)}}for(var i=Math.max(m,k);i<=Math.min(d,c);i++){for(var j=Math.min(h+1,e)-1;j>=f;j--){l(j,i)}for(var j=Math.max(f,g+1);j<=h;j++){l(j,i)}}};MarkerManager.prototype.removeFromArray=function(e,c,d){var a=0;for(var b=0;b<e.length;++b){if(e[b]===c||(d&&e[b]==c)){e.splice(b--,1);a++}}return a};var R_MAPTYPE_CONTROL_BUTTON_WIDTH=85;var R_MAPTYPE_CONTROL_BUTTON_HEIGHT=31;var R_MAPTYPE_CONTROL_BUTTON_SPACE=0;var R_MAPTYPE_CONTROL_ACTIVE_COLOR="white";var R_MAPTYPE_CONTROL_DEACTIVE_COLOR="black";var R_MAPTYPE_CONTROL_ACTIVE_BGIMAGE=R_GMAP_STYLE_ROOT+"/img_btn_maptype_act.png";var R_MAPTYPE_CONTROL_DEACTIVE_BGIMAGE=R_GMAP_STYLE_ROOT+"/img_btn_maptype.png";function ReallyMapTypeControl(){}ReallyMapTypeControl.prototype=new GControl();ReallyMapTypeControl.prototype.buttonElements=[];ReallyMapTypeControl.prototype.initialize=function(c){this.map=c;var a=c.getMapTypes();this.container=document.createElement("div");this.container.style.height=R_MAPTYPE_CONTROL_BUTTON_HEIGHT+"px";for(var b=0;b<a.length;b++){this.addMapType_(a[b])}GEvent.addListener(c,"maptypechanged",GEvent.callback(this,function(){var e=c.getCurrentMapType();for(var d=0;d<this.buttonElements.length;d++){if(this.buttonElements[d].type==e){this.buttonElements[d].button.className="mapTypeButton mapTypeButton"+this.buttonElements[d].button.innerHTML+" mapTypeButtonOpen"}else{this.buttonElements[d].button.className="mapTypeButton mapTypeButton"+this.buttonElements[d].button.innerHTML}}}));GEvent.addListener(c,"addmaptype",GEvent.callback(this,this.addMapType_));GEvent.addListener(c,"removemaptype",GEvent.callback(this,this.removeMapType_));c.getContainer().appendChild(this.container);return(this.container)};ReallyMapTypeControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(8,0))};ReallyMapTypeControl.prototype.addMapType_=function(b){for(var a=0;a<this.buttonElements.length;a++){if(this.buttonElements[a].type==b){return}}var c=this.createButtonElement(b.getName());c.style.left=(this.buttonElements.length*(R_MAPTYPE_CONTROL_BUTTON_WIDTH+R_MAPTYPE_CONTROL_BUTTON_SPACE))+"px";this.buttonElements.push({type:b,button:c});this.container.style.width=(this.buttonElements.length*(R_MAPTYPE_CONTROL_BUTTON_WIDTH+R_MAPTYPE_CONTROL_BUTTON_SPACE))+"px";this.container.appendChild(c);GEvent.addDomListener(c,"click",GEvent.callbackArgs(this,function(e,d){e.setMapType(d)},this.map,b))};ReallyMapTypeControl.prototype.removeMapType_=function(b){for(var a=0;a<this.buttonElements.length;a++){if(this.buttonElements[a].type==b){GEvent.clearListeners(this.buttonElements[a].button,"click");this.container.removeChild(this.buttonElements[a].button);this.buttonElements.splice(a,1);this.container.style.width=(this.buttonElements.length*(R_MAPTYPE_CONTROL_BUTTON_WIDTH+R_MAPTYPE_CONTROL_BUTTON_SPACE))+"px";for(;a<this.buttonElements.length;a++){this.buttonElements[a].button.style.left=(a*(R_MAPTYPE_CONTROL_BUTTON_WIDTH+R_MAPTYPE_CONTROL_BUTTON_SPACE))+"px"}break}}};ReallyMapTypeControl.prototype.createButtonElement=function(c,b){var a=document.createElement("div");a.appendChild(document.createTextNode(c));a.style.width=R_MAPTYPE_CONTROL_BUTTON_WIDTH+"px";a.style.height=R_MAPTYPE_CONTROL_BUTTON_HEIGHT+"px";a.style.cursor="pointer";a.style.position="absolute";return(a)};ReallyMapTypeControl.setBgImage_=function(b,c){var a=navigator.appVersion;if(a.match("MSIE 6.0")||a.match("MSIE 5.")){b.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+c+"', sizingMethod='crop')"}else{b.style.background="url("+c+") no-repeat left top"}};var R_ZOOM_CONTROL_BUTTON_WIDTH=26;var R_ZOOM_CONTROL_BUTTON_HEIGHT=26;var R_ZOOM_CONTROL_BUTTON_SPACE=4;var R_ZOOM_CONTROL_SLIDER_SPACE=8;var R_ZOOM_CONTROL_SLIDER_WIDTH=26;var R_ZOOM_CONTROL_SLIDER_HEIGHT=120;var R_ZOOM_CONTROL_HANDLE_WIDTH=26;var R_ZOOM_CONTROL_HANDLE_HEIGHT=10;function ReallyZoomControl(){this.styleBaseUrl="/themes/_default/widgets/location/pics";this.styleNaviBackgroundClass="mapNaviBackground";this.styleNaviButtonWidth=26;this.styleNaviButtonHeight=26;this.styleNaviButtonSpace=4;this.styleZoomButtonWidth=26;this.styleZoomButtonHeight=26;this.styleZoomButtonSpace=4}ReallyZoomControl.prototype=new GControl();ReallyZoomControl.prototype.initialize=function(a){if(a&&a.styleOptions){var g=a.styleOptions;if(g.baseUrl){this.styleBaseUrl=g.baseUrl}if(g.naviBackgroundClass){this.styleNaviContainerClass=g.naviBackgroundClass}if("naviButtonWidth" in g){this.styleNaviButtonWidth=g.naviButtonWidth}if("naviButtonHeight" in g){this.styleNaviButtonHeight=g.naviButtonHeight}if("naviButtonSpace" in g){this.styleNaviButtonSpace=g.naviButtonSpace}if("zoomButtonWidth" in g){this.styleZoomButtonWidth=g.zoomButtonWidth}if("zoomButtonHeight" in g){this.styleZoomButtonHeight=g.zoomButtonHeight}if("zoomButtonSpace" in g){this.styleZoomButtonSpace=g.zoomButtonSpace}}this.container=document.createElement("div");var h=(this.styleNaviButtonWidth*3)+(this.styleNaviButtonSpace*2);var i=(this.styleNaviButtonHeight*3)+(this.styleNaviButtonSpace*2);this.naviBackground=document.createElement("div");this.naviBackground.className=this.styleNaviContainerClass;this.naviBackground.style.width=h+"px";this.naviBackground.style.height=i+"px";this._setBgImage(this.naviBackground,"img_btn_arrows.png");this.container.appendChild(this.naviBackground);this.drag=null;var k=this._createNaviButtonElement("img_btn_up.png",this.styleNaviButtonWidth+this.styleNaviButtonSpace,0);this.container.appendChild(k);GEvent.addDomListener(k,"click",function(){a.panDirection(0,1)});var e=this._createNaviButtonElement("img_btn_left.png",0,this.styleNaviButtonHeight+this.styleNaviButtonSpace);this.container.appendChild(e);GEvent.addDomListener(e,"click",function(){a.panDirection(1,0)});var d=this._createNaviButtonElement("img_btn_center.png",this.styleNaviButtonWidth+this.styleNaviButtonSpace,this.styleNaviButtonHeight+this.styleNaviButtonSpace);this.container.appendChild(d);GEvent.addDomListener(d,"click",function(){a.returnToSavedPosition()});var f=this._createNaviButtonElement("img_btn_right.png",(this.styleNaviButtonWidth+this.styleNaviButtonSpace)*2,this.styleNaviButtonHeight+this.styleNaviButtonSpace);this.container.appendChild(f);GEvent.addDomListener(f,"click",function(){a.panDirection(-1,0)});var b=this._createNaviButtonElement("img_btn_down.png",this.styleNaviButtonWidth+this.styleNaviButtonSpace,(this.styleNaviButtonHeight+this.styleNaviButtonSpace)*2);this.container.appendChild(b);GEvent.addDomListener(b,"click",function(){a.panDirection(0,-1)});var j=this._createZoomButtonElement("img_btn_zoomin.png",(h-this.styleZoomButtonWidth)/2,((this.styleNaviButtonHeight+this.styleNaviButtonSpace)*3)+this.styleNaviButtonSpace);this.container.appendChild(j);GEvent.addDomListener(j,"click",function(){a.zoomIn()});var c=this._createZoomButtonElement("img_btn_zoomout.png",(h-this.styleZoomButtonWidth)/2,((this.styleNaviButtonHeight+this.styleNaviButtonSpace)*3)+this.styleNaviButtonSpace+this.styleZoomButtonHeight+this.styleZoomButtonSpace);this.container.appendChild(c);GEvent.addDomListener(c,"click",function(){a.zoomOut()});a.getContainer().appendChild(this.container);return(this.container)};ReallyZoomControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(15,15))};ReallyZoomControl.prototype.createZoomElement_=function(c){var b=document.createElement("div");b.style.width=R_ZOOM_CONTROL_SLIDER_WIDTH+"px";b.style.height=R_ZOOM_CONTROL_SLIDER_HEIGHT+"px";b.style.left=this.styleNaviButtonWidth+this.styleNaviButtonSpace+"px";b.style.top=((this.styleNaviButtonHeight+this.styleNaviButtonSpace)*4)+R_ZOOM_CONTROL_SLIDER_SPACE+"px";b.style.backgroundColor="white";b.style.cursor="pointer";b.style.position="relative";b.style.zIndex=10;var a=R_ZOOM_CONTROL_SLIDER_HEIGHT-R_ZOOM_CONTROL_HANDLE_HEIGHT;var d=document.createElement("div");d.style.width=R_ZOOM_CONTROL_HANDLE_WIDTH+"px";d.style.height=R_ZOOM_CONTROL_HANDLE_HEIGHT+"px";d.style.position="absolute";d.style.backgroundColor="red";d.style.zIndex=1000;d.style.top=(a-((a*c.getZoom())/17))+"px";GEvent.addListener(c,"zoomend",GEvent.callback(d,function(f,e){this.style.top=(a-((a*e)/17))+"px"}));GEvent.addDomListener(d,"mousedown",GEvent.callback(this,function(f){this.drag={begin:ReallyZoomControl.getMousePosition(f),left:b.left,top:b.top}}));GEvent.addDomListener(d,"mouseup",GEvent.callback(this,function(f){this.drag=null}));GEvent.addDomListener(d,"mousemove",GEvent.callback(this,function(g){if(this.drag!=null){var h=ReallyZoomControl.getMousePosition(g);h.x-=this.drag.left;h.y-=this.drag.top;var f=(h.y*17)/a;c.setZoom(f)}}));GEvent.addDomListener(d,"dragend",GEvent.callback(d,function(){}));b.appendChild(d);return(b)};ReallyZoomControl.prototype.screenToSlider_=function(b,a){var c={x:b-zoomSliderElement,y:a};return(c)};ReallyZoomControl.prototype._createNaviButtonElement=function(d,a,c){var b=document.createElement("div");b.style.color="black";b.style.width=this.styleNaviButtonWidth+"px";b.style.height=this.styleNaviButtonHeight+"px";b.style.font="small Arial";b.style.textAlign="center";b.style.cursor="pointer";b.style.position="absolute";b.style.left=""+a+"px";b.style.top=""+c+"px";this._setBgImage(b,d);return(b)};ReallyZoomControl.prototype._createZoomButtonElement=function(d,a,c){var b=document.createElement("div");b.style.color="black";b.style.width=this.styleZoomButtonWidth+"px";b.style.height=this.styleZoomButtonHeight+"px";b.style.font="small Arial";b.style.textAlign="center";b.style.cursor="pointer";b.style.position="absolute";b.style.left=""+a+"px";b.style.top=""+c+"px";this._setBgImage(b,d);return(b)};ReallyZoomControl.prototype._setBgImage=function(b,c){var a=navigator.appVersion;if(a.match("MSIE 6.0")||a.match("MSIE 5.")){b.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+c+"', sizingMethod='crop')"}else{b.style.background="url("+this.styleBaseUrl+"/"+c+") no-repeat left top"}return(b)};ReallyZoomControl.getMousePosition=function(a){var c=0;var b=0;if(!a){var a=window.event}if(a.pageX||a.pageY){c=a.pageX;b=a.pageY}else{if(a.clientX||a.clientY){c=a.clientX+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft);b=a.clientY+(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)}}return({x:c,y:b})};
