var massstab2=1,path2="http://www.gaia-mv.de/gaialight/",path1=path2+"img/",fadeSpeed=30,wheelFactor=1.25,wheelPause=500,check0=new Image(14,16),check1=new Image(14,16),check3=new Image(14,16),pixel_img=new Image(),b=new Browser(),dragObj={},_store=[];check0.src=path1+"check0.gif";check1.src=path1+"check1.gif";check3.src=path1+"check3.gif";pixel_img.src=path1+"pixel.gif";dragObj.zIndex=0;function dcE(a){return document.createElement(a)}function Offset(i,j){if(!i&&this){i=this}var h=document.all?true:false,g=(j=="l"?i.offsetLeft:i.offsetTop),f=i.offsetParent,a=0,d=0,c=0;while(f!=null){if(h){if((f.tagName!="TABLE")&&(f.tagName!="BODY")){g+=(j=="l"?f.clientLeft:f.clientTop)}}else{if(f.tagName=="TABLE"){a=parseInt(f.border);if(isNaN(a)){d=f.getAttribute("frame");if(d!=null){g+=1}}else{if(a>0){g+=a}}}if(f.tagName=="DIV"){c=parseInt(f.style.border);if(c>0){g+=c}}}g+=(j=="l"?f.offsetLeft:f.offsetTop);f=f.offsetParent}return g}function Browser(){this.isIE=false;this.isNS=false;this.isOP=false;this.name=navigator.appName;this.version=null;this.quirks=document.compatMode=="BackCompat";if((navigator.userAgent).indexOf("Opera")!=-1){this.isOP=true}else{if(navigator.appName=="Netscape"){this.isNS=true}else{if(navigator.appName.indexOf("Microsoft")!=-1){this.isIE=true;this.version=parseFloat(navigator.userAgent.replace(/^.*?MSIE (\d+\.\d+).*?$/,"$1"))}}}return}function add_event(d,c,a){if(d.addEventListener){d.addEventListener(c,a,false)}else{if(d.attachEvent){c="on"+c;d.attachEvent(c,a)}else{d[c]=a}}}function del_event(e,d,c,a){if(e.removeEventListener){e.removeEventListener(d,c,a)}if(e.detachEvent){e.detachEvent(d,c);e.detachEvent("on"+d,c)}}function setPos(d,c,a){d.style.left=c+"px";d.style.top=a+"px";d.style.display=""}function setAlphaPNG(c,a){c.src=a;c.behavior="url("+path2+"iepngfix.htc)"}function fade(a,g,c,f,d,e){if(g&&a&&a.style){if(!e){e=(new Date()).getTime()}if(!c){c=fadeSpeed}if(!d){d=(g>0)?0:1}d+=g*0.1;if(((new Date()).getTime()-e)>(12*c)){d=(g>0)?1:0}if(d<0.995&&d>0.05){setOpacity(a,d);setTimeout(function(){fade(a,g,c,f,d,e)},c)}else{setOpacity(a,Math.round(d));if(f&&typeof f==="function"){f()}}}}function setOpacity(a,c){if(a&&a.style){a.style.opacity=String(c);a.style.filter="alpha(opacity="+String(Math.round(c*100))+")"}return a}function setZindex(a,c){a.style.zIndex=c}function glMap(n){var V=this,v=n,A=dcE("div"),P,Z,aa=0,m=0,L=null,X="standard",N,Q,U=null,w=false,R=null,k,q,E,K,G=null,h=null,e=null,B=null,t,s,T,u,I,W,f=dcE("img"),c=dcE("img"),a=dcE("div"),O=dcE("img"),M=dcE("div"),l=dcE("div"),r=dcE("div"),Y=dcE("div"),j=null,J=null,p=path1+"loading.gif",C=500,S="",z="",g=[],x=[],y=0,F=function(i,ab){return i},H=null;this.load=function(ab,i,ac){load(ab,i,ac)};this.getTagMain=function(){return v};this.getTagMap=function(){return f};this.getTagEvent=function(){return Y};this.getToolbar=function(){return J};this.setMaxScale=function(i){C=i};if(b.isIE){A.onselectstart=function(){return false};A.ondrag=function(){return false}}else{A.style.setProperty("-moz-user-select","none","")}this.setStyle=function(i){S=i};this.getStyle=function(){return S};this.setOptions=function(i){z=i};this.getOptions=function(){return z};this.setLabel=function(i){Q=i};this.setLayerControl=function(i){F=i};this.createLayer=function(ad,af,ac,ae,ab){var i=[];i[0]=ad;i[1]=(af?af:"");i[2]=(ac&&ac!=-1?ac:0);i[3]=(ae&&ae!=-1?ae:Number.MAX_VALUE);i[4]=(typeof ab=="function"?ab:(ab==null||ab==1?true:false));return i};this.addInfoLayer=function(ac,ag,ab,ad,i,af,ae){V.load(path2+"gl.json.js?layers="+ac+(z?"&options="+z:""),function(aj,ai){if(typeof aj=="object"&&aj.type=="FeatureCollection"){try{var ah=V.createLayer(ai[0],ai[1],ai[2],ai[3],ai[4]);ah[6]=aj;V.createInfoLayer(ah,ai[5],ai[6],ai[7])}catch(ak){return ak}}},[ac,ag,ab,ad,i,af,ae,++y])};this.createInfoLayer=function(ab,ae,ad,ag){var ac=parseInt(M.style.zIndex),i,af;if(!ac){ac=0}for(af in ab[6].members){i=ab[6].members[af];if(!i.properties||!i.geometry){continue}if(i.properties.image){i.IMG=dcE("img");i.IMG.title=unescape(i.properties.info);i.IMG.alt=i.IMG.title;i.IMG.onmousedown=function(){return false};i.IMG.oncontextmenu=function(){return false};i.IMG.PARENT=i;i.click=function(){return(ad?ad(null,this):false)};i.IMG.onclick=function(ah){return(ad?ad(ah,this.PARENT):false)};i.IMG.style.position="absolute";setZindex(i.IMG,ac+ag);i.active=function(){return this.REPORT!=null};if(!document.all){i.IMG.style.cursor=(ae?ae:"pointer")}else{i.IMG.style.cursor=(ae?ae:"hand")}setAlphaPNG(i.IMG,path1+i.properties.image);l.appendChild(i.IMG)}i.setInfo=function(al,ah,ak){if(!al){if(this.REPORT){try{V.getInfoTag().removeChild(this.REPORT)}catch(aj){}}delete this.REPORT}else{this.REPORT=dcE("div");var ai=this.REPORT;ai.oncontextmenu=function(){return false};ai.style.position="absolute";this.REPORTX=(ah?ah:0);this.REPORTY=(ak?ak:0);if(typeof al=="string"){ai.innerHTML=al}else{ai.appendChild(al)}V.redrawInfo();if(!(b.isIE&&(b.version<9))){fade(ai,1,fadeSpeed,function(){if(ai&&ai.style.filter){ai.style.filter=""}})}}}}x.push(ab);V.redrawInfo()};this.redrawInfo=function(){var ac,ae,ab,i,ad;for(ac=0;ac<x.length;ac++){for(ae in x[ac][6].members){ab=x[ac][6].members[ae];if(!ab.properties||!ab.geometry){continue}i=V.xReal2pixel(ab.geometry.coordinates[0]);ad=V.yReal2pixel(ab.geometry.coordinates[1]);if(ab.IMG&&(x[ac][4]===true||(typeof x[ac][4]=="function"&&x[ac][4](x[ac][0])))&&x[ac][2]<=massstab2&&x[ac][3]>=massstab2){ab.IMG.style.display="";ab.IMG.style.left=Math.round(i-(parseInt(ab.IMG.offsetWidth)/2))+"px";ab.IMG.style.top=Math.round(ad-(parseInt(ab.IMG.offsetHeight)/2))+"px"}else{if(ab.IMG){ab.IMG.style.display="none"}}if(ab.REPORT&&i>0&&i<P-40&&ad>0&&ad<Z){V.getInfoTag().appendChild(ab.REPORT);ab.REPORT.style.left=Math.round(i+ab.REPORTX)+"px";ab.REPORT.style.top=Math.round(ad-parseInt(ab.REPORT.offsetHeight)+ab.REPORTY)+"px"}}}};this.addLayer=function(ad,ah,ac,ae,ab){g.push(V.createLayer(ad,ah,ac,ae,ab));if(R!=null&&ah){var ag=dcE("div"),i=dcE("img"),af=dcE("span");ag.style.margin="10px";i.id="glayer_"+ad;i.src=path1+"check0.gif";i.onclick=function(){V.setLayer(ad,this.src0==path1+"check0.gif")};i.width="14";i.height="16";i.style.cursor="hand";ag.appendChild(i);af.style.paddingLeft="1ex";af.innerHTML=ah;ag.appendChild(af);document.getElementById("_layerList").appendChild(ag)}this.setLayerVisible()};this.setLayer=function(i,ac){ac=(ac==1||ac===true?true:false);var ab;for(ab=0;ab<g.length;ab++){if(g[ab][0]==i){if(typeof g[ab][4]=="function"){g[ab][4](i,(ac?1:-1))}else{g[ab][4]=ac}}}for(ab=0;ab<x.length;ab++){if(x[ab][0]==i){if(typeof x[ab][4]=="function"){x[ab][4](x[ab][0],(ac?1:-1))}else{x[ab][4]=ac}}}this.redraw();this.redrawInfo()};this.setLayers=function(ac){var i=ac.split(" "),ab;for(ab=0;ab<i.length;ab++){this.addLayer(i[ab])}};this.setLayerVisible=function(){var i;for(i=0;i<g.length;i++){if(typeof g[i][4]=="function"){if(g[i][4](g[i][0])==false){g[i][4](g[i][0],-1)}else{if(g[i][2]<=massstab2&&g[i][3]>=massstab2){g[i][4](g[i][0],1)}else{g[i][4](g[i][0],0)}}}}};this.getVisibleLayers=function(){var i=[],ab;for(ab=0;ab<g.length;ab++){if((g[ab][4]===true||(typeof g[ab][4]=="function"&&g[ab][4](g[ab][0])))&&g[ab][2]<=massstab2&&g[ab][3]>=massstab2){i.push(g[ab][0])}}return F(i,massstab2)};this.getVisibleLayersAsList=function(){return V.getVisibleLayers().join(",")};this.getCheckedLayersAsList=function(){var i=[],ab;for(ab=0;ab<g.length;ab++){if(g[ab][4]===true||(typeof g[ab][4]=="function"&&g[ab][4](g[ab][0]))){i.push(g[ab][0])}}return i.join(",")};this.getLayersAsList=function(){return g.join(",")};this.getInfoObjects=function(i){for(var ab in x){if(x[ab][0]==i){return x[ab][6]}}};this.getMainTag=function(){return A};this.getInfoTag=function(){return r};this.hideInfo=function(){while(r.hasChildNodes()){r.removeChild(r.childNodes[0])}};this.clearInfo=function(){var i,ab;for(i=0;i<x.length;i++){for(ab in x[i][6].members){delete x[i][6].members[ab].REPORT}}V.hideInfo()};V.wait=function(i){O.style.display=(i?"":"none")};this.isPointInMap=function(ac,ab,ad,i){if((ac>(h+V.wPixel2real(aa)))||((ac+ad)<(G-V.wPixel2real(aa)))){return false}if(((ab-i)>(B+V.hPixel2real(m)))||((ab+i-i)<(e-V.hPixel2real(m)))){return false}return true};this.setBorder=function(i){aa=i;m=i;f.style.width=(V.width()+aa+aa)+"px";f.style.height=(V.height()+m+m)+"px";f.style.top=(-aa)+"px";f.style.left=(-m)+"px";c.style.width=f.style.width;c.style.height=f.style.height;c.style.top=f.style.top;c.style.left=f.style.left};this.getBorder=function(){return aa};this.width=function(){return P};this.height=function(){return Z};this.control=function(){return X};this.setArgs=function(i){N=i};this.enableContext=function(i){w=i};this.getLayerBox=function(){return R};this.addLayerButton=function(){if(R==null){R=dcE("div");R.id="_layerList";setZindex(R,"99");R.style.position="absolute";R.style.fontFamily="Verdana, Arial, Helvetica, sans-serif";R.style.fontSize="10pt";R.style.borderLeft="1px solid black";R.style.borderRight="1px solid black";R.style.borderTop="1px solid black";R.style.background="#EEEEEE";R.style.opacity="0.93";R.style.filter="alpha(opacity=93)";R.style.display="none";R.style.padding="0px";R.style.margin="0px";R.oncontextmenu=function(){return false};R.toggle=function(){if(R.style.display==""){R.style.display="none"}else{R.style.display=""}};R.hide=function(){R.style.display="none"};var i=new glTool("Layerverwaltung",path1+"layer0.png",path1+"layer1.png","bottom",function(){R.toggle()}),ab=dcE("div");ab.id="titel";ab.name="titel";ab.style.margin="10px";ab.style.textAlign="left";ab.innerHTML="<b>Layer an-/ausschalten</b>";R.appendChild(ab);A.appendChild(R);V.getToolbar().addMapTool(i)}};this.setReferenceMap=function(ae){if(ae&&ae.tagName&&ae.tagName=="DIV"){var ab=dcE("img"),i=parseInt(ae.style.width),ac=parseInt(ae.style.height),ad=dcE("div");ab.width=i;ab.height=ac;ab.src=path2+"gl.jpg?extent="+k+","+q+","+E+"&width="+i+"&height="+ac+"&layers=mv,lkref&options=noscalebar"+(L?"&dpi="+L:"")+(b.isOP?"&"+Math.random():"");ad.oncontextmenu=function(){return false};ad.style.display="none";ad.style.position="absolute";ad.style.margin="0";ad.style.padding="0";ad.style.lineHeight="0";ad.style.border="2px solid #ff0000";ad.style.background="#ffffff";ad.style.opacity="0.5";ad.style.filter="alpha(opacity=50)";ad.style.fontSize="1";ae.appendChild(ab);ae.appendChild(ad);ae.style.overflow="hidden";ae.onmousedown=function(ai){var aj=(b.isNS?ai.clientX+window.scrollX:window.event.clientX+document.documentElement.scrollLeft+document.body.scrollLeft)-Offset(this,"l"),ah=(b.isNS?ai.clientY+window.scrollY:window.event.clientY+document.documentElement.scrollTop+document.body.scrollTop)-Offset(this,"t"),al=4400000+aj*1325,ak=6067076-ah*1305,ao=(h-G)/2,an=(B-e)/2,af=al-ao,ag=al+ao,am=ak-an;V.setExtent(af,ag,am);V.redraw()};U=ae;j=ad}};this.setReferenceBox=function(af,ak,ab,ag){if(j!=null&&U!=null){var ac=Math.round(parseInt(U.style.width)*(af-k)/(q-k)),i=Math.round(parseInt(U.style.height)*(K-ab)/(K-E)),ai=Math.round(parseInt(U.style.width)*(ak-k)/(q-k)),ae=Math.round(parseInt(U.style.height)*(K-ag)/(K-E)),aj=ai-ac,ad=i-ae,ah=2*parseInt(j.style.borderWidth);j.style.left=ac+"px";j.style.top=ae+"px";if(aj-ah>=0){aj=aj-ah}if(ad-ah>=0){ad=ad-ah}j.style.width=aj+"px";j.style.height=ad+"px";j.style.display=""}};this.addOverviewButton=function(i){if(U==null){var ac=dcE("div"),ab;ac.style.width="200px";ac.style.height="145px";ac.oncontextmenu=function(){return false};setZindex(ac,"100");A.appendChild(ac);ac.oncontextmenu=function(){return false};ac.toggle=function(){if(ac.style.display==""){ac.style.display="none"}else{ac.style.display=""}};ac.hide=function(){ac.style.display="none"};ac.style.position="absolute";ac.style.width="200px";ac.style.height="145px";ac.style.left=(parseInt(P)-parseInt(ac.style.width)-40)+"px";ac.style.bottom="0px";ac.style.border="1px solid black";ac.style.margin="0px";ac.style.padding="0px";ac.style.background="#FFFFFF";ac.style.lineHeight="0";ac.style.display=(i?"":"none");ab=new glTool("\u00dcbersichtskarte",path1+"ref0.png",path1+"ref1.png","bottom",function(){ac.toggle()});V.getToolbar().addMapTool(ab);V.setReferenceMap(ac)}};this.xReal2pixel=function(i){return Math.round(P*(i-G)/(h-G))};this.yReal2pixel=function(i){return Math.round(Z*(B-i)/(B-e))};this.wPixel2real=function(i){return(i*I)};this.hPixel2real=function(i){return(i*W)};this.xPixel2Real=function(i){return V.wPixel2real(i)+G};this.yPixel2Real=function(i){return V.hPixel2real(Z-i)+e};this.getExtent=function(){return Math.round(G)+","+Math.round(h)+","+Math.round(e)+","+Math.round(B)};this.setExtent=function(ac,i,ab){ac=parseFloat(ac);i=parseFloat(i);ab=parseFloat(ab);G=ac;h=i;e=ab;B=((Z/P)*(h-G))+e;V.limitScale()};this.setFullExtent=function(ac,i,ab){k=ac;q=i;E=ab;K=((Z/P)*(q-k))+E;V.fullExtentNoRedraw()};this.setZoomboxFirst=function(i,ab){t=i;s=ab};this.setZoomboxWH=function(i,ab){T=i;u=ab;a.style.left=Math.min(t,T)+"px";a.style.top=Math.min(s,u)+"px";a.style.width=Math.max(T,t)-Math.min(T,t)+"px";a.style.height=Math.max(u,s)-Math.min(u,s)+"px";a.style.display=""};this.zoomboxExtent=function(ac){a.style.display="none";if((ac||(massstab2>C))&&T!==null&&u!==null&&t!==null&&s!==null){var ad=Math.min(T,t),i=Math.max(T,t),ae=Math.max(u,s),ab=Math.min(u,s);G+=ad*I;h-=(P-i)*I;B-=ab*W;e+=(Z-ae)*W;if(ac){this.limitScale()}V.redraw();T=null;u=null;t=null;s=null}};this.recalc_pixel_size=function(){I=(h-G)/P;W=(B-e)/Z};this.limitScale=function(){var ad=h-G,ac=B-e,ae=((ad/ac>1)?(ad/((P/L)*0.0254)):(ac/((Z/L)*0.0254))),ab,i;ae=Math.round(ae);if(ae<C){ae=C;ab=G+ad/2;i=e+ac/2;ad=ae*((P/L)*0.0254);ac=ae*((Z/L)*0.0254);G=ab-ad/2;e=i-ac/2;h=ad+G;B=ac+e}massstab2=ae};this.getScale=function(){return massstab2};this.redraw=function(){V.hideInfo();V.limitScale();V.setLayerVisible();V.wait(true);V.recalc_map_size();c.src=V.get_map_url();this.setReferenceBox(G,h,e,B)};this.fullExtentNoRedraw=function(){G=k;h=q;e=E;B=K;V.limitScale()};this.fullExtent=function(ac,ad,ab,i){V.fullExtentNoRedraw();V.redraw()};this.setActionZoombox=function(ac,ad,ab,i){f.style.cursor="crosshair"};this.setActionPan=function(ac,ad,ab,i){f.style.cursor="move"};this.setActionNone=function(){V.hideInfo();if(J!=null){J.hide()}f.style.cursor=""};this.setActionZoomIn=function(ac,ad,ab,i){if(isNaN(O.style.display)){if(massstab2>C){V.zoomPerc(1.4,0);V.redraw()}}};this.setActionZoomOut=function(ac,ad,ab,i){if(isNaN(O.style.display)){V.zoomPerc(0.3,1);V.redraw()}};this.switchLayer=function(ac,ad,ab,i){if(V.getStyle()!="grau"){V.setStyle("grau")}else{V.setStyle("")}V.redraw()};this.zoomPerc=function(i,ag){var af=h-G,ac=af*i,ad=(ac-af)/2,ae=B-e,ah=ae*i,ab=(ah-ae)/2;if(massstab2<C&&ag==1){ad=-600;ab=-420}V.setExtent(G+ad,h-ad,e+ab)};this.mapLoaded=function(){var i=f;f=c;c=i,mIndex=f.style.zIndex,mbIndex=c.style.zIndex;if(!mIndex){mIndex=0}if(!mbIndex){mbIndex=mIndex}f.style.zIndex="0";c.style.zIndex="-1";f.style.cursor=c.style.cursor;f.style.left=(-aa)+"px";f.style.top=(-m)+"px";f.style.width=String(P+(2*aa))+"px";f.style.height=String(Z+(2*m))+"px";fade(f,1,fadeSpeed,function(){c.style.display="none";setZindex(f,mIndex);setZindex(c,mbIndex)});f.style.display="";M.style.left="0";M.style.top="0";V.redrawInfo();V.wait(false)};this.get_map_url=function(){var ab="mapsize="+(P+aa+aa)+"+"+(Z+m+m),ac="mapext="+(G-V.wPixel2real(aa))+"+"+(e-V.hPixel2real(m))+"+"+(h+V.wPixel2real(aa))+"+"+(B+V.hPixel2real(m)),ae=V.getVisibleLayers(),ad="",i;for(i in ae){ad=ad+encodeURIComponent(ae[i])+","}return path2+"gl.jpg?"+ac+(S?"&style="+S:"")+(z?"&options="+z:"")+(Q?"&label="+Q:"")+"&"+ab+"&layers="+ad+(N?"&"+N:"")+(L?"&dpi="+L:"")+(b.isOP?"&"+Math.random():"")};this.setPan=function(ab,ad){V.recalc_pixel_size();var i=ab*I,ac=ad*W;G=G-i;h=h-i;e=e+ac;B=B+ac;V.redraw()};this.recalc_map_size=function(){V.recalc_pixel_size();var ab,i;if(I>W){ab=((B-e)/2)+e;i=(Z/P)*(h-G);e=ab-(i/2);B=ab+(i/2)}else{ab=((h-G)/2)+G;i=(P/Z)*(B-e);G=ab-(i/2);h=ab+(i/2)}V.recalc_pixel_size()};this.init=function(){var ae=v.style,ad,ab=parseInt(ae.paddingLeft),af=parseInt(ae.paddingRight),ac=parseInt(ae.paddingTop),i=parseInt(ae.paddingBottom);if(isNaN(ab)){ab=0}if(isNaN(af)){af=0}if(isNaN(ac)){ac=0}if(isNaN(i)){i=0}v.className="gl";while(v.hasChildNodes()){v.removeChild(v.firstChild)}A.id="_tagMain";A.className="glMain";A.style.width=String(parseInt(ae.width)-((b.isIE&&b.quirks)?ab+af:2))+"px";A.style.height=String(parseInt(ae.height)-((b.isIE&&b.quirks)?ac+i:2))+"px";A.style.position="absolute";P=parseInt(A.style.width);Z=parseInt(A.style.height);v.style.position="relative";v.appendChild(A);A.oncontextmenu=function(){return w};A.style.width=V.width()+"px";A.style.height=V.height()+"px";A.style.overflow="hidden";A.style.position="absolute";if(!L){ad=dcE("div");ad.style.width="1in";ad.style.height="1in";ad.style.position="absolute";ad.style.padding="0px";ad.style.overflow="hidden";A.appendChild(ad);L=ad.offsetWidth;if(L==0){L=96}A.removeChild(ad)}Y.oncontextmenu=function(){return w};Y.style.position="absolute";Y.left="0";Y.top="0";f.objRef=V;f.oncontextmenu=function(){return w};f.onmousedown=function(){return false};add_event(f,"load",V.mapLoaded);f.galleryImg="no";f.style.width=(V.width()+aa+aa)+"px";f.style.height=(V.height()+m+m)+"px";f.style.border="0 none";f.style.margin="0";f.style.padding="0";f.style.position="absolute";f.style.top=(-aa)+"px";f.style.left=(-m)+"px";f.style.opacity="1.0";f.style.filter="alpha(opacity=100)";f.style.display="none";c.objRef=f.objRef;c.oncontextmenu=f.oncontextmenu;c.onmousedown=f.onmousedown;add_event(c,"load",V.mapLoaded);c.galleryImg="no";c.style.width=f.style.width;c.style.height=f.style.height;c.style.border=f.style.border;c.style.margin=f.style.margin;c.style.padding=f.style.padding;c.style.position=f.style.position;c.style.top=f.style.top;c.style.left=f.style.left;c.style.opacity="1.0";c.style.filter="alpha(opacity=100)";c.style.display="none";a.oncontextmenu=function(){return false};a.style.position="absolute";a.style.display="none";a.style.border="2px dashed #ff0000";a.style.margin="0px";a.style.padding="0px";a.style.lineHeight="0";a.style.background="#f0f0f0";a.style.opacity="0.50";a.style.filter="alpha(opacity=50)";a.style.fontSize="1";M.oncontextmenu=function(){return false};M.style.position="absolute";l.oncontextmenu=function(){return false};l.style.position="absolute";r.oncontextmenu=function(){return true};r.style.position="absolute";O.oncontextmenu=function(){return false};O.onmousedown=function(){return false};O.style.position="absolute";O.style.display="none";O.style.border="0";O.style.margin="0";O.style.padding="0";O.style.lineHeight="0";O.style.width="auto";O.style.height="auto";setAlphaPNG(O,p);O.style.left=(P-80)/2+"px";O.style.top=(Z-80)/2+"px";setZindex(r,"20");setZindex(A,"10");setZindex(a,"150");setZindex(O,"100");setZindex(M,"50");setZindex(Y,"0");v.appendChild(r);Y.appendChild(f);Y.appendChild(c);M.appendChild(l);A.appendChild(a);A.appendChild(M);A.appendChild(Y);if(X!=null){J=new glToolbar(V,X,true);A.appendChild(J.getTag())}if(b.isNS&&A.addEventListener){A.addEventListener("DOMMouseScroll",o,false)}else{A.onmousewheel=document.onmousewheel=o}A.appendChild(O)};function D(){var i=[-parseFloat(f.style.left),-parseFloat(f.style.top)],ab=parseFloat(f.style.width)/(P+(2*aa));V.recalc_pixel_size();t=(i[0]/ab)-aa;s=(i[1]/ab)-m;T=((i[0]+P)/ab)-aa;u=((i[1]+Z)/ab)-m;V.zoomboxExtent(true);V.redrawInfo();fade(M,1,fadeSpeed,function(){if(M.style.filter){M.style.filter=""}});fade(r,1,fadeSpeed,function(){if(r.style.filter){r.style.filter=""}});H=null}function d(ac,ae){var i,ad=[V.getClick_X(ac)+aa,V.getClick_Y(ac)+m],ab=Math.pow(wheelFactor,Math.abs(ae));if(ad[0]<0||ad[0]>parseFloat(f.style.width)||ad[1]<0||ad[1]>parseFloat(f.style.height)){return false}if(H){clearTimeout(H);H=null}H=setTimeout(D,wheelPause);if(ae<0){ab=1/ab}f.style.width=String(parseFloat(f.style.width)*ab)+"px";f.style.height=String(parseFloat(f.style.height)*ab)+"px";i=[ad[0]-(ad[0]*ab),ad[1]-(ad[1]*ab)];f.style.left=String(parseFloat(f.style.left)+i[0])+"px";f.style.top=String(parseFloat(f.style.top)+i[1])+"px";return ae}function o(i){if(!i){i=window.event}var ab=0;if((typeof i==="object")&&!(i.shiftKey||i.altKey||i.ctrlKey)){if(isNaN(O.style.display)&&(typeof t==="undefined"||t===null)&&((!dragObj)||(typeof dragObj.cursorStartX==="undefined"||dragObj.cursorStartX===null))){V.hideInfo();setOpacity(M,0);if(i.wheelDelta){ab=i.wheelDelta/120;if(this.isOP){ab=-ab}}else{if(i.detail){ab=-i.detail/3}}if(ab){if(d(i,ab)!==false){if(typeof i==="object"){if(typeof i.preventDefault==="function"){i.preventDefault()}i.cancelBubble=true;i.returnValue=false}}}}}}this.getClick_X=function(ab){var i;if(b.isNS){i=ab.clientX+window.scrollX}else{i=window.event.clientX+document.documentElement.scrollLeft+document.body.scrollLeft}return i-Offset(V.getTagMap(),"l")-aa};this.getClick_Y=function(ab){var i;if(b.isNS){i=ab.clientY+window.scrollY}else{i=window.event.clientY+document.documentElement.scrollTop+document.body.scrollTop}return i-Offset(V.getTagMap(),"t")-m};this.zoomStart=function(ab){dragObj.elNode=f;var i=V.getClick_X(ab),ac=V.getClick_Y(ab);if(isNaN(O.style.display)&&!H){if(b.isNS){document.addEventListener("mousemove",V.zoomGo,true);document.addEventListener("mouseup",V.zoomStop,true);ab.preventDefault()}else{document.attachEvent("onmousemove",V.zoomGo);document.attachEvent("onmouseup",V.zoomStop);window.event.cancelBubble=true;window.event.returnValue=false}V.setZoomboxFirst(i,ac)}};this.zoomGo=function(ab){V.hideInfo();var i=V.getClick_X(ab),ac=V.getClick_Y(ab);V.setZoomboxWH(i,ac);if(b.isNS){ab.preventDefault()}else{window.event.cancelBubble=true;window.event.returnValue=false}};this.zoomStop=function(i){del_event(document,"mousemove",V.zoomGo,!b.isOP);del_event(document,"mouseup",V.zoomStop,!b.isOP);V.zoomboxExtent()};this.dragStart=function(ab){dragObj.elNode=f;var i=V.getClick_X(ab)+Offset(V.getTagMap(),"l"),ac=V.getClick_Y(ab)+Offset(V.getTagMap(),"t");dragObj.cursorStartX=i;dragObj.cursorStartY=ac;dragObj.elStartLeft=parseInt(dragObj.elNode.style.left,10);dragObj.elStartTop=parseInt(dragObj.elNode.style.top,10);if(isNaN(dragObj.elStartLeft)){dragObj.elStartLeft=0}if(isNaN(dragObj.elStartTop)){dragObj.elStartTop=0}if(isNaN(O.style.display)&&!H){if(b.isNS){document.addEventListener("mousemove",V.dragGo,true);document.addEventListener("mouseup",V.dragStop,true);ab.preventDefault()}else{document.attachEvent("onmousemove",V.dragGo);document.attachEvent("onmouseup",V.dragStop);window.event.cancelBubble=true;window.event.returnValue=false}}};this.dragGo=function(i){V.hideInfo();var ab=V.getClick_X(i)+Offset(V.getTagMap(),"l"),ac=V.getClick_Y(i)+Offset(V.getTagMap(),"t");dragObj.elNode.style.left=(dragObj.elStartLeft+ab-dragObj.cursorStartX)+"px";dragObj.elNode.style.top=(dragObj.elStartTop+ac-dragObj.cursorStartY)+"px";M.style.left=parseInt(dragObj.elNode.style.left)+aa+"px";M.style.top=parseInt(dragObj.elNode.style.top)+m+"px";if(b.isNS){i.preventDefault()}else{window.event.cancelBubble=true;window.event.returnValue=false}};this.dragStop=function(ab){del_event(document,"mousemove",V.dragGo,!b.isOP);del_event(document,"mouseup",V.dragStop,!b.isOP);var ac,ae,i=V.getClick_X(ab)+Offset(V.getTagMap(),"l"),ad=V.getClick_Y(ab)+Offset(V.getTagMap(),"t");ac=(dragObj.elStartLeft+i-dragObj.cursorStartX);ae=(dragObj.elStartTop+ad-dragObj.cursorStartY);ac+=aa;ae+=m;if((ac!=0)||(ae!=0)){V.setPan(ac,ae)}dragObj.cursorStartX=null;dragObj.cursorStartY=null};V.init()}function glTool(h,j,g,k,f,o){var c=dcE("img"),l=false,d,i,p=j,n=g,a=k,m=null,e=null;if(f!=null){m=function(q){f(q,d,l,this)}}if(o!=null){e=function(q){var r=d.getClick_X(q),s=d.getClick_Y(q);o(q,d,r,s,d.xPixel2Real(r),d.yPixel2Real(s))}}this.Click=function(r){if(e==null){}else{if(a=="bottom"){l=!l;setAlphaPNG(c,l?g:j)}else{if(l==false){for(var q=0;q<i.getTools().length;q++){if(i.getTools()[q].getGroup()==a&&a!="bottom"){i.getTools()[q].setActive(false)}}l=true;i.removeMapEvents();setAlphaPNG(c,g);add_event(d.getTagEvent(),"mousedown",e)}}}if(m!=null){m()}};c.onmouseover=function(){if(!l){setAlphaPNG(c,g)}};c.onmouseout=function(){if(!l){setAlphaPNG(c,j)}};c.oncontextmenu=function(){return false};c.onmousedown=function(){return false};add_event(c,"click",this.Click);setAlphaPNG(c,j);setZindex(c,"200");c.style.margin="0";c.style.padding="0";c.style.position="absolute";c.style.display="none";c.title=h;if(!document.all){c.style.cursor="pointer"}else{c.style.cursor="hand"}this.getTag=function(){return c};this.getGroup=function(){return a};this.setMap=function(q){d=q};this.setToolbar=function(q){i=q};this.setActive=function(q){l=q;if(q){setAlphaPNG(c,n)}else{setAlphaPNG(c,p)}};this.haveMapEvent=function(){return(e!=null)};this.removeMapEvent=function(){if(e!=null){del_event(d.getTagEvent(),"mousedown",e,false)}}}function glToolbar(f,a,g){var h=dcE("div"),e=[],i=f,k=i.getTagMap(),c,d=dcE("div");h.id="_tagToolbar";this.getTag=function(){return h};this.getTools=function(){return e};this.hide=function(){h.style.display="none"};this.removeMapEvents=function(){for(var l=0;l<e.length;l++){e[l].removeMapEvent()}};this.addMapTool=function(j){j.setMap(i);j.setToolbar(this);e.push(j);j.getTag().style.width="auto";j.getTag().style.height="auto";h.appendChild(j.getTag());this.redraw()};this.redraw=function(){this.verticalLayout=function(){var l=0,n=0,m;for(m=0;m<e.length;m++){if(e[m].getGroup()=="bottom"){setPos(e[m].getTag(),parseInt(d.style.left)+5,parseInt(d.style.height)-((l+1)*40));l++}else{setPos(e[m].getTag(),parseInt(d.style.left)+5,(n*40)+5);n++}}};var j;if((a=="standard")||(a=="standardRight")||(a=="standardCornerRight")){d.style.left=(parseInt(k.style.width)-(40+i.getBorder()*2))+"px";d.style.top="0px";d.style.width="40px";d.style.height=k.style.height;this.verticalLayout();if(f.getLayerBox()){j=f.getLayerBox();j.style.width="200px";j.style.height=parseInt(f.height())+"px";j.style.top=(parseInt(f.height())-parseInt(j.style.height))+"px";j.style.left=(parseInt(f.width())-parseInt(j.style.width)-parseInt(d.style.width))+"px"}}else{if((a=="standardLeft")||(a=="standardCornerLeft")){d.style.left="0px";d.style.top="0px";d.style.width="40px";d.style.height=k.style.height;this.verticalLayout();if(f.getLayerBox()){j=f.getLayerBox();j.style.width=(parseInt(f.width())*0.4-parseInt(d.style.width)-20)+"px";j.style.height=parseInt(f.height())+"px";j.style.top="0px";j.style.left=parseInt(d.style.width)+"px"}}}};h.oncontextmenu=function(){return false};setZindex(h,"100");h.style.position="absolute";h.style.width="40px";d.id="box";d.oncontextmenu=function(){return false};setZindex(d,"100");d.style.position="absolute";d.style.display="";d.style.border="0px";d.style.margin="0px";d.style.padding="0px";d.style.background="#404040";d.style.lineHeight="0";d.style.opacity="0.50";d.style.filter="alpha(opacity=50)";h.appendChild(d);if(g==true){this.addMapTool(new glTool("Zoom auf M-V",path1+"reload0.png",path1+"reload1.png","top",i.fullExtent));this.addMapTool(new glTool("Verschieben",path1+"pan0.png",path1+"pan1.png","top",i.setActionPan,function(m,l,j,n){l.dragStart(m)}));this.addMapTool(new glTool("Vergr\u00f6\u00dfern mit Rechteck",path1+"zoombox0.png",path1+"zoombox1.png","top",i.setActionZoombox,function(m,l,j,n){l.zoomStart(m)}));this.addMapTool(new glTool("Vergr\u00f6\u00dfern",path1+"zoomin0.png",path1+"zoomin1.png","top",i.setActionZoomIn));this.addMapTool(new glTool("Verkleinern",path1+"zoomout0.png",path1+"zoomout1.png","top",i.setActionZoomOut));this.addMapTool(new glTool("Kartendarstellung",path1+"style0.png",path1+"style1.png","bottom",i.switchLayer,function(){}))}this.redraw();for(c=0;c<e.length;c++){if(e[c].haveMapEvent()==true){e[c].Click();break}}}function msMap(c,a){return new glMap(c,a)}function msTool(c,f,e,a,d,g){return new glTool(c,f,e,a,d,g)}function msToolbar(d,c,a){return new glToolbar(d,c,a)}function load(e,d,l){if(typeof(d)=="function"){var f=dcE("script"),i=document.getElementsByTagName("head")[0],j=Math.floor(Math.random()*1000+1),g;if(i){_store["f"+j]=[];_store["f"+j][0]=d;_store["f"+j][1]=window.setTimeout("load("+j+", false, "+l+")",5000);_store["f"+j][2]=l;f.setAttribute("type","text/javascript");f.setAttribute("id","gl"+j);f.setAttribute("src",e+"&f="+j);i.appendChild(f)}}else{if(_store["f"+e]){window.clearTimeout(_store["f"+e][1]);_store["f"+e][0](d,_store["f"+e][2]);delete _store["f"+e];g=document.getElementById("gl"+e);if(g){g.parentNode.removeChild(g)}}}};

