var massstab2=1,path2="http://www.gaia-mv.de/gaialight/",path1=path2+"img/",check0=new Image(14,16),check1=new Image(14,16),check3=new Image(14,16),pixel_img=new Image(),b=new Browser(),dragObj=new Object();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;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}}}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)}else{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 setZindex(a,c){a.style.zIndex=c}function glMap(n){var S=this,u=n,z=dcE("div"),M,W,X=0,m=0,I=null,U="standard",K,N,g=null,R=null,v=false,O=null,k,p,C,H,E=null,h=null,d=null,A=null,s,r,Q,t,F,T,e=dcE("img"),c=dcE("img"),a=dcE("div"),L=dcE("img"),J=dcE("div"),l=dcE("div"),q=dcE("div"),V=dcE("div"),j=null,G=null,o=path1+"loading.gif",B=500,P="",y="",f=new Array(),w=new Array(),x=0,D=function(i,Y){return i};this.load=function(Y,i,Z){load(Y,i,Z)};this.getTagMain=function(){return u};this.getTagMap=function(){return e};this.getTagEvent=function(){return V};this.getToolbar=function(){return G};this.setMaxScale=function(i){B=i};if(b.isIE){z.onselectstart=function(){return false};z.ondrag=function(){return false}}else{z.style.setProperty("-moz-user-select","none","")}this.setStyle=function(i){P=i};this.getStyle=function(){return P};this.setOptions=function(i){y=i};this.getOptions=function(){return y};this.setLabel=function(i){N=i};this.setLayerControl=function(i){D=i};this.createLayer=function(aa,ac,Z,ab,Y){var i=new Array();i[0]=aa;i[1]=(ac?ac:"");i[2]=(Z&&Z!=-1?Z:0);i[3]=(ab&&ab!=-1?ab:Number.MAX_VALUE);i[4]=(typeof Y=="function"?Y:(Y==null||Y==1?true:false));return i};this.addInfoLayer=function(Z,ad,Y,aa,i,ac,ab){S.load(path2+"gl.json.js?layers="+Z+(y?"&options="+y:""),function(ag,af){if(typeof ag=="object"&&ag.type=="FeatureCollection"){try{var ae=S.createLayer(af[0],af[1],af[2],af[3],af[4]);ae[6]=ag;S.createInfoLayer(ae,af[5],af[6],af[7])}catch(ah){return ah}}},new Array(Z,ad,Y,aa,i,ac,ab,++x))};this.createInfoLayer=function(Y,aa,Z,ac){for(var ab in Y[6].members){var i=Y[6].members[ab];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(Z?Z(null,this):false)};i.IMG.onclick=function(ad){return(Z?Z(ad,this.PARENT):false)};i.IMG.style.position="absolute";i.IMG.style.zIndex=ac;i.active=function(){return this.REPORT!=null};if(!document.all){i.IMG.style.cursor=(aa?aa:"pointer")}else{i.IMG.style.cursor=(aa?aa:"hand")}setAlphaPNG(i.IMG,path1+i.properties.image);l.appendChild(i.IMG)}i.setInfo=function(af,ad,ae){if(!af){if(this.REPORT){S.getInfoTag().removeChild(this.REPORT)}delete this.REPORT}else{this.REPORT=dcE("div");this.REPORT.oncontextmenu=function(){return false};this.REPORT.style.position="absolute";this.REPORTX=(ad?ad:0);this.REPORTY=(ae?ae:0);if(typeof af=="string"){this.REPORT.innerHTML=af}else{this.REPORT.appendChild(af)}S.redrawInfo()}}}w.push(Y);S.redrawInfo()};this.redrawInfo=function(){for(var Z=0;Z<w.length;Z++){for(var ab in w[Z][6].members){var Y=w[Z][6].members[ab],i,aa;if(!Y.properties||!Y.geometry){continue}i=S.xReal2pixel(Y.geometry.coordinates[0]);aa=S.yReal2pixel(Y.geometry.coordinates[1]);if(Y.IMG&&(w[Z][4]===true||(typeof w[Z][4]=="function"&&w[Z][4](w[Z][0])))&&w[Z][2]<=massstab2&&w[Z][3]>=massstab2){Y.IMG.style.display="";Y.IMG.style.left=Math.round(i-(parseInt(Y.IMG.offsetWidth)/2))+"px";Y.IMG.style.top=Math.round(aa-(parseInt(Y.IMG.offsetHeight)/2))+"px"}else{if(Y.IMG){Y.IMG.style.display="none"}}if(Y.REPORT&&i>0&&i<M-40&&aa>0&&aa<W){S.getInfoTag().appendChild(Y.REPORT);Y.REPORT.style.left=Math.round(i+Y.REPORTX)+"px";Y.REPORT.style.top=Math.round(aa-parseInt(Y.REPORT.offsetHeight)+Y.REPORTY)+"px"}}}};this.addLayer=function(aa,ae,Z,ab,Y){f.push(S.createLayer(aa,ae,Z,ab,Y));if(O!=null&&ae){var ad=dcE("div"),i=dcE("img"),ac=dcE("span");ad.style.margin="10px";i.id="glayer_"+aa;i.src=path1+"check0.gif";i.onclick=function(){S.setLayer(aa,this.src0==path1+"check0.gif")};i.width="14";i.height="16";i.style.cursor="hand";ad.appendChild(i);ac.style.paddingLeft="1ex";ac.innerHTML=ae;ad.appendChild(ac);document.getElementById("_layerList").appendChild(ad)}this.setLayerVisible()};this.setLayer=function(Y,aa){aa=(aa==1||aa===true?true:false);for(var Z=0;Z<f.length;Z++){if(f[Z][0]==Y){if(typeof f[Z][4]=="function"){f[Z][4](Y,(aa?1:-1))}else{f[Z][4]=aa}}}for(var Z=0;Z<w.length;Z++){if(w[Z][0]==Y){if(typeof w[Z][4]=="function"){w[Z][4](w[Z][0],(aa?1:-1))}else{w[Z][4]=aa}}}this.redraw();this.redrawInfo()};this.setLayers=function(Z){var Y=Z.split(" "),aa;for(aa=0;aa<Y.length;aa++){this.addLayer(Y[aa])}};this.setLayerVisible=function(){var Y,Z;for(Z=0;Z<f.length;Z++){if(typeof f[Z][4]=="function"){if(f[Z][4](f[Z][0])==false){f[Z][4](f[Z][0],-1)}else{if(f[Z][2]<=massstab2&&f[Z][3]>=massstab2){f[Z][4](f[Z][0],1)}else{f[Z][4](f[Z][0],0)}}}}};this.getVisibleLayersAsList=function(){var Y=new Array(),Z;for(Z=0;Z<f.length;Z++){if((f[Z][4]===true||(typeof f[Z][4]=="function"&&f[Z][4](f[Z][0])))&&f[Z][2]<=massstab2&&f[Z][3]>=massstab2){Y.push(f[Z][0])}}return D(Y,massstab2).join(",")};this.getCheckedLayersAsList=function(){var Y=new Array(),Z;for(Z=0;Z<f.length;Z++){if(f[Z][4]===true||(typeof f[Z][4]=="function"&&f[Z][4](f[Z][0]))){Y.push(f[Z][0])}}return Y.join(",")};this.getLayersAsList=function(){return f.join(",")};this.getInfoObjects=function(i){for(var Y in w){if(w[Y][0]==i){return w[Y][6]}}};this.getMainTag=function(){return z};this.getInfoTag=function(){return q};this.hideInfo=function(){while(q.hasChildNodes()){q.removeChild(q.childNodes[0])}};this.clearInfo=function(){for(var i=0;i<w.length;i++){for(var Y in w[i][6].members){delete w[i][6].members[Y].REPORT}}S.hideInfo()};S.wait=function(i){L.style.display=(i?"":"none")};this.isPointInMap=function(Z,Y,aa,i){if((Z>(h+S.wPixel2real(X)))||((Z+aa)<(E-S.wPixel2real(X)))){return false}if(((Y-i)>(A+S.hPixel2real(m)))||((Y+i-i)<(d-S.hPixel2real(m)))){return false}return true};this.setBorder=function(i){X=i;m=i;e.style.width=(S.width()+X+X)+"px";e.style.height=(S.height()+m+m)+"px";e.style.top=(-X)+"px";e.style.left=(-m)+"px";c.style.width=e.style.width;c.style.height=e.style.height;c.style.top=e.style.top;c.style.left=e.style.left};this.getBorder=function(){return X};this.width=function(){return M};this.height=function(){return W};this.control=function(){return U};this.setArgs=function(i){K=i};this.attachMap=function(i){g=i};this.enableContext=function(i){v=i};this.getLayerBox=function(){return O};this.addLayerButton=function(){if(O==null){O=dcE("div");O.id="_layerList";setZindex(O,"99");O.style.position="absolute";O.style.fontFamily="Verdana, Arial, Helvetica, sans-serif";O.style.fontSize="10pt";O.style.borderLeft="1px solid black";O.style.borderRight="1px solid black";O.style.borderTop="1px solid black";O.style.background="#EEEEEE";O.style.opacity="0.93";O.style.filter="alpha(opacity=93)";O.style.display="none";O.style.padding="0px";O.style.margin="0px";O.oncontextmenu=function(){return false};O.toggle=function(){if(O.style.display==""){O.style.display="none"}else{O.style.display=""}};O.hide=function(){O.style.display="none"};var i=new glTool("Layerverwaltung",path1+"layer0.png",path1+"layer1.png","bottom",function(){O.toggle()}),Y=dcE("div");Y.id="titel";Y.name="titel";Y.style.margin="10px";Y.style.textAlign="left";Y.innerHTML="<b>Layer an-/ausschalten</b>";O.appendChild(Y);z.appendChild(O);S.getToolbar().addMapTool(i)}};this.setReferenceMap=function(ab){if(ab&&ab.tagName&&ab.tagName=="DIV"){var Y=dcE("img"),i=parseInt(ab.style.width),Z=parseInt(ab.style.height),aa=dcE("div");Y.width=i;Y.height=Z;Y.src=path2+"gl.jpg?extent="+k+","+p+","+C+"&width="+i+"&height="+Z+"&layers=mv,lkref&options=noscalebar"+(I?"&dpi="+I:"")+(b.isOP?"&"+Math.random():"");aa.oncontextmenu=function(){return false};aa.style.display="none";aa.style.position="absolute";aa.style.margin="0";aa.style.padding="0";aa.style.lineHeight="0";aa.style.border="2px solid #ff0000";aa.style.background="#ffffff";aa.style.opacity="0.5";aa.style.filter="alpha(opacity=50)";aa.style.fontSize="1";ab.appendChild(Y);ab.appendChild(aa);ab.style.overflow="hidden";ab.onmousedown=function(af){var ag=(b.isNS?af.clientX+window.scrollX:window.event.clientX+document.documentElement.scrollLeft+document.body.scrollLeft)-Offset(this,"l"),ae=(b.isNS?af.clientY+window.scrollY:window.event.clientY+document.documentElement.scrollTop+document.body.scrollTop)-Offset(this,"t"),ai=4400000+ag*1325,ah=6067076-ae*1305,al=(h-E)/2,ak=(A-d)/2,ac=ai-al,ad=ai+al,aj=ah-ak;S.setExtent(ac,ad,aj);S.redraw()};R=ab;j=aa}};this.setReferenceBox=function(ac,ah,Y,ad){if(j!=null&&R!=null){var Z=Math.round(parseInt(R.style.width)*(ac-k)/(p-k)),i=Math.round(parseInt(R.style.height)*(H-Y)/(H-C)),af=Math.round(parseInt(R.style.width)*(ah-k)/(p-k)),ab=Math.round(parseInt(R.style.height)*(H-ad)/(H-C)),ag=af-Z,aa=i-ab,ae=2*parseInt(j.style.borderWidth);j.style.left=Z+"px";j.style.top=ab+"px";if(ag-ae>=0){ag=ag-ae}if(aa-ae>=0){aa=aa-ae}j.style.width=ag+"px";j.style.height=aa+"px";j.style.display=""}};this.addOverviewButton=function(){if(R==null){var Y=dcE("div"),i;Y.style.width="200px";Y.style.height="145px";Y.oncontextmenu=function(){return false};setZindex(Y,"100");z.appendChild(Y);Y.oncontextmenu=function(){return false};Y.toggle=function(){if(Y.style.display==""){Y.style.display="none"}else{Y.style.display=""}};Y.hide=function(){Y.style.display="none"};Y.style.position="absolute";Y.style.width="200px";Y.style.height="145px";Y.style.left=(parseInt(M)-parseInt(Y.style.width)-40)+"px";Y.style.bottom="0px";Y.style.border="1px solid black";Y.style.margin="0px";Y.style.padding="0px";Y.style.background="#FFFFFF";Y.style.lineHeight="0";Y.style.display="none";i=new glTool("&Uuml;bersichtskarte",path1+"ref0.png",path1+"ref1.png","bottom",function(){Y.toggle()});S.getToolbar().addMapTool(i);S.setReferenceMap(Y)}};this.xReal2pixel=function(i){return Math.round(M*(i-E)/(h-E))};this.yReal2pixel=function(i){return Math.round(W*(A-i)/(A-d))};this.wPixel2real=function(i){return(i*F)};this.hPixel2real=function(i){return(i*T)};this.xPixel2Real=function(i){return S.wPixel2real(i)+E};this.yPixel2Real=function(i){return S.hPixel2real(W-i)+d};this.setExtent=function(Z,i,Y){Z=parseFloat(Z);i=parseFloat(i);Y=parseFloat(Y);E=Z;h=i;d=Y;A=((W/M)*(h-E))+d;S.limitScale()};this.setFullExtent=function(Z,i,Y){k=Z;p=i;C=Y;H=((W/M)*(p-k))+C;S.fullExtentNoRedraw()};this.setZoomboxFirst=function(i,Y){s=i;r=Y};this.setZoomboxWH=function(i,Y){Q=i;t=Y;a.style.left=Math.min(s,Q)+"px";a.style.top=Math.min(r,t)+"px";a.style.width=Math.max(Q,s)-Math.min(Q,s)+"px";a.style.height=Math.max(t,r)-Math.min(t,r)+"px";a.style.display=""};this.zoomboxExtent=function(){a.style.display="none";if(massstab2>B&&Q!=null&&t!=null&&s!=null&&r!=null){var Z=Math.min(Q,s),i=Math.max(Q,s),aa=Math.max(t,r),Y=Math.min(t,r);E+=Z*F;h-=(M-i)*F;A-=Y*T;d+=(W-aa)*T;S.redraw();Q=null;t=null;s=null;r=null}};this.recalc_pixel_size=function(){F=(h-E)/M;T=(A-d)/W};this.limitScale=function(){var aa=h-E,Z=A-d,ab=((aa/Z>1)?(aa/((M/I)*0.0254)):(Z/((W/I)*0.0254))),Y,i;ab=Math.round(ab);if(ab<B){ab=B;Y=E+aa/2;i=d+Z/2;aa=ab*((M/I)*0.0254);Z=ab*((W/I)*0.0254);E=Y-aa/2;d=i-Z/2;h=aa+E;A=Z+d}massstab2=ab};this.getScale=function(){return massstab2};this.redraw=function(i){S.hideInfo();S.limitScale();S.setLayerVisible();S.wait(true);S.recalc_map_size();extent=Math.round(E)+","+Math.round(h)+","+Math.round(d)+","+Math.round(A);c.src=S.get_map_url();if((g!=null)&&(i!=false)){g.attachMap(S);g.setExtent(E,h,d);g.redraw(false)}this.setReferenceBox(E,h,d,A)};this.fullExtentNoRedraw=function(){E=k;h=p;d=C;A=H;S.limitScale()};this.fullExtent=function(Z,aa,Y,i){S.fullExtentNoRedraw();S.redraw()};this.setActionZoombox=function(Z,aa,Y,i){e.style.cursor="crosshair"};this.setActionPan=function(Z,aa,Y,i){e.style.cursor="move"};this.setActionNone=function(){S.hideInfo();if(G!=null){G.hide()}e.style.cursor=""};this.setActionZoomIn=function(Z,aa,Y,i){if(isNaN(L.style.display)){if(massstab2>B){S.zoomPerc(1.4,0);S.redraw()}}};this.setActionZoomOut=function(Z,aa,Y,i){if(isNaN(L.style.display)){S.zoomPerc(0.3,1);S.redraw()}};this.switchLayer=function(Z,aa,Y,i){if(S.getStyle()!="grau"){S.setStyle("grau")}else{S.setStyle("")}S.redraw()};this.zoomPerc=function(i,ad){var ac=h-E,Z=ac*i,aa=(Z-ac)/2,ab=A-d,ae=ab*i,Y=(ae-ab)/2;if(massstab2<B&&ad==1){aa=-600;Y=-420}S.setExtent(E+aa,h-aa,d+Y)};this.mapLoaded=function(){var i=e;e=c;c=i;J.style.left="0";J.style.top="0";S.redrawInfo();e.style.cursor=c.style.cursor;e.style.left=(-X)+"px";e.style.top=(-m)+"px";c.style.display="none";e.style.display="";S.wait(false)};this.get_map_url=function(){var i="mapsize="+(M+X+X)+"+"+(W+m+m),Y="mapext="+(E-S.wPixel2real(X))+"+"+(d-S.hPixel2real(m))+"+"+(h+S.wPixel2real(X))+"+"+(A+S.hPixel2real(m));return path2+"gl.jpg?"+Y+(P?"&style="+P:"")+(y?"&options="+y:"")+(N?"&label="+N:"")+"&"+i+"&layers="+S.getVisibleLayersAsList()+(K?"&"+K:"")+(I?"&dpi="+I:"")+(b.isOP?"&"+Math.random():"")};this.setPan=function(Y,aa){S.recalc_pixel_size();var i=Y*F,Z=aa*T;E=E-i;h=h-i;d=d+Z;A=A+Z;S.redraw()};this.recalc_map_size=function(){S.recalc_pixel_size();var Y,i;if(F>T){Y=((A-d)/2)+d;i=(W/M)*(h-E);d=Y-(i/2);A=Y+(i/2)}else{Y=((h-E)/2)+E;i=(M/W)*(A-d);E=Y-(i/2);h=Y+(i/2)}S.recalc_pixel_size()};this.init=function(){u.className="gl";while(u.hasChildNodes()){u.removeChild(u.firstChild)}z.id="_tagMain";z.className="glMain";z.style.width=u.style.width;z.style.height=u.style.height;z.style.position="absolute";M=parseInt(z.style.width);W=parseInt(z.style.height);u.style.position="relative";u.appendChild(z);z.oncontextmenu=function(){return v};z.style.width=S.width()+"px";z.style.height=S.height()+"px";z.style.overflow="hidden";z.style.position="absolute";if(!I){var i=dcE("div");i.style.width="1in";i.style.height="1in";i.style.position="absolute";i.style.padding="0px";i.style.overflow="hidden";z.appendChild(i);I=i.offsetWidth;z.removeChild(i)}V.oncontextmenu=function(){return v};V.style.position="absolute";V.left="0";V.top="0";e.objRef=S;e.oncontextmenu=function(){return v};e.onmousedown=function(){return false};add_event(e,"load",S.mapLoaded);e.galleryImg="no";e.style.width=(S.width()+X+X)+"px";e.style.height=(S.height()+m+m)+"px";e.style.border="0 none";e.style.margin="0";e.style.padding="0";e.style.position="absolute";e.style.top=(-X)+"px";e.style.left=(-m)+"px";e.style.opacity="1.0";e.style.filter="alpha(opacity=100)";e.style.display="none";c.objRef=e.objRef;c.oncontextmenu=e.oncontextmenu;c.onmousedown=e.onmousedown;add_event(c,"load",S.mapLoaded);c.galleryImg="no";c.style.width=e.style.width;c.style.height=e.style.height;c.style.border=e.style.border;c.style.margin=e.style.margin;c.style.padding=e.style.padding;c.style.position=e.style.position;c.style.top=e.style.top;c.style.left=e.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";J.oncontextmenu=function(){return false};J.style.position="absolute";l.oncontextmenu=function(){return false};l.style.position="absolute";q.oncontextmenu=function(){return true};q.style.position="absolute";L.oncontextmenu=function(){return false};L.onmousedown=function(){return false};L.style.position="absolute";L.style.display="none";L.style.border="0";L.style.margin="0";L.style.padding="0";L.style.lineHeight="0";setAlphaPNG(L,o);L.style.left=(M-80)/2+"px";L.style.top=(W-80)/2+"px";setZindex(q,"20");setZindex(z,"10");setZindex(a,"150");setZindex(L,"100");setZindex(J,"50");setZindex(V,"0");u.appendChild(q);V.appendChild(e);V.appendChild(c);J.appendChild(l);z.appendChild(a);z.appendChild(J);z.appendChild(V);if(U!=null){G=new glToolbar(S,U,true);z.appendChild(G.getTag())}z.appendChild(L)};this.getClick_X=function(Y){var i;if(b.isNS){i=Y.clientX+window.scrollX}else{i=window.event.clientX+document.documentElement.scrollLeft+document.body.scrollLeft}return i-Offset(S.getTagMap(),"l")-X};this.getClick_Y=function(Y){var i;if(b.isNS){i=Y.clientY+window.scrollY}else{i=window.event.clientY+document.documentElement.scrollTop+document.body.scrollTop}return i-Offset(S.getTagMap(),"t")-X};this.zoomStart=function(Y){dragObj.elNode=e;var i=S.getClick_X(Y),Z=S.getClick_Y(Y);if(isNaN(L.style.display)){if(b.isNS){document.addEventListener("mousemove",S.zoomGo,true);document.addEventListener("mouseup",S.zoomStop,true);Y.preventDefault()}else{document.attachEvent("onmousemove",S.zoomGo);document.attachEvent("onmouseup",S.zoomStop);window.event.cancelBubble=true;window.event.returnValue=false}S.setZoomboxFirst(i,Z)}};this.zoomGo=function(Y){S.hideInfo();var i=S.getClick_X(Y),Z=S.getClick_Y(Y);S.setZoomboxWH(i,Z);if(b.isNS){Y.preventDefault()}else{window.event.cancelBubble=true;window.event.returnValue=false}};this.zoomStop=function(i){del_event(document,"mousemove",S.zoomGo,!b.isOP);del_event(document,"mouseup",S.zoomStop,!b.isOP);S.zoomboxExtent()};this.dragStart=function(Y){dragObj.elNode=e;var i=S.getClick_X(Y)+Offset(S.getTagMap(),"l"),Z=S.getClick_Y(Y)+Offset(S.getTagMap(),"t");dragObj.cursorStartX=i;dragObj.cursorStartY=Z;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(L.style.display)){if(b.isNS){document.addEventListener("mousemove",S.dragGo,true);document.addEventListener("mouseup",S.dragStop,true);Y.preventDefault()}else{document.attachEvent("onmousemove",S.dragGo);document.attachEvent("onmouseup",S.dragStop);window.event.cancelBubble=true;window.event.returnValue=false}}};this.dragGo=function(i){S.hideInfo();var Y=S.getClick_X(i)+Offset(S.getTagMap(),"l"),Z=S.getClick_Y(i)+Offset(S.getTagMap(),"t");dragObj.elNode.style.left=(dragObj.elStartLeft+Y-dragObj.cursorStartX)+"px";dragObj.elNode.style.top=(dragObj.elStartTop+Z-dragObj.cursorStartY)+"px";J.style.left=parseInt(dragObj.elNode.style.left)+X+"px";J.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(Y){del_event(document,"mousemove",S.dragGo,!b.isOP);del_event(document,"mouseup",S.dragStop,!b.isOP);var Z,ab,i=S.getClick_X(Y)+Offset(S.getTagMap(),"l"),aa=S.getClick_Y(Y)+Offset(S.getTagMap(),"t");Z=(dragObj.elStartLeft+i-dragObj.cursorStartX);ab=(dragObj.elStartTop+aa-dragObj.cursorStartY);Z+=X;ab+=m;if((Z!=0)||(ab!=0)){S.setPan(Z,ab)}};S.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=new Array(),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);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++}}};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()){var 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()){var 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";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&ouml;ßern mit Rechteck",path1+"zoombox0.png",path1+"zoombox1.png","top",i.setActionZoombox,function(m,l,j,n){l.zoomStart(m)}));this.addMapTool(new glTool("Vergr&ouml;ßern",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)}var _store=new Array();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]=new Array();_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)}}}};
