moveObjectID="";var mouseX=0;var mouseY=0;var x1=0;var y1=0;var x2=0;var y2=0;var zleft=0;var zright=0;var ztop=0;var zbottom=0;var mapX;var mapY;var imgX;var imgY;var panning=false;var zooming=false;var zooming_loc=false;var move_object="";var move_object_offsetx;var move_object_offsety;var mouseevent;function mousemove(e)
{if(!e)
{mouseevent=window.event;}
else
{mouseevent=e;}
if(document.all)
{mouseX=mouseevent.clientX+document.documentElement.scrollLeft;mouseY=mouseevent.clientY+document.documentElement.scrollTop;}
else
{mouseX=mouseevent.pageX;mouseY=mouseevent.pageY;}
return false;}
function empty_function()
{}
function resetEventListeners(keepKeyDown)
{if(keepKeyDown)
{}else{document.onmousedown=null;document.getElementById('map').onmousedown=null;}
document.onmouseup=null;document.getElementById('map').onmouseup=null;document.getElementById('map').onmousedown=null;document.getElementById('map').onclick=null;document.ondblclick=null;document.getElementById('map').ondblclick=null;document.onkeydown=null;hideLayer('theSelCircleLayer');if(typeof hideMeasure!='undefined')
hideMeasure();}
function startRefMapZoombox(e)
{if(e==null)
{e=window.event;window.event.returnValue=false;}
getlocImageCoords(e);if((mouseX>=0)&&(mouseX<=OvMapPix_width)&&(mouseY>=0)&&(mouseY<=OvMapPix_height))
{x1=mouseX;y1=mouseY;x2=x1+1;y2=y1+1;zooming_loc=true;updateBox("theRefZoomBox");showLayer("theRefZoomBox");document.onkeydown=null;}
if(typeof e.preventDefault!='undefined')
{e.preventDefault();}
if(typeof e.cancelBubble!='undefined')
{e.cancelBubble=true;}
e.returnValue=false;return false;}
function moveRefMapZoombox(e)
{if(e==null)
e=window.event
if(zooming_loc)
{getlocImageCoords(e);if(mouseX<0)
mouseX=0;if(mouseX>OvMapPix_width)
mouseX=OvMapPix_width;if(mouseY<0)
mouseY=0;if(mouseY>OvMapPix_height)
mouseY=OvMapPix_height;x2=mouseX;y2=mouseY;updateBox("theRefZoomBox");}
if(typeof e.preventDefault!='undefined')
{e.preventDefault();}
e.returnValue=false;return false;}
function stopRefMapZoombox(e)
{if(e==null)
e=window.event;getlocImageCoords(e);if(mouseX<0)
mouseX=0;if(mouseX>OvMapPix_width)
mouseX=OvMapPix_width;if(mouseY<0)
mouseY=0;if(mouseY>OvMapPix_height)
mouseY=OvMapPix_height;x2=mouseX;y2=mouseY;zooming_loc=false;updateBox("theRefZoomBox");if(document.all)
{var BoxLineWidth=0;}
else
{var BoxLineWidth=2;}
if((zright<=zleft+BoxLineWidth+2)&&(ztop<=zbottom+BoxLineWidth+2)){mouseY=OvMapPix_height-mouseY;var pix_x=ovWidth/OvMapPix_width;var pix_y=ovHeight/OvMapPix_height;map.setCenter(new OpenLayers.LonLat(mouseX*pix_x+ov_x,mouseY*pix_y+ov_y));}
else
{var pixelX=ovWidth/OvMapPix_width;var pixelY=ovHeight/OvMapPix_height;var theY=OvMapPix_height-ztop;newTop=pixelY*theY+ov_y;var theX=zright;newRight=pixelX*theX+ov_x;theX=zleft;newLeft=pixelX*theX+ov_x;theY=OvMapPix_height-zbottom;newBottom=pixelY*theY+ov_y;map.zoomToExtent(new OpenLayers.Bounds(newLeft,newBottom,newRight,newTop));}
document.onmouseup=null;hideBox();if(typeof e.preventDefault!='undefined')
{e.preventDefault();}
e.returnValue=false;return false;}
function clickCoords(e)
{getImageCoords(e);refreshCoordDisplay(mouseX,mouseY);}
function clickMeasure(e)
{getImageCoords(e);showLayer('theMeasureLayer');refreshMeasureDisplay(mouseX,mouseY);}
function stopMeasure(e)
{measure_n=0;measure_line.clear();measure_x=new Array();measure_y=new Array();hideLayer("theCoords");alter_innerHTML("theCoords","");}
function startMoveObject(layername,offset_x,offset_y)
{move_object=layername;if(document.all)
{move_object_offsetx=event.offsetX;move_object_offsety=event.offsetY;}else{move_object_offsetx=offset_x;move_object_offsety=offset_y;}
document.onmousemove=MoveObject;document.onmouseup=stopMoveObject;document.onkeydown=breakfunction;}
function MoveObject(e)
{if(document.all)
{var newpos_x=event.clientX+document.documentElement.scrollLeft-move_object_offsetx;var newpos_y=event.clientY+document.documentElement.scrollTop-move_object_offsety;e=window.event;}else{var newpos_x=e.pageX-move_object_offsetx;var newpos_y=e.pageY-move_object_offsety;}
if(move_object!="")
{getImageCoords(e);if(document.all)
{var windowwidth=document.body.clientWidth;var windowheight=document.body.clientHeight;}
else
{var windowwidth=window.innerWidth;var windowheight=window.innerHeight;}
if(newpos_x<=0)
newpos_x=1;if(newpos_x>windowwidth-document.getElementById(move_object).style.width.replace('px',''))
newpos_x=windowwidth-document.getElementById(move_object).style.width.replace('px','')-5;if(newpos_y<=0)
newpos_y=1;if(newpos_y>windowheight-document.getElementById(move_object).style.height.replace('px',''))
newpos_y=windowheight-document.getElementById(move_object).style.height.replace('px','')-5;if(document.all){moveLayer(move_object,event.clientX-5+document.documentElement.scrollLeft,event.clientY-15+document.documentElement.scrollTop);}else{moveLayer(move_object,newpos_x,newpos_y);}}
if(typeof e.preventDefault!='undefined')
{e.preventDefault();e.returnValue=false;}
if(e.stopPropagation){e.stopPropagation();}else{e.cancelBubble=true;}
return false;}
function stopMoveObject(e)
{move_object="";resetEventListeners();}
function breakfunction(ev)
{if(!ev){ev=window.event;}
if(!ev.shiftKey){zooming=false;zooming_loc=false;measure_n=0;measure_line.clear();measure_x=new Array();measure_y=new Array();hideLayer("theCoords");alter_innerHTML("theCoords","");selCircle.clear();zooming=false;zooming_loc=false;hideBox();if(panning)
{window.document.theImage.src=document.thePanImage.src;hideLayer("thePanMap");panning=false;}
document.getElementById('map').onmouseup=null;document.getElementById('map').onmousemove=null;hideLayer('radiusdisplay');}}
function calcMapCoords(xcoord,ycoord){mapX=minx+xcoord*map.getResolution();mapY=maxy-ycoord*map.getResolution();}
function MapCoordX(xcoord){return minx+xcoord*map.getResolution();}
function MapCoordY(ycoord){return maxy-ycoord*map.getResolution();}
function getImageCoords(e){if(document.all){mouseX=event.clientX+document.documentElement.scrollLeft;mouseY=event.clientY+document.documentElement.scrollTop;}else{mouseX=e.pageX;mouseY=e.pageY;}
x2=mouseX;y2=mouseY;}
function getlocImageCoords(e){if(e.layerX){mouseX=e.layerX;mouseY=e.layerY;}else{mouseX=e.offsetX;mouseY=e.offsetY;}}
function EventRelCoord_x(ev)
{if(!ev)
{ev=window.event;}
if(document.all)
{return ev.clientX;}
else
{return ev.layerX;}}
function EventRelCoord_y(ev)
{if(!ev)
{ev=window.event;}
if(document.all)
{return ev.clientY;}
else
{return ev.layerY;}}
function updateBox(o_id)
{zleft=x1;zright=x2;ztop=y1;zbottom=y2;if(x1>x2){zright=x1;zleft=x2;}else{zleft=x1;zright=x2;}
if(y1>y2){zbottom=y1;ztop=y2;}else{ztop=y1;zbottom=y2;}
if(document.all)
{var BoxLineWidth=2;}
else
{var BoxLineWidth=2;}
if(((zbottom-ztop)-2*BoxLineWidth)<0)
{zbottom=zbottom-((zbottom-ztop)-2*BoxLineWidth);}
if(((zright-zleft)-2*BoxLineWidth)<0)
{zright=zright-((zright-zleft)-2*BoxLineWidth);}
document.getElementById(o_id).style.top=(ztop)+"px";document.getElementById(o_id).style.left=(zleft)+"px";document.getElementById(o_id).style.height=((zbottom-ztop)-2*BoxLineWidth)+"px";document.getElementById(o_id).style.width=((zright-zleft)-2*BoxLineWidth)+"px";}
function hideBox(){hideLayer("theRefZoomBox");document.getElementById("theRefZoomBox").style.width=1+"px";document.getElementById("theRefZoomBox").style.height=1+"px";}
window.onresize=resize_window_event;var resize_window_timer=null;function resize_window_event()
{getOLLayer("mapsuite WMS").setVisibility(false);window.clearTimeout(resize_window_timer);resize_window_timer=window.setTimeout("checkIfNoLayers(getOLLayer('mapsuite WMS')); map.updateSize()",600);if(Math.max(map.getSize().h,map.getSize().w)*getOLLayer('mapsuite WMS').ratio>3000)
{alert("Maximale Kartengröße überschritten! Reduzieren Sie bitte die Fenstergröße!");}
adjustPosition();}
function rightLayer_onoff(objname)
{if(document.getElementById(objname))
{var obj=document.getElementById(objname);}
else
{return 0;}
if(obj.style.display=='block')
{obj.style.display='none';return 0;}else
{obj.style.display='block';return 1;}}
function rightLayer_onoff_jquery(objname)
{if($('#'+objname))
{var obj=$('#'+objname);}
else
{return 2;}
if(obj[0].style.display!='none')
{obj.hide("blind",{direction:"vertical"},500)
return 0;}else
{obj.show("blind",{direction:"vertical"},500)
return 1;}}
function getWindowWidth()
{if(window.innerWidth){return innerWidth;}else if(document.body&&document.body.offsetHeight){return document.body.offsetWidth;}
else if(document.documentElement&&document.documentElement.offsetWidth){return document.documentElement.offsetWidth;}else{return 700;}}
function getWindowHeight()
{if(window.innerWidth){return innerHeight;}else if(document.body&&document.body.offsetHeight){return document.body.offsetHeight;}
else if(document.documentElement&&document.documentElement.offsetWidth){return document.documentElement.offsetHeight;}else{return 500;}}
function adjustPosition(isInit)
{var winwidth=getWindowWidth();var winheight=getWindowHeight();var defaultMargin=6;var extraMoveLeft=0;document.getElementById('Scalebar').style.left=(leftGap+defaultMargin)+"px";document.getElementById('Scalebar').style.top=(winheight-document.getElementById('Scalebar').offsetHeight-bottomGap-defaultMargin)+"px";var mapWidth=winwidth-leftGap-rightGap;var mapHeight=winheight-topGap-bottomGap;if(mapWidth>1200)
mapWidth=1200;if(mapWidth<300)
mapWidth=300;if(mapHeight>1000)
mapHeight=1000;if(mapHeight<250)
mapHeight=250;document.getElementById('map').style.left=leftGap+"px";document.getElementById('map').style.top=topGap+"px";document.getElementById('map').style.width=mapWidth+"px";document.getElementById('map').style.height=mapHeight+"px";document.getElementById('FotoEnlarged').style.width=mapWidth+"px";document.getElementById('FotoEnlarged').style.height=mapHeight+"px";document.getElementById('right_layer').style.maxHeight=(winheight-defaultMargin-topGap)+"px";if(typeof isInit=='undefined')
{var oldVisi=document.getElementById('right_layer').style.display
document.getElementById('right_layer').style.display='block';document.getElementById('right_layer').style.top=topGap+"px";document.getElementById('right_layer').style.left=(leftGap+mapWidth+defaultMargin)+"px";document.getElementById('right_layer').style.display=oldVisi;}}
var search_lastRequestReceivedTime=0;var search_RequestCount=0;var search_RequestTimer=null;var search_lastSent='';var search_actualStreetId='';var search_RequestBuffer=2;var search_RequestBufferTimeSpan=200;var autoJump=false;var hiliteStyle={strokeColor:'#FF00FF',strokeOpacity:0.35,strokeDashstyle:"solid",strokeWidth:10};function getTime()
{var jetzt=new Date();return jetzt.getTime();}
function search_normalize(txt)
{retString='';txt.replace(/ß/g,'SS');txt=txt.toUpperCase();txt.replace(/STRA$/g,'STR.');txt.replace(/STRASS$/g,'STR.');txt.replace(/STRASSE$/g,'STR.');for(var i=0;i<txt.length;i++)
{if(txt.charCodeAt(i)>=65&&txt.charCodeAt(i)<=90)
{retString+=txt.charAt(i);}else{switch(txt.charAt(i)){case'Ä':retString+='AE';break;case'Ö':retString+='OE';break;case'Ü':retString+='UE';break;case'É':retString+='E';break;case'Á':retString+='A';break;case'È':retString+='E';break;case'À':retString+='A';break;case'Ó':retString+='O';break;case'Ò':retString+='O';break;case'Ú':retString+='U';break;case'Ù':retString+='U';break;default:break;}}}
return retString;}
function searchKeydown(evt)
{if(evt.which<48&&evt.which!=8)
return;activateNumberSearch(false);if(search_RequestTimer)
{clearTimeout(search_RequestTimer);}
var txt=document.getElementById('searchStreet').value;if(search_RequestCount<search_RequestBuffer)
{search_RequestTimer=window.setTimeout("searchKeydownSend('"+txt+"');",evt.which==8?search_RequestBufferTimeSpan*2:search_RequestBufferTimeSpan);search_RequestCount++;}else{searchKeydownSend(txt);}}
function searchKeydownSend(txt)
{search_RequestCount=0;var searchstring=search_normalize(txt);if(searchstring.length>1)
{if(search_lastSent==searchstring)
{return;}
search_lastSent=searchstring;jQuery.get("php/Search.php",{'mode':'searchStr','txt':searchstring,'time':getTime()},searchKeydown_callback,'json');}}
function searchKeydown_callback(obj)
{if(typeof obj=='string')
{obj=eval(obj);}
if(obj.time<search_lastRequestReceivedTime)
{return;}
search_lastRequestReceivedTime=obj.time;var inner='';if(typeof obj=='object'&&typeof obj.results=='object'&&obj.results.length>0)
{for(var i=0;i<obj.results.length;i++){inner=inner+'<div class="searchStreetResult" onclick="searchSelectStreet(\''+obj.results[i].strasse+'\', \''+obj.results[i].strassenid+'\');" >'+obj.results[i].strasse+'</div>';if(obj.results.length==1&&autoJump)
searchSelectStreet(obj.results[i].strasse,obj.results[i].strassenid);}
document.getElementById('searchResult').innerHTML=inner;if(document.getElementById('searchResult').style.display=='none')
{$('#searchResult').show("blind",{direction:"vertical"},500);}}}
function searchNumber(obj)
{var txt=document.getElementById('searchStreetNumber').value;if(search_actualStreetId.length==5)
{jQuery.get("php/Search.php",{'mode':'searchNumber','txt':txt,'id':search_actualStreetId,'time':getTime()},searchNumber_callback,'json');}}
function searchNumber_callback(obj)
{if(typeof obj=='string')
{obj=eval(obj);}
if(obj.time<search_lastRequestReceivedTime)
{alert('not last');}
search_lastRequestReceivedTime=obj.time;var inner='';if(typeof obj=='object'&&typeof obj.results=='object')
{for(var i=0;i<obj.results.length;i++){inner=inner+'<div class="searchStreetResult" onclick="searchSelectNumber(\''+obj.results[i].x+'\', \''+obj.results[i].y+'\');" >'+obj.results[i].number+'</div>';if(obj.results.length==1&&autoJump)
searchSelectNumber(obj.results[i].x,obj.results[i].y);}
document.getElementById('searchResult').innerHTML=inner;if(obj.results.length>0)
if(document.getElementById('searchResult').style.display=='none')
{$('#searchResult').show("blind",{direction:"vertical"},500);}}}
function searchSelectStreet(strasse,strid)
{$('#searchResult').hide("blind",{direction:"vertical"},500);document.getElementById('searchStreet').value=strasse;search_actualStreetId=strid;activateNumberSearch(true);jQuery.get("php/Search.php",{'mode':'getStreet','id':strid},highlighStreet_callback,'json');}
function searchSelectNumber(x,y)
{map.setCenter(new OpenLayers.LonLat(x,y),map.getNumZoomLevels()-1);markerLayer.removeMarker(adressMarker);adressMarker=new OpenLayers.Marker(new OpenLayers.LonLat(x,y),markerIcon);markerLayer.addMarker(adressMarker);hiliteLayer.destroyFeatures();}
function highlighStreet_callback(obj)
{if(typeof obj=='string')
{obj=eval(obj);}
hiliteLayer.destroyFeatures();var geomtxt=obj.geom.substr(obj.geom.indexOf('MULTI'));var myGeom=OpenLayers.Geometry.fromWKT(geomtxt);getOLLayer('Hilite').addFeatures([new OpenLayers.Feature.Vector(myGeom,null,hiliteStyle)]);zoomMapTo(obj.xmin,obj.ymin,obj.xmax,obj.ymax);}
function search_resetSearch()
{activateNumberSearch(false);document.getElementById('searchStreet').value='';document.getElementById('searchStreet').focus();if(document.getElementById('searchResult').style.display!='none')
{$('#searchResult').hide("blind",{direction:"vertical"},500);}
document.getElementById('searchResult').innerHTML='';}
function activateNumberSearch(doNumberSearch)
{if(doNumberSearch)
{document.getElementById('searchResult').style.width='60px';document.getElementById('searchResult').style.left='218px';document.getElementById('searchStreetNumber').disabled=false;document.getElementById('searchStreetNumber').focus();}else{document.getElementById('searchResult').style.width='200px';document.getElementById('searchResult').style.left='0px';document.getElementById('searchStreetNumber').value='';if(!document.getElementById('searchStreetNumber').disabled)
{document.getElementById('searchStreetNumber').disabled=true;if(document.getElementById('searchResult').style.display!='none')
{$('#searchResult').hide("blind",{direction:"vertical"},500);}
document.getElementById('searchResult').innerHTML='';}
search_actualStreetId='';}}
function doSearchStadtteil(bbox)
{var minmax=bbox.split(",");if(minmax.length==4)
zoomMapTo(minmax[0],minmax[1],minmax[2],minmax[3]);}
function fillStadtteil()
{jQuery.get("php/Search.php",{'mode':'fillStadtteil'},fillStadtteil_Callback,'json');}
function fillStadtteil_Callback(obj)
{if(typeof obj=='string')
{obj=eval(obj);}
if(typeof obj=='object')
{var Feld=document.getElementById("searchStadtteil");for(var i=0;i<obj.length;i++){NeuerEintrag=new Option(obj[i].name,obj[i].bbox,false,false);Feld.options[Feld.length]=NeuerEintrag;}}}
function drawScalebar(theScale,obj)
{var scale=theScale;var mb_resolution=28.35;var test_factor=1.0;if(scale<10*test_factor){var unit='10&nbsp;cm';var factor=10/scale;var img_width=Math.round(factor*mb_resolution);}
if(scale>=10*test_factor&&scale<55*test_factor){var unit='10'+streckeneinheit_abr;var factor=10/scale;var img_width=Math.round(factor*mb_resolution);}
if(scale>=55*test_factor&&scale<110*test_factor){var unit='1'+streckeneinheit_abr;var factor=100/scale;var img_width=Math.round(factor*mb_resolution);}
if(scale<550*test_factor&&scale>=110*test_factor){var unit='10'+streckeneinheit_abr;var factor=1000/scale;var img_width=Math.round(factor*mb_resolution);}
if(scale<110*test_factor&&scale>=550*test_factor){var unit='50'+streckeneinheit_abr;var factor=500/scale;var img_width=Math.round(factor*mb_resolution);}
if(scale<5500*test_factor&&scale>=1100*test_factor){var unit='100'+streckeneinheit_abr;var factor=10000/scale;var img_width=Math.round(factor*mb_resolution);}
if(scale<11000*test_factor&&scale>=5500*test_factor){var unit='500'+streckeneinheit_abr;var factor=50000/scale;var img_width=Math.round(factor*mb_resolution);}
if(scale<55000*test_factor&&scale>=11000*test_factor){var unit='1'+streckeneinheit_abr2;var factor=100000/scale;var img_width=Math.round(factor*mb_resolution);}
if(scale<110000*test_factor&&scale>=55000*test_factor){var unit='5'+streckeneinheit_abr2;var factor=500000/scale;var img_width=Math.round(factor*mb_resolution);}
if(scale<550000*test_factor&&scale>=110000*test_factor){var unit='10'+streckeneinheit_abr2;var factor=1000000/scale;var img_width=Math.round(factor*mb_resolution);}
if(scale<2000000*test_factor&&scale>=550000*test_factor){var unit='50'+streckeneinheit_abr2;var factor=5000000/scale;var img_width=Math.round(factor*mb_resolution);}
if(scale<10000000*test_factor&&scale>=2000000*test_factor){var unit='100'+streckeneinheit_abr2;var factor=10000000/scale;var img_width=Math.round(factor*mb_resolution);}
if(scale<100000000*test_factor&&scale>=10000000*test_factor){var unit='1000'+streckeneinheit_abr2;var factor=100000000/scale;var img_width=Math.round(factor*mb_resolution);}
if(scale>=100000000*test_factor){var unit='1000'+streckeneinheit_abr2;var factor=100000000/scale;var img_width=Math.round(factor*mb_resolution);}
obj.document.scale.width=img_width;obj.document.getElementById("scalebarunit").innerHTML=unit;}
function updateScaleNumber(obj)
{if(!obj)
obj=window;if(!(document.getElementById("Massstabszahl")==null))
{var massstab=(Math.round(theScale/250)*250).toString();if(massstab.length>7)
{massstab=massstab.substring(0,2)+"'"+massstab.substring(2,5)+"'"+massstab.substring(5,massstab.length);}else if(massstab.length>6){massstab=massstab.substring(0,1)+"'"+massstab.substring(1,4)+"'"+massstab.substring(4,massstab.length);}
else{massstab=massstab.substring(0,massstab.length-3)+"'"+massstab.substring(massstab.length-3,massstab.length);}
obj.document.getElementById("Massstabszahl").firstChild.nodeValue="1 : "+massstab;}}
function drawRefMapMarker(minx,maxx,miny,maxy)
{var boxlinewidth=parseInt(document.getElementById("theRefMapMarker").style.borderRightWidth.replace("px",""));if(document.all)
{boxlinewidth=0;}
var PixelX=ovWidth/OvMapPix_width;var PixelY=ovHeight/OvMapPix_height;var defx=ov_x;var defy=ov_y;var xoffset=Math.round((minx-defx)/(PixelX));var refmapboxwidth=Math.round((maxx-minx)/(PixelX));var yoffset=OvMapPix_height-Math.round((maxy-defy)/(PixelY));var refmapboxheight=Math.round((maxy-miny)/(PixelY));if(xoffset<0){xoffset=0;}
if(yoffset<0){yoffset=0;}
if((xoffset+refmapboxwidth)>OvMapPix_width){refmapboxwidth=OvMapPix_width-xoffset;}
if(yoffset+refmapboxheight>OvMapPix_height){refmapboxheight=OvMapPix_height-yoffset;}
if(refmapboxwidth-2*boxlinewidth<4)
{refmapboxwidth=3+2*boxlinewidth;}
if(refmapboxheight-2*boxlinewidth<4)
{refmapboxheight=3+2*boxlinewidth;}
document.getElementById("theRefMapMarker").style.left=(xoffset+1)+"px";document.getElementById("theRefMapMarker").style.top=(yoffset+1)+"px";document.getElementById("theRefMapMarker").style.width=(refmapboxwidth-2*boxlinewidth)+"px";document.getElementById("theRefMapMarker").style.height=(refmapboxheight-2*boxlinewidth)+"px";}
function Rectify_NewCoords()
{var newCenter_x=(newRight+newLeft)/2;var newCenter_y=(newTop+newBottom)/2;var newHeight=newTop-newBottom;var newWidth=newRight-newLeft;var ImageRatio=MapPix_width/MapPix_height;var h_1=newHeight;var h_2=newWidth/ImageRatio;var w_1=newHeight*ImageRatio;var w_2=newWidth;newLeft=newCenter_x-(w_1+w_2)/4;newBottom=newCenter_y-(h_1+h_2)/4;newRight=newCenter_x+(w_1+w_2)/4;newTop=newCenter_y+(h_1+h_2)/4;}
var TooltipMapX;var TooltipMapY;var TooltipPixX;var TooltipPixY;var TooltipTimer;var TooltipMarker;var LoadingTimeout;function start_Tooltip()
{if(loading)
return;if(use_tooltip_as_link&&document.getElementById('ToolTip').style.display=='block')
return;if(typeof console!='undefined')
console.log(MapserverURL+"&mode=query&layers="+mapLayer.replace(/,/g," ").replace(/grundwassererase/,"grundwasserall")+"&imgext="+map.getExtent().left+" "+map.getExtent().bottom+" "+map.getExtent().right+" "+map.getExtent().top+"&map_size="+map.getSize().w+" "+map.getSize().h+"&imgxy="+imgX+" "+imgY);showLayer('loadLayer');LoadingTimeout=window.setTimeout("hideLayer('loadLayer');",6000);jQuery.post(MapserverURL+"&mode=query&layers="+mapLayer.replace(/,/g," ").replace(/ grundwassererase/,"")+" grundwasserall&imgext="+map.getExtent().left+" "+map.getExtent().bottom+" "+map.getExtent().right+" "+map.getExtent().top+"&map_size="+map.getSize().w+" "+map.getSize().h+"&imgxy="+imgX+" "+imgY,null,Tooltip_Callback);}
function leaveFocus(obj)
{if(typeof TooltipTimer!='undefined'&&TooltipTimer)
clearTimeout(TooltipTimer);}
function positionTooltip(newLeft,newTop,clientX,clientY,theWidth,theHeight)
{if(newLeft>getWindowWidth()/2)
newLeft=clientX-16-200;if(newTop>getWindowHeight()-theHeight*2/3-16)
newTop=clientY-theHeight;;if(newTop<topGap)
newTop=topGap;return[newLeft,newTop];}
function Tooltip_Callback(obj)
{hideLayer('loadLayer');window.clearTimeout(LoadingTimeout);if(obj=='')
return;obj="["+obj.replace(/}{/g,'}, {')+"]";try{data=eval(obj);var inner='<table>';for(var i=0;i<data.length;i++)
{if(data[i].ID&&data[i].LAYER!='grundwassererase'&&data[i].LAYER!='grundwasserall')
{inner+='<tr><td style="background-color: rgb('+Math.floor((255-data[i].r)*0.3+data[i].r)+', '+Math.floor((255-data[i].g)*0.3+data[i].g)+', '+Math.floor((255-data[i].b)*0.3+data[i].b)+')">&nbsp;&nbsp;</td><td>Überschwemmungstiefe bei gewähltem Pegel:</td><td>'+decodeURI(data[i].ID)+'</td></tr>';}
if(data[i].ID&&data[i].LAYER=='grundwassererase')
{inner+='<tr><td style="background-color: rgb('+Math.floor((255-data[i].r)*0.3+data[i].r)+', '+Math.floor((255-data[i].g)*0.3+data[i].g)+', '+Math.floor((255-data[i].b)*0.3+data[i].b)+')">&nbsp;&nbsp;</td><td>Grundwasserflurabstand bei Pegel 11,90m:</td><td>'+decodeURI(data[i].ID)+'</td></tr>';}
if(data[i].ID&&data[i].LAYER=='grundwasserall')
{if(data[i].PIXEL==-32768){inner+='<tr><td></td><td colspan="2">keine Grundwasserinformation verf&uuml;gbar</td</tr>';}else{inner+='<tr><td style="background-color: rgb('+Math.floor((255-data[i].r)*0.3+data[i].r)+', '+Math.floor((255-data[i].g)*0.3+data[i].g)+', '+Math.floor((255-data[i].b)*0.3+data[i].b)+')">&nbsp;&nbsp;</td><td>Grundwasserflurabstand bei Pegel 11,90m:</td><td>'+(data[i].PIXEL<0?'Grundwasser erreicht Oberfläche':data[i].ID)+'</td></tr>';}}
if(data[i].TYPE)
{inner+='<tr><td><img src="graphics/legend_rr_thin.png" height="14" width="12" /></td><td colspan="2">Bei gewähltem Pegel ist ein Restrisiko für Überschwemmungen vorhanden </td></tr>';}
if(data[i].SCHUTZZIEL)
{inner+='<tr><td></td><td>Schutzanlage</td><td>Schutzziel:&nbsp;'+data[i].SCHUTZZIEL+'</td></tr>';}}
inner+='</table>';var newPos=positionTooltip(TooltipPixX+5,TooltipPixY-18,TooltipPixX,TooltipPixY,130,40);moveLayer('ToolTip',newPos[0],newPos[1]);document.getElementById('ToolTip').innerHTML=inner;showLayer('ToolTip');}catch(ex)
{}}
function makeLayer(name,left,top,width,height,visible,content,theClass){if(theClass)
{if(theClass.indexOf(":")<0)
{document.writeln('<div id="'+name+'" class="'+theClass+'"');document.writeln(content);document.writeln('</div>');}else
{document.writeln('<div id="'+name+'" style="position:absolute; overflow:hidden; left:'+left+'px; top:'+top+'px; width:'+width+'px; height:'+height+'px;'+' visibility:'+(visible?'visible;':'hidden;')+' '+theClass+'">');document.writeln(content);document.writeln('</div>');}}
else
{document.writeln('<div id="'+name+'" style="position:absolute; overflow:hidden; left:'+left+'px; top:'+top+'px; width:'+width+'px; height:'+height+'px;'+' visibility:'+(visible?'visible;':'hidden;')+' ">');document.writeln(content);document.writeln('</div>');}
clipLayer(name,0,0,width,height);}
function moveLayer(name,x,y){var thelayer=document.getElementById(name);if(thelayer!=null&&thelayer!=undefined){thelayer.style.left=x+"px";thelayer.style.top=y+"px";}}
function hideLayer(name){var theLayer=document.getElementById(name);if(theLayer!=null){theLayer.style.display="none";}}
function showLayer(name){var theLayer=document.getElementById(name);if(theLayer!=null)
{theLayer.style.display="block";}}
function button_to_over(theId)
{if(document.getElementsByName(theId)[0]!=undefined){if(document.getElementsByName(theId)[0].src.indexOf("disabled")>0)
{return;}
document.getElementsByName(theId)[0].src=document.getElementsByName(theId)[0].src.replace("-default","-over");}}
function button_from_over(theId)
{if(document.getElementsByName(theId)[0]!=undefined&&document.getElementsByName(theId)[0].src!=undefined){if(document.getElementsByName(theId)[0].src.indexOf("disabled")>0)
{return;}
document.getElementsByName(theId)[0].src=document.getElementsByName(theId)[0].src.replace("-over","-default");}}
function setMapCursorStyle(stil)
{map.div.style.cursor=stil;if(document.getElementById('theMeasureLayer'))
{document.getElementById('theMeasureLayer').style.cursor=stil;}}
function Quicklegend_click()
{if(document.getElementById('theQuickLegTable').style.visibility=="hidden")
{document.legendbutton.src="graphics/legend_1.gif"
showLayer('theQuickLegTable');}
else
{document.legendbutton.src="graphics/legend_0.gif"
hideLayer('theQuickLegTable');}}
function legendbutton_click(elem_id,ein_aus_buttonName)
{if(getLayer(elem_id).display=="none")
{document.getElementById(ein_aus_buttonName).src="pix/legend_1.gif";showLayer(elem_id);}
else
{document.getElementById(ein_aus_buttonName).src="pix/legend_0.gif";hideLayer(elem_id);}}
function clipLayer(name,clipleft,cliptop,clipright,clipbottom){var layer=document.getElementById(name);layer.style.clip='rect('+cliptop+'px '+clipright+'px '+clipbottom+'px '+clipleft+'px)';}
function alter_innerHTML(name,content){content=content.replace(/\'/g,"\'");document.getElementById(name).innerHTML=content;}
var popUpWin="";function openQueryPopup(wurl,wname){wname=window.open(wurl,wname,"resizable=yes,width=600,height="+400+",status=no,location=no,scrollbars=yes,toolbar=no");popUpWin=wname;popUpWin.focus();return popUpWin;}
function openPopup(wurl,wname,h,w){wname=window.open(wurl,wname,"resizable=yes,width="+w+",height="+h+",scrollbars=yes,status=no,location=no,toolbar=no; dependent");popUpWin=wname;popUpWin.focus();}
function showHelp()
{var myWin=window.open("hilfe.html","HelpWin","width=877,height=740,scrollbars=yes")
myWin.focus();}
function showExplaination()
{var myWin=window.open("extended_legend.html","LegendWin","width="+(map.getSize().w)+",height="+(map.getSize().h+50)+",scrollbars=yes")
myWin.focus();}
function overviewmap(img,maxm,minm,ovx,ovy,ovheight,ovwidth)
{this.picture=img;this.maxscale=maxm;this.minscale=minm;this.ovx=ovx;this.ovy=ovy;this.ovheight=ovheight;this.ovwidth=ovwidth;}
function check_overview(scale,center_x,center_y)
{for(i=0;i<theOverviews.length;i++)
{if(((scale<theOverviews[i].minscale)||(theOverviews[i].minscale==-99))&&(scale>theOverviews[i].maxscale)&&(within(center_x,center_y,theOverviews[i].ovx,theOverviews[i].ovy,theOverviews[i].ovheight,theOverviews[i].ovwidth,theOverviews[i].ovwidth*0.04)))
{if(document.getElementById("refmap").src!=theOverviews[i].picture)
{document.getElementById("refmap").src=theOverviews[i].picture;ov_x=theOverviews[i].ovx;ov_y=theOverviews[i].ovy;ovHeight=theOverviews[i].ovheight;ovWidth=theOverviews[i].ovwidth;}
return true;}}
if(document.getElementById("refmap").src!=theOverviews[0].picture)
{document.getElementById("refmap").src=theOverviews[0].picture;ov_x=theOverviews[0].ovx;ov_y=theOverviews[0].ovy;ovHeight=theOverviews[0].ovheight;ovWidth=theOverviews[0].ovwidth;}}
function within(center_x,center_y,box_x,box_y,box_height,box_width,tolerance)
{if(minx<box_x||maxy>(box_y+box_height)||maxx>box_x+box_width||miny<box_y)
{return false;}
else
{return true;}}
function baseLayerLoadStart()
{if(map.getResolution()<2&&mapLayer.indexOf("luftbilder")<0)
{mapsuitewms.params.FORMAT="image/png";}else{mapsuitewms.params.FORMAT="image/jpeg";}
loading=true;showLayer('loadLayer')}
function baseLayerLoadEnd()
{loading=false;hideLayer('loadLayer')}
function getMapXY(ev)
{var hasMoved=false;if(!ev)
{ev=window.event;}
if(imgX!=ev.xy.x||imgY!=ev.xy.y)
{hasMoved=true;lonLat=new OpenLayers.LonLat(0,0);lonLat=map.getLonLatFromPixel(ev.xy);mapX=lonLat.lon;mapY=lonLat.lat;imgX=ev.xy.x;imgY=ev.xy.y;}
if(use_tooltip)
{if(hasMoved)
{if(typeof TooltipTimer!='undefined')
{clearTimeout(TooltipTimer);}
if(!use_tooltip_as_link)
hideLayer("ToolTip");TooltipPixX=ev.clientX;TooltipPixY=ev.clientY;TooltipTimer=setTimeout("start_Tooltip()",600);}}}
function updateScalebar()
{if(map)
{theScale=map.getScale();updateScaleNumber(window);drawScalebar(theScale,window);}}
function updateRefMap()
{if(map)
{theScale=map.getScale();theBounds=map.getExtent();minx=theBounds.left;miny=theBounds.bottom;maxx=theBounds.right;maxy=theBounds.top;if(theOverviews.length>1)
{check_overview(theScale,(minx+maxx)/2,(miny+maxy)/2);}
if(typeof Root!='undefined')
{check_Layer_Scalerange(Root);}
drawRefMapMarker(minx,maxx,miny,maxy);}
if(typeof hideMeasure!='undefined')
hideMeasure();}
function deactivateButtons(id)
{theControls=map.controls;for(i=0;i<theControls.length;i++)
{if(theControls[i].active&&theControls[i].id.indexOf('oolbar')<0&&theControls[i].id.indexOf(id)<0)
{theControls[i].deactivate();}
if(theControls[i].active&&theControls[i].id.indexOf('oolbar')>=0)
{}}
for(i=0;i<theControls.length;i++)
{if(theControls[i].id.indexOf('oolbar')>=0)
{theControls[i].redraw();}}
if(document.getElementById('theMeasureLayer')&&document.getElementById('theMeasureLayer').style.visibility=='visible')
{hideMeasure();}}
function getOLLayer(theName)
{if(map&&map.layers)
{for(i=0;i<map.layers.length;i++)
{if(map.layers[i].name==theName)
{return map.layers[i];}}}
return false;}
function redrawOverlay(layername)
{if(getOLLayer(layername))
{checkIfNoLayers(getOLLayer(layername));var nocache_random=OpenLayers.Util.createUniqueID('noc');getOLLayer(layername).mergeNewParams({'noc':nocache_random})
getOLLayer(layername).redraw();return true;}else
{return false;}}
function checkIfNoLayers(theLayer)
{if(theLayer instanceof OpenLayers.Layer.WMS)
{theLayerObj=theLayer;}else if(theLayer.object instanceof OpenLayers.Layer.WMS)
{theLayerObj=theLayer.object;}else{return false;}
if(theLayerObj.params.LAYERS=='')
{theLayerObj.setVisibility(false);}else
{theLayerObj.setVisibility(true);}}
function zoomMapTo(xmin,ymin,xmax,ymax)
{map.zoomToExtent(new OpenLayers.Bounds(xmin,ymin,xmax,ymax));;}
function toggleBaseMap(layername,theStatus)
{if(getOLLayer(layername))
{getOLLayer(layername).setVisibility(theStatus);}}
function adjustTilecacheSource(theLayer)
{if(map.getResolution()<10)
{theLayer.object.params.LAYERS=TileCachePngLayer;}else
{theLayer.object.params.LAYERS=TileCacheJpegLayer;}}
var FotoPopupTimer;var FotoPreloadTimer;var FotoPreloadedImages=[];var tmpImg2=null;var fotoMarkerLayer;function Foto_addFotos()
{if(typeof OpenLayers=='undefined'||typeof map=='undefined')
return;var fotos=[["hw_fotos/1.jpg","hw_fotos/thumbs/1.jpg","Jan. 2003","Altstadt","Schiffsanleger","9,25 m",2356920.66,5644762.57],["hw_fotos/2.jpg","hw_fotos/thumbs/2.jpg","Jan. 2003","Zoobrücke","Blick von der Zoobrücke","9,60 m",2358070.78,5646542.90],["hw_fotos/3.jpg","hw_fotos/thumbs/3.jpg","Jan. 2003","Langel","Deich","9,50 m",2355341.35,5656402.16],["hw_fotos/4.jpg","hw_fotos/thumbs/4.jpg","Jan. 2003","Worringen","Deich","9,50 m",2351128.43,5659171.55],["hw_fotos/5.jpg","hw_fotos/thumbs/5.jpg","Jan. 2003","Worringen","Deich","9,50 m",2351128.43,5659171.55],["hw_fotos/6.jpg","hw_fotos/thumbs/6.jpg","Jan. 2003","Worringen","Deich","9,50 m",2350860.27,5659147.46],["hw_fotos/7.jpg","hw_fotos/thumbs/7.jpg","Jan. 2004","Rodenkirchen","Schiffsanleger","7,80 m",2358942.05,5640141.55],["hw_fotos/8.jpg","hw_fotos/thumbs/8.jpg","Jan. 2003","Flittard","Flittarder Aue","9,71 m",2357875.54,5650644.38],["hw_fotos/9.jpg","hw_fotos/thumbs/9.jpg","Jan. 2003","Poll","Deutzer Hafen","9,71 m",2357754.81,5643572.92],["hw_fotos/10.jpg","hw_fotos/thumbs/10.jpg","Jan. 2003","Mühlheim","Die Anrheiner","9,71 m",2359209.06,5647270.05],["hw_fotos/11.jpg","hw_fotos/thumbs/11.jpg","Jan. 2003","Mühlheim","Mülheimer Hafen","9,71 m",2358544.04,5646566.67],["hw_fotos/12.jpg","hw_fotos/thumbs/12.jpg","Jan. 2003","Mühlheim","Blick auf den Rheinpark und die Zoobrücke","9,71 m",2357551.08,5646041.73],["hw_fotos/13.jpg","hw_fotos/thumbs/13.jpg","Nov. 2002","Groov","Groov","7,20 m",2361504.00,5637050.57],["hw_fotos/14.jpg","hw_fotos/thumbs/14.jpg","Nov. 2002","Groov","Groov","7,20 m",2362162.92,5637235.91],["hw_fotos/15.jpg","hw_fotos/thumbs/15.jpg","Jan. 2004","Zündorf","Mobile Hochwasserschutzwand auf dem Zündorfer Marktplatz","7,95 m",2362292.65,5637153.59],["hw_fotos/16.jpg","hw_fotos/thumbs/16.jpg","Jan. 1995","Rodenkirchen","L-Wand auf der Hauptstrasse","10,60 m",2358995.36,5639956.48],["hw_fotos/17.jpg","hw_fotos/thumbs/17.jpg","Jan. 1995","Rodenkirchen","L-Wand im Auenweg","10,60 m",2359474.64,5639557.54],["hw_fotos/18.jpg","hw_fotos/thumbs/18.jpg","Jan. 2004","Zündorf","Mobile Hochwasserschutzwand auf dem Zündorfer Marktplatz","7,95 m",2362247.03,5637114.42],["hw_fotos/19.jpg","hw_fotos/thumbs/19.jpg","Jan. 2003","Altstadt","mobile Wand","9,50 m",2356866.32,5644877.86],["hw_fotos/20.jpg","hw_fotos/thumbs/20.jpg","Jan. 2004","Rodenkirchen","hohe Aqua Barrier (1,25m)","7,95 m",2359462.72,5639781.16],["hw_fotos/21.jpg","hw_fotos/thumbs/21.jpg","Jan. 2004","Rodenkirchen","Hubtor","7,60 m",2358951.35,5640124.16],["hw_fotos/22.jpg","hw_fotos/thumbs/22.jpg","Jan. 2004","Rodenkirchen","Verantwortliche","7,80 m",2359501.11,5639765.60],["hw_fotos/23.jpg","hw_fotos/thumbs/23.jpg","Jan. 2004","Rodenkirchen","Camping Berger","7,80 m",2361189.02,5639639.92],["hw_fotos/24.jpg","hw_fotos/thumbs/24.jpg","Jan. 2004","Rodenkirchen","","7,80 m",2359489.26,5639794.09],["hw_fotos/25.jpg","hw_fotos/thumbs/25.jpg","Jan. 2004","Rodenkirchen","","7,80 m",2359501.27,5639769.59],["hw_fotos/26.jpg","hw_fotos/thumbs/26.jpg","Jan. 2004","Rodenkirchen","","7,80 m",2359003.75,5640084.00],["hw_fotos/27.jpg","hw_fotos/thumbs/27.jpg","Jan. 2004","Westhoven","Der Leinpfad entlang des Rheinufers wird schon bei sehr niedrigen Hochwasserständen überflutet","7,80 m",2359508.04,5640329.66],["hw_fotos/28.jpg","hw_fotos/thumbs/28.jpg","Jan. 2004","Poll","Leinpfad auf Höhe der Rodenkirchener Brücke","7,80 m",2358761.89,5640829.29],["hw_fotos/29.jpg","hw_fotos/thumbs/29.jpg","Jan. 2004","Poll","Leinpfad","7,80 m",2358725.51,5640918.82],["hw_fotos/30.jpg","hw_fotos/thumbs/30.jpg","Jan. 2004","Riehl","","7,80 m",2358609.74,5647590.62],["hw_fotos/31.jpg","hw_fotos/thumbs/31.jpg","Jan. 2003","Poll","Der Weidenweg in Poll","9,71 m",2358761.76,5640924.35],["hw_fotos/32.jpg","hw_fotos/thumbs/32.jpg","Jan. 2003","Altstadt","Luftbild","9,71 m",2356864.90,5645138.08],["hw_fotos/33.jpg","hw_fotos/thumbs/33.jpg","Jan. 2003","Altstadt","mobile Hochwasserschutzwand in der Altstadt","9,40 m",2356900.99,5644746.36],["hw_fotos/34.jpg","hw_fotos/thumbs/34.jpg","Nov. 2002","Rheinufer","Spiegelung der Severinsbrücke auf den Poller Wiesen","6,30 m",2357437.09,5643756.95],["hw_fotos/35.jpg","hw_fotos/thumbs/35.jpg","Jan. 2003","Deutz","Kölnpanorama im Hochwasser gespiegelt","8,30 m",2357283.30,5644698.79],["hw_fotos/36.jpg","hw_fotos/thumbs/36.jpg","Jan. 2003","Kasselberg","Ab ca. 8,00m K.P. wird Kasselberg zur Insel","8,50 m",2355806.02,5656264.15],["hw_fotos/37.jpg","hw_fotos/thumbs/37.jpg","Jan. 2003","Kasselberg","Siedlung vor dem Deich","8,50 m",2355983.34,5656170.87],["hw_fotos/38.jpg","hw_fotos/thumbs/38.jpg","Jan. 2003","Auenviertel","Überspülte Aqua- Barrier im Auenviertel","9,71 m",2359585.45,5639748.16],["hw_fotos/39.jpg","hw_fotos/thumbs/39.jpg","Jan. 2003","Rodenkirchen","","9,71 m",2359709.32,5639620.04],["hw_fotos/40.jpg","hw_fotos/thumbs/40.jpg","Jan. 2003","Rodenkirchen","Hochwasserzeit ist meistens im Winter","7,50 m",2359337.13,5639842.31],["hw_fotos/41.jpg","hw_fotos/thumbs/41.jpg","Jan. 2003","Rodenkirchen","","7,50 m",2359346.79,5639833.91],["hw_fotos/42.jpg","hw_fotos/thumbs/42.jpg","Jan. 2003","Rodenkirchen","Überflutete Campingplätze","9,71 m",2360933.04,5639693.36],["hw_fotos/43.jpg","hw_fotos/thumbs/43.jpg","Jan. 2003","Poll","Westhovener Aue","9,71  m",2359333.42,5640932.12],["hw_fotos/E2360578_N5639587_.JPG","hw_fotos/thumbs/E2360578_N5639587_.JPG","16. Jan. 2011","Rodenkirchen","Höhe Campingplatz","8,68 m",2360578,5639587],["hw_fotos/E2359417_N5634682.JPG","hw_fotos/thumbs/E2359417_N5634682.JPG","Jan. 2011","Langel","Frohnhofstrasse","8,70 m",2359417,5634682],["hw_fotos/E2359280_N5647477.JPG","hw_fotos/thumbs/E2359280_N5647477.JPG","10. Jan. 2011","Mülheim","","8,87 m",2359280,5647477],["hw_fotos/E2350350_N5659594.JPG","hw_fotos/thumbs/E2350350_N5659594.JPG","11. Jan. 2011","Worringen","","8,63 m",2350350,5659594],["hw_fotos/E2355821_N5656272.JPG","hw_fotos/thumbs/E2355821_N5656272.JPG","15. Jan. 2011","Kasselberg","","8,61 m",2355821,5656272]];fotoMarkerLayer=new OpenLayers.Layer.Markers("Fotos");map.addLayer(fotoMarkerLayer);document.getElementById(fotoMarkerLayer.div.id).style.cursor='pointer';var icon=new OpenLayers.Icon("graphics/photo2.png",new OpenLayers.Size(16,12),new OpenLayers.Pixel(10,2));var FotoMarkers=[]
for(var i=0;i<fotos.length;i++)
{FotoMarkers[i]=new OpenLayers.Marker(new OpenLayers.LonLat(fotos[i][6],fotos[i][7]),icon.clone());FotoMarkers[i].theFoto=fotos[i][0];FotoMarkers[i].theThumb=fotos[i][1];FotoMarkers[i].theDate=fotos[i][2];FotoMarkers[i].theLocation=fotos[i][3];FotoMarkers[i].theName=fotos[i][4];FotoMarkers[i].theHeight=fotos[i][5];fotoMarkerLayer.addMarker(FotoMarkers[i]);FotoMarkers[i].events.register('mouseover',FotoMarkers[i],function(e){TooltipMarker=this;TooltipPixX=e.clientX;TooltipPixY=e.clientY;FotoPopupTimer=window.setTimeout("if (typeof TooltipTimer != 'undefined') { clearTimeout(TooltipTimer) }; Foto_displayFoto(TooltipMarker, TooltipPixX, TooltipPixY);",500);FotoPreloadTimer=window.setTimeout("if ($.inArray('"+this.theThumb+"', FotoPreloadedImages) < 0)  { var tmpImg = new Image(); tmpImg.src = '"+this.theThumb+"'; FotoPreloadedImages.push('"+this.theThumb+"');}",250);});FotoMarkers[i].events.register('mouseout',FotoMarkers[i],function(e){window.clearTimeout(FotoPopupTimer);window.clearTimeout(FotoPreloadTimer);});}}
function Foto_displayFoto(theMarker,clientX,clientY)
{window.clearTimeout(TooltipTimer);var theHeight=140;var theWidth=document.getElementById("FotoPopup").offsetWidth;TooltipMapX=mapX;TooltipMapY=mapY;hideLayer("FotoPopup");document.getElementById('FotoPopup_THUMB').src='';document.getElementById('FotoPopup_THUMB').src=theMarker.theThumb;document.getElementById('FotoPopup_NAME').innerHTML=theMarker.theName;document.getElementById('FotoPopup_DATUM').innerHTML=theMarker.theDate;document.getElementById('FotoPopup_ORT').innerHTML=theMarker.theLocation;document.getElementById('FotoPopup_PEGEL').innerHTML=theMarker.theHeight;var newLeft=clientX-16;var newTop=clientY-theHeight*2/3;var newPos=positionTooltip(newLeft,newTop,clientX,clientY,theWidth,theHeight);moveLayer("FotoPopup",newPos[0],newPos[1]);FotoPopupTimer=window.setTimeout('showLayer("FotoPopup"); tmpImg2 = null; tmpImg2 = new Image(); tmpImg2.src = "'+theMarker.theFoto+'";',500);}
function FotoEnlarge(src)
{hideLayer('FotoPopup');if(tmpImg2.width<map.getSize().w&&tmpImg2.height<map.getSize().h)
{document.getElementById('FotoEnlargedImg').width=tmpImg2.width;document.getElementById('FotoEnlargedImg').height=tmpImg2.height;}else{var ratio=tmpImg2.width/tmpImg2.height;if(tmpImg2.width/map.getSize().w>tmpImg2.height/map.getSize().height)
{document.getElementById('FotoEnlargedImg').width=map.getSize().w;document.getElementById('FotoEnlargedImg').height=map.getSize().w/ratio;}else{document.getElementById('FotoEnlargedImg').width=map.getSize().h*ratio;document.getElementById('FotoEnlargedImg').height=map.getSize().h;}}
document.getElementById('FotoEnlargedImg').src=src.replace('/thumbs','');$('#FotoEnlarged').dialog('open');}
function printMap()
{var printWin=window.open("print.html","PrintWin",'location=no,width=630,height=900');printWin.focus();}
function buildLayerString()
{var splitter=',';var mapLayerNew='';var backLayer=document.getElementsByName('map_Hintergrund');for(var i=0;i<backLayer.length;i++)
{if(backLayer[i].checked)
mapLayerNew+=backLayer[i].value;}
mapLayerNew+=splitter;var szenario=document.getElementById("szenario").options[document.getElementById("szenario").selectedIndex].value.replace(",","").replace("m","");if(!document.getElementById('LayercontrolRestRisiko')||document.getElementById('LayercontrolRestRisiko').checked)
{mapLayerNew+="rr"+szenario+"s"+splitter;}
mapLayerNew+="hw"+szenario;if(document.getElementById("szenario_schutz")&&document.getElementById("szenario_schutz").value=="ohneSchutz")
{mapLayerNew=mapLayerNew+"o";}else
{mapLayerNew=mapLayerNew+"s";}
if(szenario<1070)
szenario=1070;mapLayerNew+=splitter;mapLayerNew+="schutz_bestand_"+szenario;if(szenario==1190)
{if(document.getElementById('mapGroundwater').disabled)
document.getElementById('mapGroundwater').disabled=false;document.getElementById('GroundwaterCheckboxLabel').style.color='#666666';if(document.getElementById('mapGroundwater').checked)
{mapLayerNew+=splitter;mapLayerNew+='grundwassererase'}}else{document.getElementById('mapGroundwater').disabled=true;document.getElementById('GroundwaterCheckboxLabel').style.color='#999999';}
if(mapLayerNew!=mapLayer)
{mapLayer=mapLayerNew;if(typeof map!='undefined')
getOLLayer('mapsuite WMS').params.LAYERS=mapLayer;redrawOverlay('mapsuite WMS');}
return true;}
