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.style.color=R_MAPTYPE_CONTROL_ACTIVE_COLOR;ReallyMapTypeControl.setBgImage_(this.buttonElements[D].button,R_MAPTYPE_CONTROL_ACTIVE_BGIMAGE)}else{this.buttonElements[D].button.style.color=R_MAPTYPE_CONTROL_DEACTIVE_COLOR;ReallyMapTypeControl.setBgImage_(this.buttonElements[D].button,R_MAPTYPE_CONTROL_DEACTIVE_BGIMAGE)}}}));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";if(B){A.style.color=R_MAPTYPE_CONTROL_ACTIVE_COLOR;ReallyMapTypeControl.setBgImage_(A,R_MAPTYPE_CONTROL_ACTIVE_BGIMAGE)}else{A.style.color=R_MAPTYPE_CONTROL_DEACTIVE_COLOR;ReallyMapTypeControl.setBgImage_(A,R_MAPTYPE_CONTROL_DEACTIVE_BGIMAGE)}A.style.font="small Arial";A.style.margin="0px";A.style.lineHeight="25px";A.style.textAlign="center";A.style.verticalAlign="bottom";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(){}ReallyZoomControl.prototype=new GControl();ReallyZoomControl.prototype.initialize=function(F){this.container=document.createElement("div");this.drag=null;var C=this.createButtonElement("img_btn_up.png",R_ZOOM_CONTROL_BUTTON_WIDTH+R_ZOOM_CONTROL_BUTTON_SPACE,0);this.container.appendChild(C);GEvent.addDomListener(C,"click",function(){F.panDirection(0,1)});var G=this.createButtonElement("img_btn_left.png",0,R_ZOOM_CONTROL_BUTTON_HEIGHT+R_ZOOM_CONTROL_BUTTON_SPACE);this.container.appendChild(G);GEvent.addDomListener(G,"click",function(){F.panDirection(1,0)});var H=this.createButtonElement("img_btn_center.png",R_ZOOM_CONTROL_BUTTON_WIDTH+R_ZOOM_CONTROL_BUTTON_SPACE,R_ZOOM_CONTROL_BUTTON_HEIGHT+R_ZOOM_CONTROL_BUTTON_SPACE);this.container.appendChild(H);GEvent.addDomListener(H,"click",function(){F.returnToSavedPosition()});var E=this.createButtonElement("img_btn_right.png",(R_ZOOM_CONTROL_BUTTON_WIDTH+R_ZOOM_CONTROL_BUTTON_SPACE)*2,R_ZOOM_CONTROL_BUTTON_HEIGHT+R_ZOOM_CONTROL_BUTTON_SPACE);this.container.appendChild(E);GEvent.addDomListener(E,"click",function(){F.panDirection(-1,0)});var B=this.createButtonElement("img_btn_down.png",R_ZOOM_CONTROL_BUTTON_WIDTH+R_ZOOM_CONTROL_BUTTON_SPACE,(R_ZOOM_CONTROL_BUTTON_HEIGHT+R_ZOOM_CONTROL_BUTTON_SPACE)*2);this.container.appendChild(B);GEvent.addDomListener(B,"click",function(){F.panDirection(0,-1)});var D=this.createButtonElement("img_btn_zoomin.png",R_ZOOM_CONTROL_BUTTON_WIDTH+R_ZOOM_CONTROL_BUTTON_SPACE,((R_ZOOM_CONTROL_BUTTON_HEIGHT+R_ZOOM_CONTROL_BUTTON_SPACE)*3)+R_ZOOM_CONTROL_SLIDER_SPACE);this.container.appendChild(D);GEvent.addDomListener(D,"click",function(){F.zoomIn()});var A=this.createButtonElement("img_btn_zoomout.png",R_ZOOM_CONTROL_BUTTON_WIDTH+R_ZOOM_CONTROL_BUTTON_SPACE,((R_ZOOM_CONTROL_BUTTON_HEIGHT+R_ZOOM_CONTROL_BUTTON_SPACE)*4)+R_ZOOM_CONTROL_SLIDER_SPACE);this.container.appendChild(A);GEvent.addDomListener(A,"click",function(){F.zoomOut()});F.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=R_ZOOM_CONTROL_BUTTON_WIDTH+R_ZOOM_CONTROL_BUTTON_SPACE+"px";B.style.top=((R_ZOOM_CONTROL_BUTTON_HEIGHT+R_ZOOM_CONTROL_BUTTON_SPACE)*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(E){this.drag={begin:ReallyZoomControl.getMousePosition(E),left:B.left,top:B.top}}));GEvent.addDomListener(D,"mouseup",GEvent.callback(this,function(E){this.drag=null}));GEvent.addDomListener(D,"mousemove",GEvent.callback(this,function(F){if(this.drag!=null){var G=ReallyZoomControl.getMousePosition(F);G.x-=this.drag.left;G.y-=this.drag.top;var E=(G.y*17)/A;C.setZoom(E)}}));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.createButtonElement=function(E,A,D){var C=document.createElement("div");C.style.color="black";C.style.width=R_ZOOM_CONTROL_BUTTON_WIDTH+"px";C.style.height=R_ZOOM_CONTROL_BUTTON_HEIGHT+"px";C.style.font="small Arial";C.style.textAlign="center";C.style.cursor="pointer";C.style.position="absolute";C.style.left=""+A+"px";C.style.top=""+D+"px";var B=navigator.appVersion;if(B.match("MSIE 6.0")||B.match("MSIE 5.")){C.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+R_GMAP_STYLE_ROOT+"/"+E+"', sizingMethod='crop')"}else{C.style.background="url("+R_GMAP_STYLE_ROOT+"/"+E+") no-repeat left top"}return(C)};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})};