ajaxRequest=function(r,u,f,m,b,h,s)
{this.ref=r;this.url=u;this.wState=f||function(){};this.method=m||"GET";this.body=b||null;this.headers=h||false;this.sync=s||true;this.abortReq=false;this.req=(window.XMLHttpRequest)?new XMLHttpRequest():((window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):false);this.doRequest=function()
{this.req.open(this.method,this.url,this.sync);if(this.headers)
{for(var i=0;i<this.headers.length;i+=2)
{this.req.setRequestHeader(this.headers[i],this.headers[i+1]);}}
this.req.onreadystatechange=this.wState;(!this.abortReq)?this.req.send(null):this.req.abort();}};var path_skin="/quickWMS/gs_like/";var empty_IMG=path_skin+"empty.gif";var waiting_IMG=path_skin+"waiting.gif";var white_IMG=path_skin+"white.gif";var picSize=28;var mouseGrid=5;var TXT_OnRequestingData="Requesting data ...";var TXT_Updated=" updated ...";var TXT_WaitingFor=" Waiting for ";var TXT_Requests=" requests ";var TXT_Layer="Layer";var TXT_ReceivedLayer="was correctly downloaded";var TXT_Request=" request ";var TXT_LayerUpdated="All layers retrieved.<BR> Updating ...";var TXT_QueryDataReceived="Query information was received...";var TXT_UserCancel="Request was canceled by user";var TXT_onChange="onChange";var TXT_OnRequestingData="Anfrage wird bearbeitet ...";var TXT_Updated=" aktualisiere ...";var TXT_WaitingFor=" Warte auf ";var TXT_Requests=" Anfragen ";var TXT_Layer="Layer";var TXT_ReceivedLayer="wurde korrekt geladen";var TXT_Request=" Anfrage ";var TXT_LayerUpdated="Alle Layer geladen.<BR> Akualisierung ...";var TXT_QueryDataReceived="Abfrage Information erhalten...";var TXT_UserCancel="Anfrage durch den Benutzer abgebrochen";var TXT_onChange="onChange";var highLightThreshold=40;var statusThreshold=60;var WMS_selectBorder="border-style:dashed;border-width:5;border-color:#C0C0C0";var WMS_zoomBorder="border-style:dashed;border-width:2;border-color:#C0C0C0";var browser=new Object("browser");browser.isIE70=(navigator.userAgent.indexOf("MSIE 7.0")>=0);browser.isIE60=(navigator.userAgent.indexOf("MSIE 6.0")>=0);browser.isIE55=(navigator.userAgent.indexOf("MSIE 5.5")>=0);browser.isIE50=(navigator.userAgent.indexOf("MSIE 5.0")>=0);if(browser.isIE70){browser.isIE60=true}
browser.isMoz09=((navigator.userAgent.indexOf("Mozilla/5.0")>=0)&&(navigator.userAgent.indexOf("Netscape")<0)&&(navigator.userAgent.indexOf("rv:0.9")>=0));browser.isMoz10=((navigator.userAgent.indexOf("Mozilla/5.0")>=0)&&(navigator.userAgent.indexOf("Netscape")<0)&&(navigator.userAgent.indexOf("rv:1.0")>=0));browser.isMoz50=((navigator.userAgent.indexOf("Mozilla/5.0")>=0)&&(navigator.userAgent.indexOf("Netscape")<0)&&(navigator.userAgent.indexOf("Gecko")>0));if(browser.isMoz50){browser.isMoz10=true}
browser.isNS6=(navigator.userAgent.indexOf("Netscape6")>=0);browser.isNS7=(navigator.userAgent.indexOf("Netscape/7.")>=0);browser.isNS8=((navigator.userAgent.indexOf("Netscape/8.")>=0)&&(navigator.userAgent.indexOf("MSIE 6.0")<0));browser.isNS47x=document.layers;browser.isDOM=(browser.isNS8||browser.isNS7||browser.isNS6||browser.isMoz09||browser.isMoz10||browser.isMoz50||browser.isIE60)&&document.getElementById;browser.isOldNS=(browser.isNS47x);browser.isOldIE=(browser.isIE55||browser.isIE50)&&document.all;browser.name="Unknown";if(browser.isIE60)
browser.name="Internet Explorer 6.0";if(browser.isIE55)
browser.name="Internet Explorer 5.5";if(browser.isIE50)
browser.name="Internet Explorer 5.0";if(browser.isNS7)
browser.name="Netscape 7.x";if(browser.isNS8)
browser.name="Netscape 8.x";if(browser.isNS6)
browser.name="Netscape 6.0";if(browser.isNS47x)
browser.name="Netscape Navigator 4.7x";if(browser.isMoz09)
browser.name="Mozilla 0.9x";if(browser.isMoz10)
browser.name="Mozilla 1.0x";function openLayer(name,parentClass,addStyle,left,top,width,height,visible)
{var layer;if(browser.isOldNS)
{if(addStyle.indexOf('inherit')>0)document.writeln('<layer name="'+name+'" left="'+left+'" top="'+top+'" width="'+width+'" height="'+height+'" visibility="inherit" class="'+parentClass+'">');else document.writeln('<layer name="'+name+'" left="'+left+'" top="'+top+'" width="'+width+'" height="'+height+'" visibility="'+(visible?'"show"':'"hide"')+' class="'+parentClass+'">');}
else
{document.write('<div id="'+name+'" class="'+parentClass+'" style="position:absolute;  left:'+left+'px; top:'+top+'px; width:'+width+'px; height:'+height+'px;'+' visibility:'+(visible?'visible;':'hidden;')+';'+addStyle+'">');if(browser.isIE55||browser.isIE60)setLayerPos(name,left,top,width,height);}}
function getLayerHtml(name,parentClass,addStyle,left,top,width,height,visible)
{var layer;var content="";if(browser.isOldNS)
{if(addStyle.indexOf('inherit')>0)content+=('<layer name="'+name+'" left="'+left+'" top="'+top+'" width="'+width+'" height="'+height+'" visibility="inherit" class="'+parentClass+'">');else content+=('<layer name="'+name+'" left="'+left+'" top="'+top+'" width="'+width+'" height="'+height+'" visibility="'+(visible?'"show"':'"hide"')+' class="'+parentClass+'">');}
else
{content+=('<div id="'+name+'" class="'+parentClass+'" style="position:absolute;  left:'+left+'px; top:'+top+'px; width:'+width+'px; height:'+height+'px;'+' visibility:'+(visible?'visible;':'hidden;')+';'+addStyle+'">');}
return content;}
function writeIMG(name,src,left,top,width,height,styles){if(browser.isOldNS){var contentIMG='<layer id="p'+name+'" left="'+left+'" top="'+top+'" width="'+width+'" height="'+height+'" visibility="inherit">';contentIMG+='<img border="1" name="'+name+'" width="'+width+'" height="'+height+'" src="'+src+'" style="">';contentIMG+='</layer>';document.write(contentIMG);return(findLayer('p'+name,document).document.images[0]);}
else{document.write("<img name='"+name+"' style='"+styles+";position:absolute;top:"+top+";left:"+left+"' width="+width+" height="+height+" src='"+src+"'>");return document.images[name];}}
function GetImgHTML(name,src,left,top,width,height,styles){if(browser.isOldNS){var contentIMG='<layer id="p'+name+'" left="'+left+'" top="'+top+'" width="'+width+'" height="'+height+'" visibility="inherit">';contentIMG+='<img border="1" name="'+name+'" width="'+width+'" height="'+height+'" src="'+src+'" style="">';contentIMG+='</layer>';return contentIMG;}
else{var contentIMG="<img name='"+name+"' style='"+styles+";position:absolute;top:"+top+";left:"+left+"' width="+width+" height="+height+" src='"+src+"'>";return contentIMG;}}
function getCloseLayerHTML()
{if(browser.isOldNS){return'</layer>';}
else{return'</div>';}}
function closeLayer()
{if(browser.isOldNS){document.writeln('</layer>');}
else{document.write('</div>');}}
function createLayer(name,left,top,width,height,visible,content)
{var layer;if(browser.isOldNS)
{document.write('<layer bgcolor="#CC00EE" name="'+name+'" left='+left+' top='+top+' width='+width+' height='+height+' visibility='+(visible?'"show"':'"hide"')+'>');document.write(content);document.write('</layer>');layer=getLayer(name);layer.width=width;layer.height=height;}
else
{document.write('<div id="'+name+'" style="position:absolute; overflow:none; left:'+left+'px; top:'+top+'px; width:'+width+'px; height:'+height+'px;'+' visibility:'+(visible?'visible;':'hidden;')+'">');document.write(content);document.write('</div>');if(browser.isIE55||browser.isIE60){setLayerPos(name,left,top,width,height);}}}
function getLayer(name)
{var layer=null;if(browser.isOldNS)
layer=findLayer(name,parent.document);if(browser.isOldIE)
layer=eval('document.all.'+name);if(browser.isDOM)
layer=document.getElementById(name);if(!layer)
{layer=document.getElementById(name);}
return layer;}
function findLayer(name,doc)
{var i,layer;for(i=0;i<doc.layers.length;i++)
{layer=doc.layers[i];if(layer.name==name)
return layer;if(layer.document.layers.length>0)
{layer=findLayer(name,layer.document);if(layer!=null)
return layer;}}
return null;}
function hideLayer(layerName)
{var layer=getLayer(layerName);if(browser.isOldNS)
layer.visibility="hide";if(browser.isOldIE||browser.isDOM)
layer.style.visibility="hidden";}
function showLayer(layerName)
{var layer=getLayer(layerName);if(browser.isOldNS)
layer.visibility="show";if(browser.isOldIE||browser.isDOM)
layer.style.visibility="visible";}
function getVisibility(layerName)
{var layer=getLayer(layerName);var visStatus="visible";if(browser.isOldNS)
{if(layer.visibility=="show")
visStatus="visible";if(layer.visibility=="hide")
visStatus="hidden";}
if(browser.isOldIE||browser.isDOM)
visStatus=layer.style.visibility;return visStatus;}
function isVisible(layerName)
{return(getVisibility(layerName)=="visible");}
function setLayerPos(layerName,left,top,width,height)
{if(browser.isOldNS){}
else{layer=getLayer(layerName).style;if(left)layer.left=left;if(top)layer.top=top;if(width)layer.width=width;if(height)layer.height=height;if(browser.isIE55||browser.isIE60){if(layer.borderWidth){layer.width=width+parseInt(layer.borderWidth)*2+0;layer.height=height+parseInt(layer.borderWidth)*2+0;}else{layer.width=width+0;layer.height=height+0;}}}}
function setLayerHTML(layerName,content)
{var layer=getLayer(layerName);if(browser.isOldNS)
{layer.document.open();layer.document.write(content);layer.document.close();}
if(browser.isOldIE||browser.isDOM)
{layer.innerHTML=content;}};OpenLayers.Control.WMSGetFeatureInfo=OpenLayers.Class(OpenLayers.Control,{drawMode:null,queryablelayertypes:["OpenLayers.Layer.WMS","OpenLayers.Layer.WMS.Untiled","OpenLayers.Layer.MapServer"],div:null,renderform:true,proxy:null,layers:null,tables:null,layerstoquery:null,tablestoquery:null,result:null,form:null,queries:0,errors:0,features:null,initialize:function(options){OpenLayers.Control.prototype.initialize.apply(this,[options]);this.layers=[];this.tables=[];this.layerstoquery=[];this.tablestoquery=[];this.features=[];if(!this.result){this.result=new Ext.Window({id:'featureInfoResult',title:'Abfrageresultate',width:600,height:400,y:160,collapsible:true,expandOnShow:true,layout:'fit',html:'<div id="result">Hier stehen die Ergebnisse</div>',plain:true,animCollapse:true,autoScroll:true,expandOnShow:true,closeAction:'hide'});}
var callbacks={click:this.onClick};var options={delay:0};this.handler=new OpenLayers.Handler.Click(this,callbacks,options);this.waitoptions={msg:'Abfrage wird durchgef&uuml;hrt, bitte warten oder abrechen mit Esc',progressText:'Loading...',width:400,wait:true,waitConfig:{interval:200}};},addLayer:function(layer,tables,options){options=options||{};this.layers.push(layer);this.tables.push(tables);},onClick:function(evt){for(var i=0,len=this.layers.length;i<len;i++){aTable=this.tables[i];var possibleLayers=map.getLayersByName(this.layers[i]);if(possibleLayers.length!=1){var msg=' GetfeatureInfo Fehler bei layer '+this.layers[i];alert(msg);}
else{aLayer=possibleLayers[0];}
if(!aLayer.visibility){continue;}
this.layerstoquery.push(aLayer);this.tablestoquery.push(aTable);}
if(this.layerstoquery.length==0){this.showPopup("<br>Alle abfragbaren Layer sind ausgeschaltet. Gehen und Sie auf die Themanauswahl und schalten Sie den Layer ein, den Sie abfragen m&ouml;chten.");return;}
this.showWaitMessageBox();for(var i=0;i<this.layerstoquery.length;i++){var aLayer=this.layerstoquery[i];var aTable=this.tablestoquery[i];if(aLayer.CLASS_NAME=="OpenLayers.Layer.GeoShop"){var featureinfo_url=aLayer.url.replace('webclient','wms/getFeatureInfoOL.igs')+'?';var testurl='http://localhost:3501/webclient'
featureinfo_url+=testurl+'?reqid=link1&user=openlayers&password=openlayers&layers='+aTable;if(aLayer.params.view){featureinfo_url+='&view='+aLayer.params.view;}
var bounds=map.getMaxExtent();var size=map.getSize();featureinfo_url+='&res='+size.w+'x'+size.h;var left_top=map.getLonLatFromPixel(new OpenLayers.Pixel(0,0));var right_bottom=map.getLonLatFromPixel(new OpenLayers.Pixel(size.w,size.h));var point=map.getLonLatFromPixel(new OpenLayers.Pixel(evt.xy.x,evt.xy.y));featureinfo_url+='&p1='+left_top.lon+'/'+right_bottom.lat;featureinfo_url+='&p2='+right_bottom.lon+'/'+left_top.lat;featureinfo_url+='&p='+point.lon+'/'+point.lat;featureinfo_url+='&oclass=*&all';}
else{var featureinfo_url=aLayer.url+"?SERVICE=WMS&REQUEST=GetFeatureInfo";featureinfo_url=featureinfo_url
+"&VERSION=1.1.1"
+"&SRS="+aLayer.projection.projCode
+"&BBOX="+map.getExtent().toBBOX()
+"&X="+evt.xy.x+"&Y="+evt.xy.y
+"&INFO_FORMAT=text/html"
+"&LAYERS="+aTable
+"&QUERY_LAYERS="+aTable
+"&WIDTH="+map.size.w+"&HEIGHT="+map.size.h;}
if(this.proxy){var featureinfo_url=featureinfo_url.replace('?','&')
featureinfo_url=this.proxy+featureinfo_url;}
OpenLayers.loadURL(featureinfo_url,'',this,this.getFeatures,this.onError);}},getFeatures:function(response){var aFeature=response.responseText;this.queries++;aFeature=aFeature.replace(/^\s+/g,'').replace(/\s+$/g,'')
aFeature=aFeature.replace(/<\/td>/gim,'\n').replace(/(ftp|http|https|file):\/\/[\S]+(\b|$)/gim,'<a href="$&" class="my_link" target="_blank">$&</a>').replace(/([^\/])(www[\S]+(\b|$))/gim,'$1<a href="http://$2" class="my_link" target="_blank">$2</a>').replace(/\n/gim,'</td>');if(aFeature==""||aFeature=="\n"){}
else{this.features.push(aFeature);}
if(this.queries==this.layerstoquery.length){this.showResult();}},resetQueryData:function(){this.layerstoquery=[];this.tablestoquery=[];this.features=[];this.queries=0;this.errors=0;},showResult:function(){errMsg="";result="";if(this.errors>0){errMsg+=this.errors+" error detected";}
if(this.features.length==0){var errMsg='<br><b>Die Kartenabfrage lieferte kein Resultat. </b><br><br> Dies kann verschiedene Ursachen haben:<br>';errMsg+='<div style="padding-left:10px; class="text_legende""><br><ul style="margin-left: 12px;   list-style-position: outside; list-style-type: disc; ">';errMsg+='<li>die abfragbaren Layer sind ausgeschaltet</li>';errMsg+='<li>es befindet sich kein abfragebares Objekt in der N&auml;he des Mouse-Klicks</li>';errMsg+='<li>der Mouse-Klick ist zu ungenau, um das Objekt zu identifizieren</li>';errMsg+='</ul></div>';}
this.hideWaitMessageBox();result=errMsg;for(i=0;i<this.features.length;i++){result+=this.features[i];}
this.showPopup(result);this.resetQueryData();},onError:function(response){this.queries++;this.errors++;if(this.queries==this.layerstoquery.length){this.showResult();}},setMap:function(map){this.handler.setMap(map);OpenLayers.Control.prototype.setMap.apply(this,arguments);},activate:function(){if(this.active){return false;}
this.handler.activate();this.active=true;this.events.triggerEvent("activate");return true;},showPopup:function(text){if(text==""){return;}
this.result.show();Ext.getCmp('featureInfoResult').body.dom.innerHTML=text;},deactivate:function(){if(this.active){this.handler.deactivate();this.active=false;this.events.triggerEvent("deactivate");return true;}
return false;},CLASS_NAME:"OpenLayers.Control.WMSGetFeatureInfo"});;OpenLayers.Layer.GeoShop=OpenLayers.Class(OpenLayers.Layer.Grid,{default_params:{user:"openlayers",password:"openlayers",view:"public",image_format:"gif"},reproject:false,isBaseLayer:true,encodeBBOX:false,queryString:"",initialize:function(name,url,params,options){var newArguments=[];newArguments.push(name,url,params,options);OpenLayers.Layer.Grid.prototype.initialize.apply(this,newArguments);OpenLayers.Util.applyDefaults(this.params,this.default_params);if(this.params.image_format&&this.params.image_format.toString().toLowerCase()=="png"&&this.params.background_color&&this.params.background_color=="transparent"){if(OpenLayers.Util.alphaHack()){this.params.image_format='gif'}}},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments);},clone:function(obj){if(obj==null){obj=new OpenLayers.Layer.GeoShop(this.name,this.url,this.params,this.options);}
obj=OpenLayers.Layer.Grid.prototype.clone.apply(this,[obj]);return obj;},getURL:function(bounds){bounds=this.adjustBounds(bounds);var imageSize=this.getImageSize();var res=imageSize.w+"x"+imageSize.h;var p1=bounds.left+"/"+bounds.bottom;var p2=bounds.right+"/"+bounds.top;if(this.queryString==""){var requestString=this.getFullRequestString({reqid:"image1",'res':res,'p1':p1,'p2':p2});requestString+='&no_annotations';}
else{var requestString=this.getFullRequestString({'reqid':"image2",'res':res,'p1':p1,'p2':p2});requestString+=this.queryString+'&no_annotations';}
return requestString;},addTile:function(bounds,position){return new OpenLayers.Tile.Image(this,position,bounds,null,this.tileSize);},mergeNewParams:function(newParams){var upperParams=OpenLayers.Util.upperCaseObject(newParams);var newArguments=[upperParams];return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,newArguments);},setQuerString:function(myString){this.queryString=myString;},clearQuerString:function(){this.queryString="";},getFullRequestString:function(newParams,altUrl){var projectionCode=this.map.getProjection();return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments);},CLASS_NAME:"OpenLayers.Layer.GeoShop"});;var llvtools=new Object("llvtools");llvtools.writellvheader=function(width,AmtsStelle,AmtsStelle_ref,Thema,Thema_ref){var widthm=width-178-809;document.write('<table bgcolor="#FFFFFF" height="117" width=')
document.write(width);document.write('border="0" cellspacing="0" cellpadding="0">');document.write('<tr background="#FFFFFF"> ');document.write('<td align="left"><a target="_blank" href="http://www.llv.li"><img src="http://geodaten.llv.li/geoshop/img/logo-landesverwaltung1.gif" width="160" height="116" alt="" border="0"></td> ');document.write('<td width="');document.write(widthm);document.write('" align="right"  ></td> ');document.write('<td style="background-image:url(http://geodaten.llv.li/geoshop/img/hintergrund_breit.gif); background-repeat:repeat-y; " height="117"  width="809" align="right"  >');document.write('<p style=" top:30px; font-family: Verdana, Arial, Helvetica, Sans-Serif; font-size: 28px; color:#FFFFFF; font-weight:normal; text-align:right; margin-top:0; margin-bottom:0"  >');document.write('<a target="_blank" style="color: #FFFFFF; text-decoration: none" href="');document.write(Thema_ref);document.write('">');document.write(Thema);document.write('</a> &nbsp; </p> ');document.write('<p style="  left:620px; top:60px;  font-family: Verdana, Arial, Helvetica, Sans-Serif;   font-size: 14px;   color:#FFFFFF;  font-weight:bold;  text-align:right; margin-top:8; margin-bottom:0" >');document.write('<a target="_blank" href="');document.write(AmtsStelle_ref)
document.write('" style="text-decoration: none"> <font color="#FFFFFF">');document.write(AmtsStelle);document.write(' </font></a>&nbsp; &nbsp;</p>');document.write('</td> ');document.write('<td align="right" width="18" height="117" ><a target="_blank" href="http://www.liechtenstein.li"><img height="117" src="http://geodaten.llv.li/geoshop/img/fl-logo.jpg"  alt="" border="0"></td> ');document.write('</tr>');document.write('</table>');}
llvtools.dragwin=function dragwin(divID,x,y,wi,hi,title,titleHeight,content,className,OnClosefunktion){this.imagedir="/geoportal/OpenLayers-2.8/user/win/image/"
this.left=x+'px';this.top=y+'px';this.OnCloseFunction=OnClosefunktion||'{ }';var div=document.createElement('div');var d=divID+'Parent';div.setAttribute('id',d);div.style.visibility='visible';div.className="DragwinWindow ";div.style.left=x+'px';div.style.top=y+'px';div.style.width=wi+'px';div.style.height=titleHeight+'px';div.style.position='absolute';this.titleDiv=document.createElement('div');this.titleDiv.style.visibility='visible';this.titleDiv.className='DragwinTitle';this.titleDiv.innerHTML=title;this.titleDiv.style.top='0px';this.titleDiv.style.left='0px';this.titleDiv.style.width='100%';this.titleDiv.style.height=titleHeight+'px';this.titleDiv.style.cursor='move';this.titleDiv.style.zIndex=2;var img=document.createElement('img');img.src=this.imagedir+"delete.gif";img.style.cursor='pointer';img.style.position='absolute';img.style.right='0px';img.parentDiv=div;img.reference=this;img.style.zIndex=5;img.style.visibility='visible';img.onclick=function(){if(this.reference.titleDiv.style.visibility=='visible'){this.reference.hide();eval(this.reference.OnCloseFunction);}
else{this.reference.show();}}
div.appendChild(img);this.clickimg=img;this.contentDiv=document.createElement('div');this.contentDiv.setAttribute('id',divID);this.contentDiv.className='DragwinContent';this.contentDiv.innerHTML=content;this.contentDiv.style.position='absolute';this.contentDiv.style.top=titleHeight+'px';this.contentDiv.style.height=hi-titleHeight+'px';this.contentDiv.style.bottom='0px';this.contentDiv.style.zIndex=1;this.contentDiv.style.overflow='auto';this.contentDiv.style.width='100%';div.className=className||'DragwinWindow';this.div=div;div.appendChild(this.titleDiv);div.appendChild(this.contentDiv);document.body.appendChild(div);var test="#"+d
this.show=function(){this.div.style.visibility='visible';this.clickimg.src=this.imagedir+'delete.gif';this.clickimg.style.visibility='visible';this.titleDiv.style.visibility='visible';this.contentDiv.style.visibility='visible';}
this.hide=function(){this.div.style.visibility='hidden';this.clickimg.style.visibility='hidden';this.titleDiv.style.visibility='hidden';this.contentDiv.style.visibility='hidden';}
this.reset=function(){this.div.style.top=this.top;this.div.style.left=this.left;}
this.moveto=function(x,y){this.div.style.top=x+'px';this.div.style.left=y+'px';}};var printform='      <div style="padding-left:5px; font-size:12px;">';printform+='            <form name="drucken">';printform+='            <br><b>Plantitel:</b><br>';printform+='            <input style="width: 180px; font-size:11px;" name="titel" type="text" size="26" maxlength="30" value="Situationsplan"><br><br>'
printform+='            <b>Papierformat:</b><br>';printform+='              <select name="format" onchange="showRahmen()" style="width: 180px;font-size:12px;">';printform+='                <option value="0000">Format wählen...</option>';printform+='                <option value="A4">A4</option>';printform+='                <option value="A3">A3</option>';printform+='              </select>';printform+='              <br> <br>';printform+='              <b>Ausrichtung:</b> <br>';printform+='              <select style="width: 180px; font-size:11px;" name="ausrichtung" onchange="showRahmen()">';printform+='                <option value="0000">Ausrichtung wählen...</option>';printform+='                <option value="portrait">Hochformat</option>';printform+='                <option value="landscape">Querformat</option>';printform+='              </select>';printform+='              <br> <br>';printform+='              <b>Massstab:</b> <br> <br>';printform+='              <select style="font-size:11px;width: 180px;" name="massstab" onchange="showRahmen()" >';printform+='                <option value="0000">Massstab wählen...</option>';printform+='                <option value="100">1:100</option>';printform+='                <option value="200">1:200</option>';printform+='                <option value="250">1:250</option>';printform+='                <option value="500">1:500</option>';printform+='                <option value="1000">1:1000</option>';printform+='                <option value="2000">1:2000</option>';printform+='                <option value="2500">1:2500</option>';printform+='                <option value="5000">1:5000</option>';printform+='                <!--<option value="10000">1:10000</option>-->';printform+='              </select>';printform+='              <br> <br>';printform+='            <table>';printform+='              <tbody><tr>';printform+='                <td style="width: 2px;">';printform+='                  ';printform+='                </td>';printform+='                <td>';printform+='                  <input class="btn" value="Plan drucken" onclick="printRahmen()" type="button" style="font-size:11px;text-align:left;width: 180px;">';printform+='                </td>';printform+='              </tr>';printform+='              <tr>';printform+='                <td>';printform+='                  ';printform+='                </td>';printform+='                <td>';printform+='                  <input class="btn" value="Rahmen neu erstellen" onclick="centerRahmen()" type="button" style="font-size:11px;text-align:left;width: 180px;">';printform+='                </td>';printform+='              </tr>';printform+='              <tr>';printform+='                <td>';printform+='                  ';printform+='                </td>';printform+='                <td>';printform+='                  <input class="btn" value="Rahmen löschen" onclick="deleteRahmen()" type="button" style="font-size:11px; text-align:left;width: 180px;">';printform+='                </td>';printform+='              </tr>';printform+='            </tbody></table>';printform+='          </form></div>';var frameWidth;var frameHeight;var frameScale;var marginX=0.02;var marginY=0.02;var marginTitle=0.03;var format;var ausrichtung;var massstab;function printRahmen(){format=document.drucken.format.value;ausrichtung=document.drucken.ausrichtung.value;massstab=document.drucken.massstab.value;titel=document.drucken.titel.value;if(titel==""){titel="Situationsplan Geodatenportal";}
if(format=="0000"||ausrichtung=="0000"||massstab=="0000"){return;}
var frameLayer=map.getLayersByName("rahmen");var bbox=frameLayer[0].features[0].geometry.getBounds();var left=bbox.left;var top=bbox.top;var bottom=bbox.bottom;var right=bbox.right;var url='/geoportal/print/plot.html?format='+format+'&orientation='+ausrichtung+'&scale='+massstab;url+='&top='+top+'&left='+left+'&right='+right+'&bottom='+bottom+'&titel='+titel;url+='&frameWidth='+frameWidth+'&frameHeight='+frameHeight;window.open(url,'Plot_preview','width=970,height=860,toolbar=0,menubar=1,location=0,personalbar=0,navigation=0,resizable=1');}
function showRahmen(){format=document.drucken.format.value;ausrichtung=document.drucken.ausrichtung.value;massstab=document.drucken.massstab.value;if(format=="0000"||ausrichtung=="0000"||massstab=="0000"){return;}
frameScale=massstab;setFrameSize(format,ausrichtung);var layer_style=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style['default']);layer_style.fillOpacity=0.4;layer_style.fillColor="#FFFFFF";layer_style.strokeColor="#FFFF00";layer_style.strokeWidth=2;layer_style.graphicOpacity=1;mapRes=this.map.getResolution();if(map.getLayersByName("rahmen").length==0){var xl=map.getCenter().lon;var yl=map.getCenter().lat;var frameGeom=new OpenLayers.Bounds(xl-(frameWidth*frameScale)/2,yl-(frameHeight*frameScale)/2,xl+(frameWidth*frameScale)/2,yl+(frameHeight*frameScale)/2).toGeometry();var frameFeat=new OpenLayers.Feature.Vector(frameGeom,null,null);var frameLayer=new OpenLayers.Layer.Vector("rahmen",{style:layer_style,displayInLayerSwitcher:false});frameLayer.addFeatures([frameFeat]);map.addLayer(frameLayer);var dragControl=new OpenLayers.Control.DragFeature(frameLayer);map.addControl(dragControl);dragControl.activate();}
else{var frameLayer=map.getLayersByName("rahmen");var xl=frameLayer[0].features[0].geometry.getBounds().toArray()[0];var yl=frameLayer[0].features[0].geometry.getBounds().toArray()[1];var frameGeom=new OpenLayers.Bounds(xl,yl,xl+(frameWidth*frameScale),yl+(frameHeight*frameScale)).toGeometry();var frameFeat=new OpenLayers.Feature.Vector(frameGeom,null,null);frameLayer[0].removeFeatures(frameLayer[0].features);frameLayer[0].addFeatures([frameFeat]);frameLayer[0].setVisibility(true);}}
function deleteRahmen(){var frameLayer=this.map.getLayersByName("rahmen");frameLayer[0].setVisibility(false);}
function centerRahmen(){var frameLayer=this.map.getLayersByName("rahmen");frameLayer[0].setVisibility(true);if(map.getLayersByName("rahmen").length==0){return;}
var xl=map.getCenter().lon;var yl=map.getCenter().lat;var frameGeom=new OpenLayers.Bounds(xl-(frameWidth*frameScale)/2,yl-(frameHeight*frameScale)/2,xl+(frameWidth*frameScale)/2,yl+(frameHeight*frameScale)/2).toGeometry();var frameFeat=new OpenLayers.Feature.Vector(frameGeom,null,null);var frameLayer=map.getLayersByName("rahmen");frameLayer[0].removeFeatures(frameLayer[0].features);frameLayer[0].addFeatures([frameFeat]);}
function setFrameSize(paperformat,paperorientation){if(paperformat=="A4"){if(paperorientation=="landscape"){frameWidth=0.297-2*marginX-marginTitle;frameHeight=0.210-2*marginY;}
if(paperorientation=="portrait"){frameWidth=0.210-2*marginX;frameHeight=0.297-2*marginY-marginTitle;}}
if(paperformat=="A3"){if(paperorientation=="landscape"){frameWidth=0.420-2*marginX-marginTitle;frameHeight=0.297-2*marginY;}
if(paperorientation=="portrait"){frameWidth=0.297-2*marginX;frameHeight=0.420-2*marginY-marginTitle;}}
if(paperformat=="A2"){if(paperorientation=="landscape"){frameWidth=0.594-2*marginX-marginTitle;frameHeight=0.420-2*marginY;}
if(paperorientation=="portrait"){frameWidth=0.420-2*marginX;frameHeight=0.594-2*marginY-marginTitle;}}
if(paperformat=="A1"){if(paperorientation=="landscape"){frameWidth=0.841-2*marginX-marginTitle;frameHeight=0.594-2*marginY;}
if(paperorientation=="portrait"){frameWidth=0.594-2*marginX;frameHeight=0.841-2*marginY-marginTitle;}}
if(paperformat=="A0"){if(paperorientation=="landscape"){frameWidth=1.189-2*marginX-marginTitle;frameHeight=0.841-2*marginY;}
if(paperorientation=="portrait"){frameWidth=0.841-2*marginX;frameHeight=1.189-2*marginY-marginTitle;}}};OpenLayers.Control.prototype.showWaitMessage=function(){var drawMode=(this.drawMode)?this.drawMode:null;if(!drawMode&&Ext){drawMode="extjs";}
switch(drawMode){case"extjs":case"mapfish":case"geoext":this.waitmessage=Ext.MessageBox.show(this.waitoptions);break;case"html":break;default:}};OpenLayers.Control.prototype.waitmessagebox=null;OpenLayers.Control.prototype.waitoptions={msg:'Action in progress, please wait...',progressText:'Loading...',width:300,wait:true,waitConfig:{interval:200}};OpenLayers.Control.prototype.showWaitMessageBox=function(){var drawMode=(this.drawMode)?this.drawMode:null;if(!drawMode&&Ext){drawMode="extjs";}
switch(drawMode){case"extjs":case"mapfish":case"geoext":this.waitmessagebox=Ext.MessageBox.show(this.waitoptions);break;case"html":break;default:}};OpenLayers.Control.prototype.hideWaitMessageBox=function(){var drawMode=(this.drawMode)?this.drawMode:null;if(!drawMode&&Ext){drawMode="extjs";}
switch(drawMode){case"extjs":case"mapfish":case"geoext":this.waitmessagebox.hide();break;case"html":break;default:}};