/*

  OpenLayers.js -- OpenLayers Map Viewer Library

  Copyright 2005-2008 MetaCarta, Inc., released under the Clear BSD license.
  Please see http://svn.openlayers.org/trunk/openlayers/license.txt
  for the full text of the license.

  Includes compressed code under the following licenses:

  (For uncompressed versions of the code used please see the
  OpenLayers SVN repository: <http://openlayers.org/>)

*/

/* Contains portions of Prototype.js:
 *
 * Prototype JavaScript framework, version 1.4.0
 *  (c) 2005 Sam Stephenson <sam@conio.net>
 *
 *  Prototype is freely distributable under the terms of an MIT-style license.
 *  For details, see the Prototype web site: http://prototype.conio.net/
 *
 *--------------------------------------------------------------------------*/

/**  
*  
*  Contains portions of Rico <http://openrico.org/>
* 
*  Copyright 2005 Sabre Airline Solutions  
*  
*  Licensed under the Apache License, Version 2.0 (the "License"); you
*  may not use this file except in compliance with the License. You
*  may obtain a copy of the License at
*  
*         http://www.apache.org/licenses/LICENSE-2.0  
*  
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
*  implied. See the License for the specific language governing
*  permissions and limitations under the License. 
*
**/

/**
 * Contains XMLHttpRequest.js <http://code.google.com/p/xmlhttprequest/>
 * Copyright 2007 Sergey Ilinsky (http://www.ilinsky.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 */

/**
 * Contains portions of Gears <http://code.google.com/apis/gears/>
 *
 * Copyright 2007, Google Inc.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *  1. Redistributions of source code must retain the above copyright notice,
 *     this list of conditions and the following disclaimer.
 *  2. Redistributions in binary form must reproduce the above copyright notice,
 *     this list of conditions and the following disclaimer in the documentation
 *     and/or other materials provided with the distribution.
 *  3. Neither the name of Google Inc. nor the names of its contributors may be
 *     used to endorse or promote products derived from this software without
 *     specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * Sets up google.gears.*, which is *the only* supported way to access Gears.
 *
 * Circumvent this file at your own risk!
 *
 * In the future, Gears may automatically define google.gears.* without this
 * file. Gears may use these objects to transparently fix bugs and compatibility
 * issues. Applications that use the code below will continue to work seamlessly
 * when that happens.
 */
﻿
function switchLayer(_id){if(_id=="ortho"){map.setBaseLayer(lrOrtho,false);lrOrthoLabel.setVisibility(true);}else if(_id=="ortsplan"){lrOrthoLabel.setVisibility(false);map.setBaseLayer(lrOp,false);}else if(_id=="oek"){lrOrthoLabel.setVisibility(false);map.setBaseLayer(lrOek,false);}else if(_id=="urmappe"){lrOrthoLabel.setVisibility(false);map.setBaseLayer(lrUm,false);}}
function moveToPosition(_position,_setCenter,_zoom,_poiTitle,_includeOptions){addPositionMarker("img/icon.png",_position,_poiTitle,_includeOptions);if(_setCenter){if(map.baseLayer.numZoomLevels>=_zoom){map.setCenter(_position,_zoom);}else{map.setCenter(_position,map.baseLayer.numZoomLevels-1+1,false);}}}
function moveToPositionSearch(_position,_setCenter,_zoom,_poiTitle,_includeOptions){document.getElementById('actualItem').innerHTML="<p class='txtSuggestsOutr'>Aktueller Ausschnitt:<br>"+_poiTitle+"</p>";popup_x=_position.lon;popup_y=_position.lat;if(_poiTitle==null)_poiTitle="";popup_text=_poiTitle;if(_setCenter){if(map.baseLayer.numZoomLevels>=_zoom){map.setCenter(_position,_zoom-1+1,false);addPositionMarker("img/icon.png",_position,_poiTitle,_includeOptions);}else{map.setCenter(_position,map.baseLayer.numZoomLevels-1+1,false);addPositionMarker("img/icon.png",_position,_poiTitle,_includeOptions);}}}
function setContentHeight(){var myWidth=0,myHeight=0;if(typeof(window.innerWidth)=='number'){myWidth=window.innerWidth;myHeight=window.innerHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){myWidth=document.documentElement.clientWidth;myHeight=document.documentElement.clientHeight;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){myWidth=document.body.clientWidth;myHeight=document.body.clientHeight;}
var headheight=111;var buttomheight=16;document.getElementById('map').style.height=(myHeight-headheight-buttomheight)+'px';map.updateSize();$get('leftSideBar').style.height=(myHeight-headheight-buttomheight)+'px';if(myWidth<1060){document.getElementById('copyrightText').style.top=(myHeight-headheight-buttomheight-30)+'px';}else{document.getElementById('copyrightText').style.top=(myHeight-headheight-buttomheight-30)+'px';}
document.getElementById('copyrightImage').style.top=(myHeight-headheight-buttomheight-40)+'px';}
﻿
var map;var lrOek,lrOp,lrUm,lrOrtho,lrOrthoLabel,lrUmLabel1,lrUmLabel2,lrUmAdressen,kmllayer,georsslayer,lrAdressen,overview;var lrLabels,lrIcons,lrOvmap;var popupObject;var allScales=[800000,300000,150000,100000,70000,30000,15000,9000,4000];var mousePosition;var ovcales=[300000];var opscales=[800000,300000,80000,40000,20000,10000,5000,2500];var oekscales=[800000,300000,200000,100000,70000,30000,20000,10000];var umscales=[800000,300000,80000,40000,20000,8000,4000,2000];var ofscales=[800000,300000,80000,40000,20000,10000,5000,2500,1000];var ovscales=[3200000,1600000,800000,300000];var projectionEPSG="EPSG:31255";var urls=["http://ags.doris.at/caches/cache1/","http://ags.doris.at/caches/cache2/"];var kml="";function init(_printView){if(_printView=='false')
log("init");else
log("print");OpenLayers.IMAGE_RELOAD_ATTEMPTS=3;OpenLayers.ProxyHost="proxy.ashx?url=";OpenLayers.Lang.setCode("de");map=new OpenLayers.Map('map',{scales:allScales,units:'m',projection:projectionEPSG,controls:[],eventListeners:{"changebaselayer":mapBaseLayerChanged,"zoomend":mapZoomChanged,"moveend":mapMove}});map.div.oncontextmenu=function noContextMenu(e){handleMapContextClick(e);return false;};var bounds=new OpenLayers.Bounds();bounds.extend(new OpenLayers.LonLat(-100000,237000));bounds.extend(new OpenLayers.LonLat(172000,453000));map.maxExtent=bounds;var restrictbounds=new OpenLayers.Bounds();restrictbounds.extend(new OpenLayers.LonLat(-150000,237000));restrictbounds.extend(new OpenLayers.LonLat(222000,453000));map.restrictedExtent=restrictbounds;lrOp=new OpenLayers.Layer.TileCache("Ortsplan",urls,'ortsplan',{format:'image/png',scales:opscales,transitionEffect:'resize',buffer:1});lrOek=new OpenLayers.Layer.TileCache("Grundkarte (ÖK)",urls,'oek',{format:'image/jpeg',scales:oekscales,transitionEffect:'resize',buffer:1});lrUm=new OpenLayers.Layer.TileCache("Urmappe",urls,'urmappe',{format:'image/jpeg',scales:umscales,transitionEffect:'resize',buffer:1});lrOrtho=new OpenLayers.Layer.TileCache("Orthofoto",urls,'ortho',{format:'image/jpeg',scales:ofscales,transitionEffect:'resize',buffer:1});lrOrthoLabel=new OpenLayers.Layer.TileCache("Beschriftung Straßen",urls,'ortho_label_gif',{format:'image/gif',scales:ofscales,isBaseLayer:false,visibility:false,displayInLayerSwitcher:false,buffer:1});lrUmLabel1=new OpenLayers.Layer.TileCache("Beschriftung Straßen",urls,'ortho_label_gif',{format:'image/gif',scales:[800000,300000,80000,40000,20000],isBaseLayer:false,visibility:false,displayInLayerSwitcher:false,buffer:1});lrUmLabel2=new OpenLayers.Layer.TileCache("Beschriftung Straßen",urls,'urmappe_label',{format:'image/gif',scales:[8000,4000,2000],isBaseLayer:false,visibility:false,displayInLayerSwitcher:false,buffer:1});lrUmAdressen=new OpenLayers.Layer.TileCache("Adressen",urls,'urmappe_adressen',{format:'image/gif',scales:[2000],isBaseLayer:false,visibility:false,displayInLayerSwitcher:false,buffer:1});lrAdressen=new OpenLayers.Layer.TileCache("Adressen",urls,'adressen',{format:'image/gif',scales:[2500,1000],isBaseLayer:false,visibility:true,displayInLayerSwitcher:true,buffer:1});lrIcons=new OpenLayers.Layer.Markers("Punkte",{displayInLayerSwitcher:false});map.addLayers([lrOp,lrOrtho,lrOek,lrUm,lrAdressen,lrOrthoLabel,lrUmLabel1,lrUmLabel2,lrUmAdressen,lrIcons]);map.setCenter(new OpenLayers.LonLat(52000,317000),0);var x=SuchenUndErsetzen(getURLParam("x"),",",".");var y=SuchenUndErsetzen(getURLParam("y"),",",".");var xmin=SuchenUndErsetzen(getURLParam("xmin"),",",".");var ymin=SuchenUndErsetzen(getURLParam("ymin"),",",".");var xmax=SuchenUndErsetzen(getURLParam("xmax"),",",".");var ymax=SuchenUndErsetzen(getURLParam("ymax"),",",".");var zoom=0;zoom=getURLParam("zoom");var layer=getURLParam("layer");var suche=getURLParam("suche");var poitext=getURLParam("text");kml=getURLParam("kml");var georss=getURLParam("georss");var addmarker_x=getURLParam("marker_x");var addmarker_y=getURLParam("marker_y");popup_x=getURLParam("popup_x");popup_y=getURLParam("popup_y");popup_text=getURLParam("popup_text");var params=false;if(getURLParam("x")!=""&&getURLParam("y")!=""&&getURLParam("zoom")!=""){params=true;var pos=new OpenLayers.LonLat();pos.lat=x;pos.lon=y;setTimeout("map.setCenter(new OpenLayers.LonLat("+x+","+y+"),"+zoom+"); ",100);if(poitext!=""&&popup_x==0&&popup_y==0){setTimeout("addPositionMarker('img/icon.png',new OpenLayers.LonLat("+x+","+y+") , '"+poitext+"', '');",250);}}
if(popup_x!=0&&popup_y!=0&&popup_text!=""){document.getElementById('popupText').value=popup_text;setTimeout("addPopUp();",250);}
if(suche!=""){params=true;suche=SuchenUndErsetzen(suche,"+"," ");setTimeout("document.getElementById('txtObfSearch').value = '"+suche+"';",100);setTimeout("search('init');",250);}
if(getURLParam("layer")!=""){params=true;if(layer=="oek"){switchLayer('oek');}
else if(layer=="urmappe"){switchLayer('urmappe');}
else if(layer=="ortho"){switchLayer('ortho');}}
if(xmax!=""&&ymax!=""&&xmin!=""&&ymin!=""){params=true;setTimeout("",250);moveToExtent(xmin,ymin,xmax,ymax);}
if(addmarker_x!=0&&addmarker_y!=0){addMarker(new OpenLayers.LonLat(addmarker_x,addmarker_y));}
if(kml!=""){try{if(_printView=="false"){document.getElementById('loading').style.visibility="visible";}
addKML(kml,_printView);params=true;}
catch(e){alert("Fehler beim Laden der KML-Datei"+e);try{document.getElementById('loading').style.visibility="hidden";}catch(l){}}}
if(georss!=""){try{if(_printView=="false"){document.getElementById('loading').style.visibility="visible";}
addGeoRSS(georss,_printView);params=true;try{document.getElementById('loading').style.visibility="hidden";}catch(l){}}
catch(e){alert("Fehler beim Laden des GeoRSS-Dienstes"+e);try{document.getElementById('loading').style.visibility="hidden";}catch(l){}}}
if(_printView=="false"){map.addControl(new OpenLayers.Control.Navigation());mousePosition=new OpenLayers.Control.MousePosition({displayProjection:projectionEPSG,numDigits:0});map.addControl(mousePosition);map.addControl(new OpenLayers.Control.LayerSwitcher({activeColor:'#335aab'}));map.addControl(new OpenLayers.Control.PanZoomBar({zoomWorldIcon:true}));map.addControl(new OpenLayers.Control.DragPan());map.addControl(new OpenLayers.Control.ScaleLine('scaleLine'));var mapOptions2={maxExtent:new OpenLayers.Bounds(-100000,237000,172000,453000),scales:ovscales,numZoomLevels:2,projection:projectionEPSG,units:"m"};lrOvMap=new OpenLayers.Layer.TileCache("Ortsplan",urls,'overview',{format:'image/jpeg',scales:ovscales});var overview=new OpenLayers.Control.OverviewMap({layers:[lrOvMap],size:new OpenLayers.Size(120,120),minRation:1,mapOptions:mapOptions2})
map.addControl(overview);}
if(_printView=="true"){map.addControl(new OpenLayers.Control.MouseDefaults());map.addControl(new OpenLayers.Control.ScaleLine('scaleLine'));}
if(params==false&&_printView=="false"){map.setCenter(new OpenLayers.LonLat(52000,317000),0);}}
Proj4js={defaultDatum:'WGS84',proxyScript:null,defsLookupService:'http://spatialreference.org/ref',libPath:'proj4js/',transform:function(source,dest,point){if(!source.readyToUse||!dest.readyToUse){this.reportError("Proj4js initialization for "+source.srsCode+" not yet complete");return;}
if(point.transformed){this.log("point already transformed");return;}
if((source.srsProjNumber=="900913"&&dest.datumCode!="WGS84")||(dest.srsProjNumber=="900913"&&source.datumCode!="WGS84")){var wgs84=Proj4js.WGS84;this.transform(source,wgs84,point);point.transformed=false;source=wgs84;}
if(source.projName=="longlat"){point.x*=Proj4js.common.D2R;point.y*=Proj4js.common.D2R;}else{if(source.to_meter){point.x*=source.to_meter;point.y*=source.to_meter;}
source.inverse(point);}
if(source.from_greenwich){point.x+=source.from_greenwich;}
point=this.datum_transform(source.datum,dest.datum,point);if(dest.from_greenwich){point.x-=dest.from_greenwich;}
if(dest.projName=="longlat"){point.x*=Proj4js.common.R2D;point.y*=Proj4js.common.R2D;}else{dest.forward(point);if(dest.to_meter){point.x/=dest.to_meter;point.y/=dest.to_meter;}}
point.transformed=true;return point;},datum_transform:function(source,dest,point){if(source.compare_datums(dest)){return point;}
if(source.datum_type==Proj4js.common.PJD_NODATUM||dest.datum_type==Proj4js.common.PJD_NODATUM){return point;}
if(source.datum_type==Proj4js.common.PJD_GRIDSHIFT)
{alert("ERROR: Grid shift transformations are not implemented yet.");}
if(dest.datum_type==Proj4js.common.PJD_GRIDSHIFT)
{alert("ERROR: Grid shift transformations are not implemented yet.");}
if(source.es!=dest.es||source.a!=dest.a||source.datum_type==Proj4js.common.PJD_3PARAM||source.datum_type==Proj4js.common.PJD_7PARAM||dest.datum_type==Proj4js.common.PJD_3PARAM||dest.datum_type==Proj4js.common.PJD_7PARAM)
{source.geodetic_to_geocentric(point);if(source.datum_type==Proj4js.common.PJD_3PARAM||source.datum_type==Proj4js.common.PJD_7PARAM){source.geocentric_to_wgs84(point);}
if(dest.datum_type==Proj4js.common.PJD_3PARAM||dest.datum_type==Proj4js.common.PJD_7PARAM){dest.geocentric_from_wgs84(point);}
dest.geocentric_to_geodetic(point);}
if(dest.datum_type==Proj4js.common.PJD_GRIDSHIFT)
{alert("ERROR: Grid shift transformations are not implemented yet.");}
return point;},reportError:function(msg){},log:function(msg){},loadProjDefinition:function(proj){if(this.defs[proj.srsCode])return this.defs[proj.srsCode];var options={method:'get',asynchronous:false,onSuccess:this.defsLoadedFromDisk.bind(this,proj.srsCode)}
var url=this.libPath+'defs/'+proj.srsAuth.toUpperCase()+proj.srsProjNumber+'.js';new OpenLayers.Ajax.Request(url,options);if(this.defs[proj.srsCode])return this.defs[proj.srsCode];if(this.proxyScript){var url=this.proxyScript+this.defsLookupService+'/'+proj.srsAuth+'/'+proj.srsProjNumber+'/proj4';options.onSuccess=this.defsLoadedFromService.bind(this,proj.srsCode)
options.onFailure=this.defsFailed.bind(this,proj.srsCode);new OpenLayers.Ajax.Request(url,options);}
return this.defs[proj.srsCode];},defsLoadedFromDisk:function(srsCode,transport){eval(transport.responseText);},defsLoadedFromService:function(srsCode,transport){this.defs[srsCode]=transport.responseText;Proj4js.defs[srsCode]=transport.responseText;},defsFailed:function(srsCode){this.reportError('failed to load projection definition for: '+srsCode);OpenLayers.Util.extend(this.defs[srsCode],this.defs['WGS84']);},loadProjCode:function(projName){if(this.Proj[projName])return;var options={method:'get',asynchronous:false,onSuccess:this.loadProjCodeSuccess.bind(this,projName),onFailure:this.loadProjCodeFailure.bind(this,projName)};var url=this.libPath+'projCode/'+projName+'.js';new OpenLayers.Ajax.Request(url,options);},loadProjCodeSuccess:function(projName,transport){eval(transport.responseText);if(this.Proj[projName].dependsOn){this.loadProjCode(this.Proj[projName].dependsOn);}},loadProjCodeFailure:function(projName){Proj4js.reportError("failed to find projection file for: "+projName);}};Proj4js.Proj=OpenLayers.Class({readyToUse:false,title:null,projName:null,units:null,datum:null,initialize:function(srsCode){this.srsCode=srsCode.toUpperCase();if(this.srsCode.indexOf("EPSG")==0){this.srsCode=this.srsCode;this.srsAuth='epsg';this.srsProjNumber=this.srsCode.substring(5);}else{this.srsAuth='';this.srsProjNumber=this.srsCode;}
var defs=Proj4js.loadProjDefinition(this);if(defs){this.parseDefs(defs);Proj4js.loadProjCode(this.projName);this.callInit();}},callInit:function(){Proj4js.log('projection script loaded for:'+this.projName);OpenLayers.Util.extend(this,Proj4js.Proj[this.projName]);this.init();this.mapXYToLonLat=this.inverse;this.lonLatToMapXY=this.forward;this.readyToUse=true;},parseDefs:function(proj4opts){this.defData=proj4opts;var paramName,paramVal;var paramArray=this.defData.split("+");for(var prop=0;prop<paramArray.length;prop++){var property=paramArray[prop].split("=");paramName=property[0].toLowerCase();paramVal=property[1];switch(paramName.replace(/\s/gi,"")){case"":break;case"title":this.title=paramVal;break;case"proj":this.projName=paramVal.replace(/\s/gi,"");break;case"units":this.units=paramVal.replace(/\s/gi,"");break;case"datum":this.datumCode=paramVal.replace(/\s/gi,"");break;case"nadgrids":this.nagrids=paramVal.replace(/\s/gi,"");break;case"ellps":this.ellps=paramVal.replace(/\s/gi,"");break;case"a":this.a=parseFloat(paramVal);break;case"b":this.b=parseFloat(paramVal);break;case"lat_0":this.lat0=paramVal*Proj4js.common.D2R;break;case"lat_1":this.lat1=paramVal*Proj4js.common.D2R;break;case"lat_2":this.lat2=paramVal*Proj4js.common.D2R;break;case"lat_ts":this.lat_ts=paramVal*Proj4js.common.D2R;break;case"lon_0":this.long0=paramVal*Proj4js.common.D2R;break;case"x_0":this.x0=parseFloat(paramVal);break;case"y_0":this.y0=parseFloat(paramVal);break;case"k_0":this.k0=parseFloat(paramVal);break;case"k":this.k0=parseFloat(paramVal);break;case"R_A":this.R=parseFloat(paramVal);break;case"zone":this.zone=parseInt(paramVal);break;case"south":this.utmSouth=true;break;case"towgs84":this.datum_params=paramVal.split(",");break;case"to_meter":this.to_meter=parseFloat(paramVal);break;case"from_greenwich":this.from_greenwich=paramVal*Proj4js.common.D2R;break;case"pm":paramVal=paramVal.replace(/\s/gi,"");this.from_greenwich=Proj4js.PrimeMeridian[paramVal]?Proj4js.PrimeMeridian[paramVal]*Proj4js.common.D2R:0.0;break;case"no_defs":break;default:Proj4js.log("Unrecognized parameter: "+paramName);}}
this.deriveConstants();},deriveConstants:function(){if(this.nagrids=='@null')this.datumCode='none';if(this.datumCode&&this.datumCode!='none'){var datumDef=Proj4js.Datum[this.datumCode];if(datumDef){this.datum_params=datumDef.towgs84.split(',');this.ellps=datumDef.ellipse;this.datumName=datumDef.datumName;}}
if(!this.a){var ellipse=Proj4js.Ellipsoid[this.ellps]?Proj4js.Ellipsoid[this.ellps]:Proj4js.Ellipsoid['WGS84'];OpenLayers.Util.extend(this,ellipse);}
if(this.rf&&!this.b)this.b=(1.0-1.0/this.rf)*this.a;if(Math.abs(this.a-this.b)<Proj4js.common.EPSLN)this.sphere=true;this.a2=this.a*this.a;this.b2=this.b*this.b;this.es=(this.a2-this.b2)/this.a2;this.e=Math.sqrt(this.es);this.ep2=(this.a2-this.b2)/this.b2;if(!this.k0)this.k0=1.0;this.datum=new Proj4js.datum(this);}});Proj4js.Proj.longlat={init:function(){},forward:function(pt){return pt;},inverse:function(pt){return pt;}};Proj4js.defs={'WGS84':"+title=long/lat:WGS84 +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees",'EPSG:4326':"+title=long/lat:WGS84 +proj=longlat +a=6378137.0 +b=6356752.31424518 +ellps=WGS84 +datum=WGS84 +units=degrees",'EPSG:4269':"+title=long/lat:NAD83 +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"};Proj4js.common={PI:Math.PI,HALF_PI:Math.PI*0.5,TWO_PI:Math.PI*2,FORTPI:0.78539816339744833,R2D:57.2957795131,D2R:0.0174532925199,SEC_TO_RAD:4.84813681109535993589914102357e-6,EPSLN:1.0e-10,MAX_ITER:20,COS_67P5:0.38268343236508977,AD_C:1.0026000,PJD_UNKNOWN:0,PJD_3PARAM:1,PJD_7PARAM:2,PJD_GRIDSHIFT:3,PJD_WGS84:4,PJD_NODATUM:5,SRS_WGS84_SEMIMAJOR:6378137.0,msfnz:function(eccent,sinphi,cosphi){var con=eccent*sinphi;return cosphi/(Math.sqrt(1.0-con*con));},tsfnz:function(eccent,phi,sinphi){var con=eccent*sinphi;var com=.5*eccent;con=Math.pow(((1.0-con)/(1.0+con)),com);return(Math.tan(.5*(this.HALF_PI-phi))/con);},phi2z:function(eccent,ts){var eccnth=.5*eccent;var con,dphi;var phi=this.HALF_PI-2*Math.atan(ts);for(i=0;i<=15;i++){con=eccent*Math.sin(phi);dphi=this.HALF_PI-2*Math.atan(ts*(Math.pow(((1.0-con)/(1.0+con)),eccnth)))-phi;phi+=dphi;if(Math.abs(dphi)<=.0000000001)return phi;}
alert("phi2z has NoConvergence");return(-9999);},qsfnz:function(eccent,sinphi,cosphi){var con;if(eccent>1.0e-7){con=eccent*sinphi;return((1.0-eccent*eccent)*(sinphi/(1.0-con*con)-(.5/eccent)*Math.log((1.0-con)/(1.0+con))));}else{return(2.0*sinphi);}},asinz:function(x){if(Math.abs(x)>1.0){x=(x>1.0)?1.0:-1.0;}
return Math.asin(x);},e0fn:function(x){return(1.0-0.25*x*(1.0+x/16.0*(3.0+1.25*x)));},e1fn:function(x){return(0.375*x*(1.0+0.25*x*(1.0+0.46875*x)));},e2fn:function(x){return(0.05859375*x*x*(1.0+0.75*x));},e3fn:function(x){return(x*x*x*(35.0/3072.0));},mlfn:function(e0,e1,e2,e3,phi){return(e0*phi-e1*Math.sin(2.0*phi)+e2*Math.sin(4.0*phi)-e3*Math.sin(6.0*phi));},srat:function(esinp,exp){return(Math.pow((1.0-esinp)/(1.0+esinp),exp));},sign:function(x){if(x<0.0)return(-1);else return(1);},adjust_lon:function(x){x=(Math.abs(x)<this.PI)?x:(x-(this.sign(x)*this.TWO_PI));return x;}};Proj4js.datum=OpenLayers.Class({initialize:function(proj){this.datum_type=Proj4js.common.PJD_WGS84;if(proj.datumCode&&proj.datumCode=='none'){this.datum_type=Proj4js.common.PJD_NODATUM;}
if(proj&&proj.datum_params){for(var i=0;i<proj.datum_params.length;i++){proj.datum_params[i]=parseFloat(proj.datum_params[i]);}
if(proj.datum_params[0]!=0||proj.datum_params[1]!=0||proj.datum_params[2]!=0){this.datum_type=Proj4js.common.PJD_3PARAM;}
if(proj.datum_params.length>3){if(proj.datum_params[3]!=0||proj.datum_params[4]!=0||proj.datum_params[5]!=0||proj.datum_params[6]!=0){this.datum_type=Proj4js.common.PJD_7PARAM;proj.datum_params[3]*=Proj4js.common.SEC_TO_RAD;proj.datum_params[4]*=Proj4js.common.SEC_TO_RAD;proj.datum_params[5]*=Proj4js.common.SEC_TO_RAD;proj.datum_params[6]=(proj.datum_params[6]/1000000.0)+1.0;}}}
if(proj){this.a=proj.a;this.b=proj.b;this.es=proj.es;this.ep2=proj.ep2;this.datum_params=proj.datum_params;}},compare_datums:function(dest){if(this.datum_type!=dest.datum_type){return false;}else if(this.a!=dest.a||Math.abs(this.es-dest.es)>0.000000000050){return false;}else if(this.datum_type==Proj4js.common.PJD_3PARAM){return(this.datum_params[0]==dest.datum_params[0]&&this.datum_params[1]==dest.datum_params[1]&&this.datum_params[2]==dest.datum_params[2]);}else if(this.datum_type==Proj4js.common.PJD_7PARAM){return(this.datum_params[0]==dest.datum_params[0]&&this.datum_params[1]==dest.datum_params[1]&&this.datum_params[2]==dest.datum_params[2]&&this.datum_params[3]==dest.datum_params[3]&&this.datum_params[4]==dest.datum_params[4]&&this.datum_params[5]==dest.datum_params[5]&&this.datum_params[6]==dest.datum_params[6]);}else if(this.datum_type==Proj4js.common.PJD_GRIDSHIFT){return strcmp(pj_param(this.params,"snadgrids").s,pj_param(dest.params,"snadgrids").s)==0;}else{return true;}},geodetic_to_geocentric:function(p){var Longitude=p.x;var Latitude=p.y;var Height=p.z?p.z:0;var X;var Y;var Z;var Error_Code=0;var Rn;var Sin_Lat;var Sin2_Lat;var Cos_Lat;if(Latitude<-Proj4js.common.HALF_PI&&Latitude>-1.001*Proj4js.common.HALF_PI){Latitude=-Proj4js.common.HALF_PI;}else if(Latitude>Proj4js.common.HALF_PI&&Latitude<1.001*Proj4js.common.HALF_PI){Latitude=Proj4js.common.HALF_PI;}else if((Latitude<-Proj4js.common.HALF_PI)||(Latitude>Proj4js.common.HALF_PI)){Proj4js.reportError('geocent:lat out of range:'+Latitude);return null;}
if(Longitude>Proj4js.common.PI)Longitude-=(2*Proj4js.common.PI);Sin_Lat=Math.sin(Latitude);Cos_Lat=Math.cos(Latitude);Sin2_Lat=Sin_Lat*Sin_Lat;Rn=this.a/(Math.sqrt(1.0e0-this.es*Sin2_Lat));X=(Rn+Height)*Cos_Lat*Math.cos(Longitude);Y=(Rn+Height)*Cos_Lat*Math.sin(Longitude);Z=((Rn*(1-this.es))+Height)*Sin_Lat;p.x=X;p.y=Y;p.z=Z;return Error_Code;},geocentric_to_geodetic:function(p){var genau=1.E-12;var genau2=(genau*genau);var maxiter=30;var P;var RR;var CT;var ST;var RX;var RK;var RN;var CPHI0;var SPHI0;var CPHI;var SPHI;var SDPHI;var At_Pole;var iter;var X=p.x;var Y=p.y;var Z=p.z?p.z:0.0;var Longitude;var Latitude;var Height;At_Pole=false;P=Math.sqrt(X*X+Y*Y);RR=Math.sqrt(X*X+Y*Y+Z*Z);if(P/this.a<genau){At_Pole=true;Longitude=0.0;if(RR/this.a<genau){Latitude=Proj4js.common.HALF_PI;Height=-this.b;return;}}else{Longitude=Math.atan2(Y,X);}
CT=Z/RR;ST=P/RR;RX=1.0/Math.sqrt(1.0-this.es*(2.0-this.es)*ST*ST);CPHI0=ST*(1.0-this.es)*RX;SPHI0=CT*RX;iter=0;do
{iter++;RN=this.a/Math.sqrt(1.0-this.es*SPHI0*SPHI0);Height=P*CPHI0+Z*SPHI0-RN*(1.0-this.es*SPHI0*SPHI0);RK=this.es*RN/(RN+Height);RX=1.0/Math.sqrt(1.0-RK*(2.0-RK)*ST*ST);CPHI=ST*(1.0-RK)*RX;SPHI=CT*RX;SDPHI=SPHI*CPHI0-CPHI*SPHI0;CPHI0=CPHI;SPHI0=SPHI;}
while(SDPHI*SDPHI>genau2&&iter<maxiter);Latitude=Math.atan(SPHI/Math.abs(CPHI));p.x=Longitude;p.y=Latitude;p.z=Height;return p;},geocentric_to_geodetic_noniter:function(p){var X=p.x;var Y=p.y;var Z=p.z?p.z:0;var Longitude;var Latitude;var Height;var W;var W2;var T0;var T1;var S0;var S1;var Sin_B0;var Sin3_B0;var Cos_B0;var Sin_p1;var Cos_p1;var Rn;var Sum;var At_Pole;X=parseFloat(X);Y=parseFloat(Y);Z=parseFloat(Z);At_Pole=false;if(X!=0.0)
{Longitude=Math.atan2(Y,X);}
else
{if(Y>0)
{Longitude=Proj4js.common.HALF_PI;}
else if(Y<0)
{Longitude=-Proj4js.common.HALF_PI;}
else
{At_Pole=true;Longitude=0.0;if(Z>0.0)
{Latitude=Proj4js.common.HALF_PI;}
else if(Z<0.0)
{Latitude=-Proj4js.common.HALF_PI;}
else
{Latitude=Proj4js.common.HALF_PI;Height=-this.b;return;}}}
W2=X*X+Y*Y;W=Math.sqrt(W2);T0=Z*Proj4js.common.AD_C;S0=Math.sqrt(T0*T0+W2);Sin_B0=T0/S0;Cos_B0=W/S0;Sin3_B0=Sin_B0*Sin_B0*Sin_B0;T1=Z+this.b*this.ep2*Sin3_B0;Sum=W-this.a*this.es*Cos_B0*Cos_B0*Cos_B0;S1=Math.sqrt(T1*T1+Sum*Sum);Sin_p1=T1/S1;Cos_p1=Sum/S1;Rn=this.a/Math.sqrt(1.0-this.es*Sin_p1*Sin_p1);if(Cos_p1>=Proj4js.common.COS_67P5)
{Height=W/Cos_p1-Rn;}
else if(Cos_p1<=-Proj4js.common.COS_67P5)
{Height=W/-Cos_p1-Rn;}
else
{Height=Z/Sin_p1+Rn*(this.es-1.0);}
if(At_Pole==false)
{Latitude=Math.atan(Sin_p1/Cos_p1);}
p.x=Longitude;p.y=Latitude;p.z=Height;return p;},geocentric_to_wgs84:function(p){if(this.datum_type==Proj4js.common.PJD_3PARAM)
{p.x+=this.datum_params[0];p.y+=this.datum_params[1];p.z+=this.datum_params[2];}
else if(this.datum_type==Proj4js.common.PJD_7PARAM)
{var Dx_BF=this.datum_params[0];var Dy_BF=this.datum_params[1];var Dz_BF=this.datum_params[2];var Rx_BF=this.datum_params[3];var Ry_BF=this.datum_params[4];var Rz_BF=this.datum_params[5];var M_BF=this.datum_params[6];var x_out=M_BF*(p.x-Rz_BF*p.y+Ry_BF*p.z)+Dx_BF;var y_out=M_BF*(Rz_BF*p.x+p.y-Rx_BF*p.z)+Dy_BF;var z_out=M_BF*(-Ry_BF*p.x+Rx_BF*p.y+p.z)+Dz_BF;p.x=x_out;p.y=y_out;p.z=z_out;}},geocentric_from_wgs84:function(p){if(this.datum_type==Proj4js.common.PJD_3PARAM)
{p.x-=this.datum_params[0];p.y-=this.datum_params[1];p.z-=this.datum_params[2];}
else if(this.datum_type==Proj4js.common.PJD_7PARAM)
{var Dx_BF=this.datum_params[0];var Dy_BF=this.datum_params[1];var Dz_BF=this.datum_params[2];var Rx_BF=this.datum_params[3];var Ry_BF=this.datum_params[4];var Rz_BF=this.datum_params[5];var M_BF=this.datum_params[6];var x_tmp=(p.x-Dx_BF)/M_BF;var y_tmp=(p.y-Dy_BF)/M_BF;var z_tmp=(p.z-Dz_BF)/M_BF;p.x=x_tmp+Rz_BF*y_tmp-Ry_BF*z_tmp;p.y=-Rz_BF*x_tmp+y_tmp+Rx_BF*z_tmp;p.z=Ry_BF*x_tmp-Rx_BF*y_tmp+z_tmp;}}});Proj4js.Point=OpenLayers.Class({initialize:function(x,y,z){if(typeof x=='object'){this.x=x[0];this.y=x[1];this.z=x[2]||0.0;}else{this.x=x;this.y=y;this.z=z||0.0;}},clone:function(){return new Proj4js.Point(this.x,this.y,this.z);},toString:function(){return("x="+this.x+",y="+this.y);},toShortString:function(){return(this.x+", "+this.y);}});Proj4js.PrimeMeridian={"greenwich":0.0,"lisbon":-9.131906111111,"paris":2.337229166667,"bogota":-74.080916666667,"madrid":-3.687938888889,"rome":12.452333333333,"bern":7.439583333333,"jakarta":106.807719444444,"ferro":-17.666666666667,"brussels":4.367975,"stockholm":18.058277777778,"athens":23.7163375,"oslo":10.722916666667};Proj4js.Ellipsoid={"MERIT":{a:6378137.0,rf:298.257,ellipseName:"MERIT 1983"},"SGS85":{a:6378136.0,rf:298.257,ellipseName:"Soviet Geodetic System 85"},"GRS80":{a:6378137.0,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},"IAU76":{a:6378140.0,rf:298.257,ellipseName:"IAU 1976"},"airy":{a:6377563.396,b:6356256.910,ellipseName:"Airy 1830"},"APL4.":{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},"NWL9D":{a:6378145.0,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},"mod_airy":{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},"andrae":{a:6377104.43,rf:300.0,ellipseName:"Andrae 1876 (Den., Iclnd.)"},"aust_SA":{a:6378160.0,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},"GRS67":{a:6378160.0,rf:298.2471674270,ellipseName:"GRS 67(IUGG 1967)"},"bessel":{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},"bess_nam":{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},"clrk66":{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},"clrk80":{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},"CPM":{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},"delmbr":{a:6376428.0,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},"engelis":{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},"evrst30":{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},"evrst48":{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},"evrst56":{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},"evrst69":{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},"evrstSS":{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},"fschr60":{a:6378166.0,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},"fschr60m":{a:6378155.0,rf:298.3,ellipseName:"Fischer 1960"},"fschr68":{a:6378150.0,rf:298.3,ellipseName:"Fischer 1968"},"helmert":{a:6378200.0,rf:298.3,ellipseName:"Helmert 1906"},"hough":{a:6378270.0,rf:297.0,ellipseName:"Hough"},"intl":{a:6378388.0,rf:297.0,ellipseName:"International 1909 (Hayford)"},"kaula":{a:6378163.0,rf:298.24,ellipseName:"Kaula 1961"},"lerch":{a:6378139.0,rf:298.257,ellipseName:"Lerch 1979"},"mprts":{a:6397300.0,rf:191.0,ellipseName:"Maupertius 1738"},"new_intl":{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},"plessis":{a:6376523.0,rf:6355863.0,ellipseName:"Plessis 1817 (France)"},"krass":{a:6378245.0,rf:298.3,ellipseName:"Krassovsky, 1942"},"SEasia":{a:6378155.0,b:6356773.3205,ellipseName:"Southeast Asia"},"walbeck":{a:6376896.0,b:6355834.8467,ellipseName:"Walbeck"},"WGS60":{a:6378165.0,rf:298.3,ellipseName:"WGS 60"},"WGS66":{a:6378145.0,rf:298.25,ellipseName:"WGS 66"},"WGS72":{a:6378135.0,rf:298.26,ellipseName:"WGS 72"},"WGS84":{a:6378137.0,rf:298.257223563,ellipseName:"WGS 84"},"sphere":{a:6370997.0,b:6370997.0,ellipseName:"Normal Sphere (r=6370997)"}};Proj4js.Datum={"WGS84":{towgs84:"0,0,0",ellipse:"WGS84",datumName:""},"GGRS87":{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},"NAD83":{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},"NAD27":{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},"potsdam":{towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},"carthage":{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},"hermannskogel":{towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},"ire65":{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},"nzgd49":{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},"OSGB36":{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"}};Proj4js.WGS84=new Proj4js.Proj('WGS84');Proj4js.Datum['OSB36']=Proj4js.Datum['OSGB36'];Proj4js.Proj.tmerc={init:function(){this.e0=Proj4js.common.e0fn(this.es);this.e1=Proj4js.common.e1fn(this.es);this.e2=Proj4js.common.e2fn(this.es);this.e3=Proj4js.common.e3fn(this.es);this.ml0=this.a*Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,this.lat0);},forward:function(p){var lon=p.x;var lat=p.y;var delta_lon=Proj4js.common.adjust_lon(lon-this.long0);var con;var x,y;var sin_phi=Math.sin(lat);var cos_phi=Math.cos(lat);if(this.sphere){var b=cos_phi*Math.sin(delta_lon);if((Math.abs(Math.abs(b)-1.0))<.0000000001){Proj4js.reportError("tmerc:forward: Point projects into infinity");return(93);}else{x=.5*this.a*this.k0*Math.log((1.0+b)/(1.0-b));con=Math.acos(cos_phi*Math.cos(delta_lon)/Math.sqrt(1.0-b*b));if(lat<0)con=-con;y=this.a*this.k0*(con-this.lat0);}}else{var al=cos_phi*delta_lon;var als=Math.pow(al,2);var c=this.ep2*Math.pow(cos_phi,2);var tq=Math.tan(lat);var t=Math.pow(tq,2);con=1.0-this.es*Math.pow(sin_phi,2);var n=this.a/Math.sqrt(con);var ml=this.a*Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,lat);x=this.k0*n*al*(1.0+als/6.0*(1.0-t+c+als/20.0*(5.0-18.0*t+Math.pow(t,2)+72.0*c-58.0*this.ep2)))+this.x0;y=this.k0*(ml-this.ml0+n*tq*(als*(0.5+als/24.0*(5.0-t+9.0*c+4.0*Math.pow(c,2)+als/30.0*(61.0-58.0*t+Math.pow(t,2)+600.0*c-330.0*this.ep2)))))+this.y0;}
p.x=x;p.y=y;return p;},inverse:function(p){var con,phi;var delta_phi;var i;var max_iter=6;var lat,lon;if(this.sphere){var f=Math.exp(p.x/(this.a*this.k0));var g=.5*(f-1/f);var temp=this.lat0+p.y/(this.a*this.k0);var h=Math.cos(temp);con=Math.sqrt((1.0-h*h)/(1.0+g*g));lat=Math.asinz(con);if(temp<0)
lat=-lat;if((g==0)&&(h==0)){lon=this.long0;}else{lon=Proj4js.common.adjust_lon(Math.atan2(g,h)+this.long0);}}else{var x=p.x-this.x0;var y=p.y-this.y0;con=(this.ml0+y/this.k0)/this.a;phi=con;for(i=0;;i++){delta_phi=((con+this.e1*Math.sin(2.0*phi)-this.e2*Math.sin(4.0*phi)+this.e3*Math.sin(6.0*phi))/this.e0)-phi;phi+=delta_phi;if(Math.abs(delta_phi)<=Proj4js.common.EPSLN)break;if(i>=max_iter){Proj4js.reportError("tmerc:inverse: Latitude failed to converge");return(95);}}
if(Math.abs(phi)<Proj4js.common.HALF_PI){var sin_phi=Math.sin(phi);var cos_phi=Math.cos(phi);var tan_phi=Math.tan(phi);var c=this.ep2*Math.pow(cos_phi,2);var cs=Math.pow(c,2);var t=Math.pow(tan_phi,2);var ts=Math.pow(t,2);con=1.0-this.es*Math.pow(sin_phi,2);var n=this.a/Math.sqrt(con);var r=n*(1.0-this.es)/con;var d=x/(n*this.k0);var ds=Math.pow(d,2);lat=phi-(n*tan_phi*ds/r)*(0.5-ds/24.0*(5.0+3.0*t+10.0*c-4.0*cs-9.0*this.ep2-ds/30.0*(61.0+90.0*t+298.0*c+45.0*ts-252.0*this.ep2-3.0*cs)));lon=Proj4js.common.adjust_lon(this.long0+(d*(1.0-ds/6.0*(1.0+2.0*t+c-ds/20.0*(5.0-2.0*c+28.0*t-3.0*cs+8.0*this.ep2+24.0*ts)))/cos_phi));}else{lat=Proj4js.common.HALF_PI*Proj4js.common.sign(y);lon=this.long0;}}
p.x=lon;p.y=lat;return p;}};Proj4js.defs["EPSG:31255"]="+title=MGI M31 EPSG:31255 +proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1.000000 +x_0=0 +y_0=-5000000 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m +no_defs";﻿
function start(){switchLeftSideBar("init");init('false');setContentHeight();}
function search(layername){try{map.removeLayer(kmllayer);}
catch(e){}
log("search");switchLeftSideBar("on");var text=$get("txtObfSearch").value;if(layername=="init"){suchparam=new Array(text,"init");}
else{suchparam=new Array(text,map.baseLayer.name);}
DorisEasy.WebService.makeQuery(suchparam,OnSuccess,onError);}
function OnSuccess(_result){document.getElementById('foundItems').innerHTML=_result[0];if(_result[2]!=""){document.getElementById('actualItem').innerHTML=_result[2];document.getElementById('actualItem').style.visibility='visible';}
else{document.getElementById('actualItem').innerHTML="";document.getElementById('actualItem').style.visibility='hidden';map.zoomToMaxExtent();}
var arrResultsPart=_result[1].split(';');if(arrResultsPart.length==5){moveToExtent(SuchenUndErsetzen(arrResultsPart[1],',','.'),SuchenUndErsetzen(arrResultsPart[2],',','.'),SuchenUndErsetzen(arrResultsPart[3],',','.'),SuchenUndErsetzen(arrResultsPart[4],',','.'));}
else if(arrResultsPart.length==4){moveToPositionSearch(new OpenLayers.LonLat(SuchenUndErsetzen(arrResultsPart[1],',','.'),SuchenUndErsetzen(arrResultsPart[2],',','.')),true,arrResultsPart[3],arrResultsPart[0],false);}
if(_result[3].toString()=="True"){switchLayer('oek');}}
function onError(){alert("Fehler beim Abrufen der Suchvorschläge!");}
function switchLeftSideBar(_mode){if(_mode=="on"){document.getElementById('leftSideBar').style.visibility='visible';document.getElementById('outer').style.paddingLeft='305px';document.getElementById('leftSideBarSwitcher').style.visibility='visible';document.getElementById('leftSideBarSwitcher').style.left='305px';document.getElementById('leftSideBarSwitcherIcon').src='img/sidebar-switch-off.png';document.getElementById('actualItem').style.visibility='visible';}
else if(_mode=="init"){document.getElementById('leftSideBar').style.visibility='hidden';document.getElementById('leftSideBarSwitcher').style.visibility='hidden';}
else{if(document.getElementById('leftSideBar').style.visibility!='hidden'){document.getElementById('leftSideBar').style.visibility='hidden';document.getElementById('actualItem').style.visibility='hidden';document.getElementById('outer').style.paddingLeft='0px';document.getElementById('leftSideBarSwitcher').style.left='4px';document.getElementById('leftSideBarSwitcherIcon').src='img/sidebar-switch-on.png';}else{document.getElementById('leftSideBar').style.visibility='visible';document.getElementById('actualItem').style.visibility='visible';document.getElementById('outer').style.paddingLeft='305px';document.getElementById('leftSideBarSwitcher').style.visibility='visible';document.getElementById('leftSideBarSwitcher').style.left='305px';document.getElementById('leftSideBarSwitcherIcon').src='img/sidebar-switch-off.png';}}}
﻿
function handleMapContextClick(evt){var actPos=map.getLonLatFromPixel(mousePosition.lastXy);var divPosLeft=mousePosition.lastXy.x;var divPosTop=mousePosition.lastXy.y;var divH=document.getElementById('mapContextMenu').offsetHeight;var divW=document.getElementById('mapContextMenu').offsetWidth;if((divPosTop+divH)>map.getSize().h){divPosTop-=divH;}
if((divPosLeft+divW)>map.getSize().w){divPosLeft-=divW;}
document.getElementById('mapContextMenu').style.top=divPosTop+5+'px';document.getElementById('mapContextMenu').style.left=divPosLeft+'px';document.getElementById('mapContextMenu').style.visibility='visible';var contentMenu="";contentMenu+="<a href='#' onclick='createPopUp(new OpenLayers.LonLat("+actPos.lon+","+actPos.lat+"));closeContextMenu();'>Sprechblase erstellen</a><br />";contentMenu+="<a href='#' onclick='addMarker(new OpenLayers.LonLat("+actPos.lon+","+actPos.lat+"));closeContextMenu();'>Marker setzen</a><br />";contentMenu+="<a href='#' onclick='showCoordinatesPopup(new OpenLayers.LonLat("+actPos.lon+","+actPos.lat+")); closeContextMenu();'>Koordinaten abfragen</a><br />";contentMenu+="<a href='#' onclick='removeMarker();closeContextMenu();'>Marker löschen</a><br />";contentMenu+="<a href='#' onclick='map.zoomIn(); closeContextMenu();'>Vergrößern</a><br />";contentMenu+="<a href='#' onclick='map.zoomOut(); closeContextMenu();'>Verkleinern</a><br />";contentMenu+="<a href='#' onclick='map.panTo(new OpenLayers.LonLat("+actPos.lon+","+actPos.lat+")); closeContextMenu();'>Karte hier zentrieren</a><br />";document.getElementById('mapContextMenu').innerHTML=contentMenu;return false;}
function closeContextMenu(){document.getElementById('mapContextMenu').style.visibility='hidden';}
function showCoordinatesPopup(_pos){removePopUP();var gkm31=new OpenLayers.Projection("EPSG:31255");var wgs84=new OpenLayers.Projection("EPSG:4326");var posWgs84=new OpenLayers.LonLat(_pos.lon,_pos.lat);var posWgs84=posWgs84.transform(gkm31,wgs84);var popupFeature=new OpenLayers.Feature(lrIcons,_pos);popupFeature.popupClass=OpenLayers.Popup.FramedCloud;var content="<div class='popupCoordinatesFrame'>";content+="<h1>Koordinaten</h1>";content+="<div>MGI31: "+(Math.round((_pos.lon)*100)/100)+", "+(Math.round((_pos.lat)*100)/100)+"</div>";content+="<div>WGS84: "+(Math.round(posWgs84.lon*100000)/100000)+", "+(Math.round(posWgs84.lat*100000)/100000)+"</div>";content+="</div>";content+="</div>";var size=new OpenLayers.Size(100,100);var popupObject=popupFeature.createPopup({minSize:size,maxSize:size,autoSize:false});popupObject.contentHTML=content;map.addPopup(popupObject);acutalPopUp=popupObject;}
function getMapLink(_print){log("createlink");var center=map.getCenter();var url=document.URL;if(url.indexOf("?")>-1){url=Left(url,url.indexOf("?"));}
if(_print=='true'){if(url.indexOf("Default.aspx")>-1){url=url.replace("Default.aspx","Print.aspx");}
else{if(_print=='true'){url=url+"Print.aspx";}
else{url=url+"Default.aspx";}}}
url=url+"?x="+Math.round(center.lon)+"&y="+Math.round(center.lat)+"&zoom="+map.getZoom();url=url.replace("#","");if(map.baseLayer==lrOrtho){url+="&layer=ortho";}
else if(map.baseLayer==lrOek){url+="&layer=oek";}
else if(map.baseLayer==lrUm){url+="&layer=urmappe";}
if(kml!=undefined&&kml!=""){url+="&kml="+kml;}
if(marker_x!=0&&marker_y!=0){url+="&marker_x="+Math.round(marker_x)+"&marker_y="+Math.round(marker_y);}
if(popup_x!=0&&popup_y!=0&&popup_text!=""){popup_text=SuchenUndErsetzen(popup_text,"<BR/>","vbCrLf");popup_text=SuchenUndErsetzen(popup_text,"<BR />","vbCrLf");popup_text=SuchenUndErsetzen(popup_text,"<br/>","vbCrLf");popup_text=SuchenUndErsetzen(popup_text,"<br />","vbCrLf");popup_text=SuchenUndErsetzen(popup_text,"$","%24");popup_text=SuchenUndErsetzen(popup_text,"&","%26");popup_text=SuchenUndErsetzen(popup_text,"+","%2B");popup_text=SuchenUndErsetzen(popup_text,",","%2C");popup_text=SuchenUndErsetzen(popup_text,"/","%2D");popup_text=SuchenUndErsetzen(popup_text,":","%3A");popup_text=SuchenUndErsetzen(popup_text,";","%3B");popup_text=SuchenUndErsetzen(popup_text,"=","%3D");popup_text=SuchenUndErsetzen(popup_text,"?","%3F");popup_text=SuchenUndErsetzen(popup_text,"@","%40");popup_text=SuchenUndErsetzen(popup_text," ","+");url+="&popup_x="+Math.round(popup_x)+"&popup_y="+Math.round(popup_y)+"&popup_text="+encodeURI(popup_text);}
if(_print=='encoded'){url=SuchenUndErsetzen(url,"&","%26");}
return url;}
function setLinkMenu(){document.getElementById('linkMenuText').value=getMapLink('false');document.getElementById('linkMenu').style.visibility='visible';document.getElementById('linkMenuText').focus();document.getElementById('linkMenuText').select();}
function closeMenus(){document.getElementById('mapContextMenu').style.visibility='hidden';document.getElementById('linkMenu').style.visibility='hidden';document.getElementById('popupMenu').style.visibility='hidden';}
function getDorisAtlasLink(){log('linkdorisatlas');var lnk="http://doris.ooe.gv.at/viewer/init.aspx?ks=alk&aufruf=easy";if(map.baseLayer==lrOrtho){lnk+="&karte=adr&sichtbar=Orthofoto+Speed;Verwaltungsgrenzen&unsichtbar=Ortsplan";}
else if(map.baseLayer==lrOek){lnk+="&karte=adr&sichtbar=%C3%96sterr.+Grundkarte;Orthofoto;Verwaltungsgrenzen&unsichtbar=Ortsplan";}
else if(map.baseLayer==lrUm){lnk+="&karte=urmappe&unsichtbar=%C3%96sterr.+Grundkarte";}else if(map.baseLayer==lrOp){lnk+="&karte=adr";}
var center=map.getCenter();var y=center.lat;var x=center.lon;var scale=map.getScale();lnk+="&koord="+Math.round(x)+";"+Math.round(y)+"&massstab="+Math.round(scale);return lnk;}
function onPopupClose(evt){selectControl.unselect(selectedFeature);}
﻿
function mapMove(evt){log("move");}
function mapZoomChanged(evt){log("zoom");if(map.baseLayer==lrUm){try{if(map.getZoom()>4){lrUmLabel1.displayInLayerSwitcher=false;lrUmLabel1.setVisibility(false);lrUmLabel2.displayInLayerSwitcher=true;lrUmLabel2.setVisibility(true);}
else{lrUmLabel1.displayInLayerSwitcher=true;lrUmLabel1.setVisibility(true);lrUmLabel2.displayInLayerSwitcher=false;lrUmLabel2.setVisibility(false);}}catch(e){}}else{lrUmLabel1.displayInLayerSwitcher=false;lrUmLabel1.setVisibility(false);lrUmLabel2.displayInLayerSwitcher=false;lrUmLabel2.setVisibility(false);}}
function mapBaseLayerChanged(evt){log("changelayer");if(map.baseLayer==lrOrtho){try{lrOrthoLabel.displayInLayerSwitcher=true;lrOrthoLabel.setVisibility(true);lrAdressen.displayInLayerSwitcher=true;lrAdressen.setVisibility(true);lrUmLabel1.displayInLayerSwitcher=false;lrUmLabel1.setVisibility(false);lrUmLabel2.displayInLayerSwitcher=false;lrUmLabel2.setVisibility(false);lrUmAdressen.displayInLayerSwitcher=false;lrUmAdressen.setVisibility(false);}catch(e){}}
else if(map.baseLayer==lrUm){try{lrOrthoLabel.displayInLayerSwitcher=false;lrOrthoLabel.setVisibility(false);lrAdressen.displayInLayerSwitcher=false;lrAdressen.setVisibility(false);lrUmAdressen.displayInLayerSwitcher=true;lrUmAdressen.setVisibility(true);if(map.getZoom()>4){lrUmLabel1.displayInLayerSwitcher=false;lrUmLabel1.setVisibility(false);lrUmLabel2.displayInLayerSwitcher=true;lrUmLabel2.setVisibility(true);}
else{lrUmLabel1.displayInLayerSwitcher=true;lrUmLabel1.setVisibility(true);lrUmLabel2.displayInLayerSwitcher=false;lrUmLabel2.setVisibility(false);}}catch(e){}}
else if(map.baseLayer==lrOp){lrOrthoLabel.displayInLayerSwitcher=false;lrOrthoLabel.setVisibility(false);lrUmLabel1.displayInLayerSwitcher=false;lrUmLabel1.setVisibility(false);lrUmLabel2.displayInLayerSwitcher=false;lrUmLabel2.setVisibility(false);lrAdressen.displayInLayerSwitcher=true;lrAdressen.setVisibility(true);lrUmAdressen.displayInLayerSwitcher=false;lrUmAdressen.setVisibility(false);}
else{try{lrOrthoLabel.displayInLayerSwitcher=false;lrOrthoLabel.setVisibility(false);lrUmLabel1.displayInLayerSwitcher=false;lrUmLabel1.setVisibility(false);lrUmLabel2.displayInLayerSwitcher=false;lrUmLabel2.setVisibility(false);lrAdressen.displayInLayerSwitcher=false;lrAdressen.setVisibility(false);lrUmAdressen.displayInLayerSwitcher=false;lrUmAdressen.setVisibility(false);}catch(e){}}}
function moveToExtent(xmin,ymin,xmax,ymax){var ext=new OpenLayers.Bounds();ext.extend(new OpenLayers.LonLat(xmin,ymin));ext.extend(new OpenLayers.LonLat(xmax,ymax));var xx=ext.left+(ext.right-ext.left)/2;var yy=ext.bottom+(ext.top-ext.bottom)/2;var zooom=map.getZoomForExtent(ext,true);map.setCenter(new OpenLayers.LonLat(xx,yy),zooom,false);}
function removeMarker(){try{lrIcons.removeMarker(marker);marker_x=0;marker_y=0;}catch(_exc){}}
var marker;var marker_x=0,marker_y=0;function addMarker(_pos){removeMarker();var calculateOffset=function(size){return new OpenLayers.Pixel(-(size.w/2),-size.h);};var sz=new OpenLayers.Size(30,30);icon=new OpenLayers.Icon("img/icon.png",sz,null,calculateOffset);marker=new OpenLayers.Marker(_pos,icon);marker_x=_pos.lon;marker_y=_pos.lat;lrIcons.addMarker(marker);}
function addKML(url,printview){try{log("kml");var style=new OpenLayers.Style({'externalGraphic':"./img/marker_red.png",'graphicHeight':25,'graphicWidth':23,'graphicXOffset':-10.5,'graphicYOffset':-12.5,'fillColor':"#e9282c",'fillOpacity':"0.7",'fill':"false"});var styleMap=new OpenLayers.StyleMap({'default':style});var kmlparser=new OpenLayers.Format.KML({'extractStyles':true,'extractAttributes':true,'internalProjection':new OpenLayers.Projection("EPSG:31255"),'externalProjection':new OpenLayers.Projection("EPSG:4326"),'maxDepth':2});kmllayer=new OpenLayers.Layer.Vector("KML "+getUrlFilename(url,"kml"),{isBaseLayer:false,strategies:[new OpenLayers.Strategy.Fixed()],protocol:new OpenLayers.Protocol.HTTP
({url:url,format:kmlparser})});map.addLayer(kmllayer);if(printview=="false"){kmllayer.events.register("loadend",kmllayer,zoomKML);}
selectControl=new OpenLayers.Control.SelectFeature(kmllayer,{onSelect:onFeatureSelect,onUnselect:onFeatureUnselect});map.addControl(selectControl);selectControl.activate();}
catch(e){}}
function addGeoRSS(url,printview){log("georss");var style=new OpenLayers.Style({'externalGraphic':"./img/marker_red.png",'graphicHeight':25,'graphicWidth':23,'graphicXOffset':-10.5,'graphicYOffset':-12.5,'fillColor':"#e9282c",'fillOpacity':"0.7",'fill':"false"});var styleMap=new OpenLayers.StyleMap({'default':style});var parser=new OpenLayers.Format.GeoRSS({'internalProjection':new OpenLayers.Projection("EPSG:31255"),'externalProjection':new OpenLayers.Projection("EPSG:4326")});georsslayer=new OpenLayers.Layer.Vector("GeoRSS "+getUrlFilename(url,"GeoRss"),{isBaseLayer:false,styleMap:styleMap,strategies:[new OpenLayers.Strategy.Fixed()],protocol:new OpenLayers.Protocol.HTTP
({url:url,format:parser})});map.addLayer(georsslayer);selectControl=new OpenLayers.Control.SelectFeature(georsslayer,{onSelect:onFeatureSelectGeoRSS,onUnselect:onFeatureUnselect});map.addControl(selectControl);selectControl.activate();}
function zoomKML(){var tempext=kmllayer.getDataExtent();moveToExtent(tempext.left-100,tempext.bottom-100,tempext.right+100,tempext.top+100);try{document.getElementById('loading').style.visibility="hidden";}catch(e){}}
function onFeatureSelect(feature){selectedFeature=feature;var content="";if(feature.attributes.description==undefined){content=feature.attributes.name;}
else{content="<b>"+feature.attributes.name+"</b><br/>"+feature.attributes.description;}
if(content.search("<script")!=-1){content="Beinhaltet Javascript! Script gesperrt.<br />"+content.replace(/</g,"&lt;");}
popup=new OpenLayers.Popup.FramedCloud("chicken",feature.geometry.getBounds().getCenterLonLat(),null,content,null,true,onPopUpClose);feature.popup=popup;map.addPopup(popup);}
function onFeatureSelectGeoRSS(feature){var selectedFeature=feature;var content="";content="<b>"+feature.attributes.title+"</b><br/>"+feature.attributes.description;if(content.search("<script")!=-1){content="Beinhaltet Javascript! Script gesperrt.<br />"+content.replace(/</g,"&lt;");}
popup=new OpenLayers.Popup.FramedCloud("chicken",feature.geometry.getBounds().getCenterLonLat(),null,content,null,true,onPopUpClose);feature.popup=popup;map.addPopup(popup);}
function onFeatureUnselect(feature){map.removePopup(feature.popup);feature.popup.destroy();feature.popup=null;}
function SuchenUndErsetzen(QuellText,SuchText,ErsatzText){if((QuellText==null)||(SuchText==null)){return null;}
if((QuellText.length==0)||(SuchText.length==0)){return QuellText;}
if((ErsatzText==null)||(ErsatzText.length==0)){ErsatzText="";}
var LaengeSuchText=SuchText.length;var LaengeErsatzText=ErsatzText.length;var Pos=QuellText.indexOf(SuchText,0);while(Pos>=0){QuellText=QuellText.substring(0,Pos)+ErsatzText+QuellText.substring(Pos+LaengeSuchText);Pos=QuellText.indexOf(SuchText,Pos+LaengeErsatzText);}
return QuellText;}
function log(logevent){var number=Math.floor(Math.random()*11);var config={method:"GET",url:"Log.ashx",proxy:"",params:{"eTEvent":logevent,"id":number}}
OpenLayers.Request.issue(config);}
﻿
function getURLParam(_paramName){var strReturn="";var strHref=window.location.href;strHref=decodeURI(strHref);if(strHref.indexOf("?")>-1){var strQueryString=strHref.substr(strHref.indexOf("?"));if(_paramName.toLowerCase()!="kml"&&_paramName.toLowerCase()!="georss"){var aQueryString=strQueryString.split("&");for(var iParam=0;iParam<aQueryString.length;iParam++){if(aQueryString[iParam].indexOf(_paramName.toLowerCase()+"=")>-1){var aParam=aQueryString[iParam].split("=");strReturn=aParam[1];break;}}}
else if(_paramName.toLowerCase()=="kml"){try{if(strQueryString.indexOf("kml=")>-1){var aQueryString=strQueryString.split("kml=");strReturn=aQueryString[1];}
else{strReturn="";}}catch(e){strReturn="";}}
else if(_paramName.toLowerCase()=="georss"){try{if(strQueryString.indexOf("georss=")>-1){var aQueryString=strQueryString.split("georss=");strReturn=aQueryString[1];}else{strReturn="";}}catch(e){strReturn="";}}}
return unescape(strReturn);}
function extround(zahl,n_stelle){zahl=(Math.round(zahl*n_stelle)/n_stelle);return zahl;}
function Left(str,n){if(n<=0)
return"";else if(n>String(str).length)
return str;else
return String(str).substring(0,n);}
function openPrintwindow(){var link=getMapLink('true');var printwindow=window.open(link,"","width=700,height=760,toolbar=no,scrollbars=yes");printwindow.focus();}
function getUrlFilename(url,alternative){try{return url.substring(url.lastIndexOf('/')+1);}catch(e){return alternative;}}
﻿
var popup;var popup_x=0;var popup_y=0;var popup_text="";function addPositionMarker(_iconUrl,_pos,_poiTitle){if(_poiTitle==null)_poiTitle="";removeMarker();marker_x=_pos.lon;marker_y=_pos.lat;var sz=new OpenLayers.Size(30,30);var calculateOffset=function(size){return new OpenLayers.Pixel(-(size.w/2),-size.h);};icon=new OpenLayers.Icon(_iconUrl,sz,null,calculateOffset);marker=new OpenLayers.Marker(_pos,icon);lrIcons.addMarker(marker);_poiTitle=SuchenUndErsetzen(_poiTitle,"vbCrLf","<BR/>");_poiTitle=SuchenUndErsetzen(_poiTitle,"+"," ");var content="";content="<div class='popupFrame'>";content+="<h1><div id='poiTitle'>"+_poiTitle+"</div></h1>";content+="</div>";popup=new OpenLayers.Popup.FramedCloud("chicken",_pos,null,content,null,true,onPopUpClose);popup.autoSize=true;map.addPopup(popup,true);}
function createPopUp(_pos){popup_x=_pos.lon;popup_y=_pos.lat;document.getElementById('popupMenu').style.visibility='visible';document.getElementById('popupText').focus();}
function addPopUp(){popup_text=document.getElementById('popupText').value;popup_text=SuchenUndErsetzen(popup_text,"+"," ");popup_text=SuchenUndErsetzen(popup_text,"vbCrLf","<BR/>");var content="";content="<div class='popupFrame'>";content+="<h1><div id='poiTitle'>"+popup_text+"</div></h1>";content+="</div>";popup=new OpenLayers.Popup.FramedCloud("chicken",new OpenLayers.LonLat(popup_x,popup_y),null,content,null,true,onPopUpClose);popup.autoSize=true;map.addPopup(popup,true);}
function onPopUpClose(){removePopUP();}
function removePopUP(){try{if(popup!=null)
map.removePopup(popup);popup_x=0;popup_y=0;popup_text="";}catch(_exc){}}