function ExpandMapDivControl(){}
ExpandMapDivControl.prototype=new GControl();ExpandMapDivControl.prototype.initialize=function(map){var container=document.createElement("div");var expandDiv=document.createElement("div");var expandImg=document.createElement("img");expandImg.setAttribute('src','http://content.turbine.com/sites/google_map/hide_results.gif');expandImg.setAttribute('title','Expand map');var contractDiv=document.createElement("div");var contractImg=document.createElement("img");contractImg.setAttribute('src','http://content.turbine.com/sites/google_map/show_results.gif');contractImg.setAttribute('title','Shrink map');var mapContainer=map.getContainer();this.setButtonStyle_(expandDiv);container.appendChild(expandDiv);expandDiv.appendChild(expandImg);expandDiv.setAttribute('class','gcExpand');GEvent.addDomListener(expandDiv,"click",function(){$('.gcExpand,.gcContract').toggle();$(mapContainer).data('orig_dims',{width:$(mapContainer).width(),height:$(mapContainer).height()});$(mapContainer).animate({width:"730px",height:"487px"},function(){map.checkResize();map.returnToSavedPosition();});});this.setButtonStyle_(contractDiv);container.appendChild(contractDiv);contractDiv.appendChild(contractImg);contractDiv.setAttribute('class','gcContract');GEvent.addDomListener(contractDiv,"click",function(){$('.gcExpand,.gcContract').toggle();$(mapContainer).animate({width:$(mapContainer).data('orig_dims').width,height:$(mapContainer).data('orig_dims').height},function(){map.checkResize();map.returnToSavedPosition();});});mapContainer.appendChild(container);$('.gcContract').hide();return container;}
ExpandMapDivControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(1,1));}
ExpandMapDivControl.prototype.setButtonStyle_=function(button){button.style.padding="2px";button.style.marginBottom="3px";button.style.textAlign="center";button.style.cursor="pointer";}
function LabelOverlay(pCenter,pLabel,pColor,pFontSize){this.mCenter=pCenter;this.mLabel=pLabel;this.mColor=pColor||"#fffa73";this.mWidth=200;this.mFontSize=parseInt(pFontSize||12);this.mHeight=this.mFontSize+4;}
LabelOverlay.prototype=new GOverlay();LabelOverlay.prototype.initialize=function(pMap){var div=document.createElement('div');div.style.position='absolute';div.style.overflow='visible';div.style.textAlign='center';div.style.fontWeight='bold';div.style.whiteSpace='nowrap';div.style.width=this.mWidth+'px';div.style.height=this.mHeight+'px';var shadowDiv=document.createElement('div');shadowDiv.className='mapShadow';shadowDiv.style.width=this.mWidth+'px';shadowDiv.style.height=this.mHeight+'px';pMap.getPane(G_MAP_MARKER_PANE).appendChild(div);this.mMap=pMap;this.mDiv=div;this.mShadow=shadowDiv;}
LabelOverlay.prototype.remove=function(){this.mDiv.parentNode.removeChild(this.mDiv);}
LabelOverlay.prototype.copy=function(){return new LabelOverlay(this.mCenter,this.mLabel,this.mColor);}
LabelOverlay.prototype.redraw=function(pForce){if(!pForce){return;}
this.mDiv.style.height=this.mHeight+'px';this.mShadow.style.height=this.mHeight+'px';this.mDiv.innerHTML='<span style="font-size: '+this.mFontSize+'px;">'+this.mLabel+'</span>';this.mShadow.innerHTML='<span style="font-size: '+this.mFontSize+'px;">'+this.mLabel+'</span>';this.mDiv.appendChild(this.mShadow);this.mDiv.style.color=this.mColor;var c1=this.mMap.fromLatLngToDivPixel(this.mCenter);this.mDiv.style.left=(c1.x-this.mWidth/2)+'px';this.mDiv.style.top=(c1.y-this.mHeight/2)+'px';}
LabelOverlay.prototype.makeDraggable=function(){this.mDragObject=new GDraggableObject(this.mDiv);this.mDragObject.mParent=this;GEvent.addListener(this.mDragObject,'dragstart',function(){this.mParent.left=this.left;this.mParent.top=this.top;});GEvent.addListener(this.mDragObject,'dragend',function(){var newpixels=new GPoint(this.left+this.mParent.mWidth/2,this.top+this.mParent.mHeight/2);this.mParent.mCenter=this.mParent.mMap.fromDivPixelToLatLng(newpixels);this.mParent.redraw(true);GEvent.trigger(this.mParent,'dragend',this.mParent.mCenter);});}
LabelOverlay.prototype.setLabel=function(pLabel){this.mLabel=pLabel;this.redraw(true);}
LabelOverlay.prototype.setColor=function(pColor){this.mColor=pColor;this.redraw(true);}
LabelOverlay.prototype.setFontSize=function(pFontSize){this.mFontSize=parseInt(pFontSize);this.mHeight=this.mFontSize+4;this.redraw(true);}
function EuclideanProjection(a){this.maxZoom=a;this.calculatedZooms=[];this.mapWidths=[548,1096,2192,4384,8768,17536,35072,70144];this.mapHeights=[240,480,960,1920,3840,7680,15360,30720];this.mapShiftsX=[-75,-150,-300,-600,-1200,-2400,-4800,-9600];this.mapShiftsY=[2,3,7,13,26,53,106,211];this.mapExtents=[512,1024,2048,4096,8192,16384,32768,65536];this.tileBounds=[];this.padding=[];}
EuclideanProjection.prototype=new GProjection();EuclideanProjection.prototype.getTileBounds=function(zoom){if(!this.tileBounds[zoom]){var boundX=Math.ceil(this.getMapWidth(zoom)/256);var boundY=Math.ceil(this.getMapHeight(zoom)/256);this.tileBounds[zoom]=new GPoint(boundX,boundY);}
return this.tileBounds[zoom];};EuclideanProjection.prototype.getPadding=function(zoom){if(!this.padding[zoom]){var padX=(Math.ceil(this.mapWidths[zoom]/256)*256-this.mapWidths[zoom])/2;var padY=(Math.ceil(this.mapHeights[zoom]/256)*256-this.mapHeights[zoom])/2;this.padding[zoom]=new GPoint(padX,padY);}
return this.padding[zoom];};EuclideanProjection.prototype.getMapHeight=function(zoom){if(!this.mapHeights[zoom]){var mapHeightStep=(this.mapHeights[this.maxZoom-1]-this.mapHeights[0])/(this.maxZoom-1);var exHeight=this.mapHeights[this.maxZoom-1]+(mapHeightStep*(zoom-this.maxZoom));this.mapHeights[zoom]=exHeight;}
return this.mapHeights[zoom];};EuclideanProjection.prototype.getMapWidth=function(zoom){if(!this.mapWidths[zoom]){var mapWidthStep=(this.mapWidths[this.maxZoom-1]-this.mapWidths[0])/(this.maxZoom-1);var exWidth=this.mapWidths[this.maxZoom-1]+(mapWidthStep*(zoom-this.maxZoom));this.mapWidths[zoom]=exWidth;}
return this.mapWidths[zoom];};EuclideanProjection.prototype.getMapExtent=function(zoom){if(!this.mapExtents[zoom]){var maxExtentStep=(this.mapExtents[this.maxZoom-1]-this.mapExtents[0])/(this.maxZoom-1);var exExtent=this.mapExtents[this.maxZoom-1]+(maxExtentStep*(zoom-this.maxZoom));this.mapExtents[zoom]=exExtent;}
return this.mapExtents[zoom];};EuclideanProjection.prototype.getPadding=function(zoom){if(!this.padding[zoom]){var padX=(Math.ceil(this.getMapWidth(zoom)/256)*256-this.getMapWidth(zoom))/2;var padY=(Math.ceil(this.getMapHeight(zoom)/256)*256-this.getMapHeight(zoom))/2;this.padding[zoom]=new GPoint(padX,padY);}
return this.padding[zoom];};EuclideanProjection.prototype.getShift=function(zoom){if(!this.mapShiftsX[zoom]||!this.mapShiftsY[zoom]){var shiftXStep=(this.mapShiftsX[this.maxZoom-1]-this.mapShiftsX[0])/(this.maxZoom-1);var shiftYStep=(this.mapShiftsY[this.maxZoom-1]-this.mapShiftsY[0])/(this.maxZoom-1);var exShiftX=this.mapShiftsX[this.maxZoom-1]+(shiftXStep*(zoom-this.maxZoom));var exShiftY=this.mapShiftsY[this.maxZoom-1]+(shiftYStep*(zoom-this.maxZoom));this.mapShiftsX[zoom]=exShiftX;this.mapShiftsY[zoom]=exShiftY;}
return new GPoint(this.mapShiftsX[zoom],this.mapShiftsY[zoom]);};EuclideanProjection.prototype.fromLatLngToPixel=function(a,b){var c=Math.round(this.getMapExtent(b)/2+a.lng()*this.getMapExtent(b)/360);var d=Math.round(this.getMapExtent(b)/2+(-2*a.lat())*this.getMapExtent(b)/360);c=c-(this.getMapExtent(b)-this.getMapWidth(b))/2;d=d-(this.getMapExtent(b)-this.getMapHeight(b))/2;c+=this.getPadding(b).x;d+=this.getPadding(b).y;c+=this.getShift(b).x;d+=this.getShift(b).y;return new GPoint(c,d);};EuclideanProjection.prototype.fromPixelToLatLng=function(a,b,c){a.x-=this.getShift(b).x;a.y-=this.getShift(b).y;a.x-=this.getPadding(b).x;a.y-=this.getPadding(b).y;a.x+=(this.getMapExtent(b)-this.getMapWidth(b))/2;a.y+=(this.getMapExtent(b)-this.getMapHeight(b))/2;var d=(a.x-this.getMapExtent(b)/2)*360/this.getMapExtent(b);var e=(a.y-this.getMapExtent(b)/2)*360/this.getMapExtent(b)/-2;return new GLatLng(e,d,c);};EuclideanProjection.prototype.tileCheckRange=function(a,b,c){if(a.y<0||a.y>=this.getTileBounds(b).y){return false;}
if(a.x<0||a.x>=this.getTileBounds(b).x){return false;}
return true}
EuclideanProjection.prototype.getWrapWidth=function(zoom){return this.getTileBounds(zoom).x*256*8;}
var tilelayers1=[new GTileLayer(new GCopyrightCollection(""),0,7)];tilelayers1[0].getCopyright=function(a,b){return{prefix:"",copyrightTexts:[""]};};tilelayers1[0].getTileUrl=function(a,b){var subDir="";if(b==7){subDir="-"+a.x.toString().charAt(0);}
return"http://karte.hdro-mobs.de/me_"+b+"_"+a.x+"x"+a.y+".jpg";};tilelayers1[0].isPng=function(){return true;};var tilelayers2=[new GTileLayer(new GCopyrightCollection(""),0,7)];tilelayers2[0].getCopyright=function(a,b){return{prefix:"",copyrightTexts:[""]};};tilelayers2[0].getTileUrl=function(a,b){if(b==7){var subDir="-"+a.x.toString().charAt(0);return"http://karte.hdro-mobs.de/me_"+b+"_"+a.x+"x"+a.y+".jpg";}
return"http://karte.hdro-mobs.de/me_"+b+"_"+a.x+"x"+a.y+".jpg";};tilelayers2[0].isPng=function(){return true;};var G_GAME_MAP=new GMapType(tilelayers1,new EuclideanProjection(8),"Terrain",{errorMessage:"No Data Available",textColor:"white"});var G_PARCHMENT_MAP=new GMapType(tilelayers2,new EuclideanProjection(8),"Parchment",{errorMessage:"No Data Available",textColor:"white"});function wheelevent(e){if(!e)e=window.event;if(e.preventDefault)e.preventDefault();e.returnValue=false;}
