function PResizeControl(){};PResizeControl.prototype=new GControl();PResizeControl.RESIZE_BOTH=0;PResizeControl.RESIZE_WIDTH=1;PResizeControl.RESIZE_HEIGHT=2;PResizeControl.prototype.initialize=function(gMap){var that=this;this._map=gMap;this.resizable=false;this.mode=PResizeControl.RESIZE_BOTH;this.minWidth=150;this.minHeight=150;this.maxWidth=0;this.maxHeight=0;this.diffX=0;this.diffY=0;var container=document.createElement("div");container.style.width="20px";container.style.height="20px";container.style.backgroundImage="url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUBAMAAAB/pwA+AAAAAXNSR0IArs4c6QAAAA9QTFRFMBg0f39/0dDN7eri/v7+XsdLVAAAAAF0Uk5TAEDm2GYAAABNSURBVAjXRcpBDcAwDEPRKAymImghuCUw/qTWJI7nk/X0zXquZ+tH6E5df3TngPBA+ELY7UW2gWwDq02sNjHbwmwLoyVGS7ytbw62tA8zTA85AeAv2wAAAABJRU5ErkJggg%3D%3D)";gMap.getContainer().appendChild(container);GEvent.addDomListener(container,'mousedown',function(){that.resizable=true;});GEvent.addDomListener(document,'mouseup',function(){that.resizable=false;});GEvent.addDomListener(document,'mousemove',function(e){that.onmouseover(e);});var terms=gMap.getContainer().childNodes[2];terms.style.marginRight="25px";return container;}
PResizeControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_BOTTOM_RIGHT,new GSize(0,0));}
PResizeControl.prototype.onmouseover=function(e){var sx=window.scrollX||document.documentElement.scrollLeft||0;var sy=window.scrollY||document.documentElement.scrollTop||0;if(!e){e=window.event;}
mouseX=e.clientX+sx;mouseY=e.clientY+sy;var deltaX=mouseX-this.diffX;var deltaY=mouseY-this.diffY;this.diffX=mouseX;this.diffY=mouseY;if(this.resizable){this.changeMapSize(deltaX,deltaY);}
return false;}
PResizeControl.prototype.changeMapSize=function(dx,dy){var container=this._map.getContainer();var width=parseInt(container.style.width);var height=parseInt(container.style.height);width+=dx;height+=dy;if(this.minWidth){width=Math.max(this.minWidth,width);}
if(this.maxWidth){width=Math.min(this.maxWidth,width);}
if(this.minHeight){height=Math.max(this.minHeight,height);}
if(this.maxHeight){height=Math.min(this.maxHeight,height);}
if(this.mode!=PResizeControl.RESIZE_HEIGHT){container.style.width=width+"px";}
if(this.mode!=PResizeControl.RESIZE_WIDTH){container.style.height=height+"px";}
this._map.checkResize();}
