function EStyle(stemImage,stemSize,boxClass,boxOffset){this.stemImage=stemImage;
this.stemSize=stemSize;
this.boxClass=boxClass;
this.boxOffset=boxOffset;
var agent=navigator.userAgent.toLowerCase();
var fudge=5;
if(agent.indexOf("opera")>-1){fudge=3
}if(agent.indexOf("firefox")>-1){fudge=5
}if(agent.indexOf("safari")>-1){fudge=5
}if((agent.indexOf("msie")>-1)&&(agent.indexOf("opera")<1)){fudge=0
}this.fudge=fudge
}function EWindow(map,contentDivBaseClass,contentDivId,debug){this.DEBUG=(debug==null||debug.length==0||(debug!=true&&debug!=false))?false:debug;
this.map=map;
this.div1Id=(contentDivId?contentDivId:"");
this.div1BaseClass=(contentDivBaseClass?contentDivBaseClass:"infoWindow");
this.noCorrection=new GPoint(0,0);
this.stemCorrection(this.noCorrection,this.noCorrection,this.noCorrection,this.noCorrection);
this.visible=false;
this.hideCallback=null;
this.ie=false;
var agent=navigator.userAgent.toLowerCase();
if((agent.indexOf("msie")>-1)&&(agent.indexOf("opera")<1)){this.ie=true
}else{this.ie=false
}}EWindow.prototype=new GOverlay();
EWindow.prototype.initialize=function(map){this.map=map;
var div1=document.createElement("div");
div1.style.position="absolute";
if(this.div1Id&&this.div1Id.length>0){div1.id=this.div1Id
}div1.classNameBase=this.div1BaseClass;
div1.style.width="230px";
div1.style.height="auto";
map.getPane(G_MAP_FLOAT_PANE).appendChild(div1);
this.div1=div1;
this.hide()
};
EWindow.prototype.openOnMap=function(point,html,offset){this.supressMapEvents();
this.offset=offset||new GPoint(0,0);
this.point=point;
var z=GOverlay.getZIndex(this.point.lat());
this.div1.style.zIndex=10;
this.visible=true;
this.show();
if(isMinFF3){this.div1.innerHTML=this.emptyBox();
this.redraw(true)
}this.div1.innerHTML=html;
this.redraw(true)
};
EWindow.prototype.openOnPoint=function(latlng,html,hideAction){this.setWindowDirection(latlng);
this.openOnMap(latlng,html,new GPoint(0,0));
this.hideCallback=hideAction
};
EWindow.prototype.openOnMarker=function(marker,html){var vx=marker.getIcon().iconAnchor.x-marker.getIcon().infoWindowAnchor.x;
var vy=marker.getIcon().iconAnchor.y-marker.getIcon().infoWindowAnchor.y;
this.setWindowDirection(marker.getLatLng());
this.openOnMap(marker.getPoint(),html,new GPoint(vx,vy))
};
EWindow.prototype.stemCorrection=function(offsetTopLeft,offsetBottomLeft,offsetTopRight,offsetBottomRight){this.moTL=offsetTopLeft||this.noCorrection;
this.moBL=offsetBottomLeft||this.noCorrection;
this.moTR=offsetTopRight||this.noCorrection;
this.moBR=offsetBottomRight||this.noCorrection
};
EWindow.prototype.setWindowDirection=function(latlng){var current=this.map.fromLatLngToContainerPixel(latlng);
this.directionX="right";
this.directionY="bottom";
var mapSize=this.map.getSize();
if(current.x>Math.round(mapSize.width/2)){this.directionX="left"
}if(current.y>Math.round(mapSize.height/2)){this.directionY="top"
}if(this.directionX=="right"&&this.directionY=="bottom"){this.div1.className=this.div1.classNameBase+" needleTopl "
}if(this.directionX=="right"&&this.directionY=="top"){this.div1.className=this.div1.classNameBase+" needleBottoml "
}if(this.directionX=="left"&&this.directionY=="bottom"){this.div1.className=this.div1.classNameBase+" needleTopr "
}if(this.directionX=="left"&&this.directionY=="top"){this.div1.className=this.div1.classNameBase+" needleBottomr "
}};
EWindow.prototype.redraw=function(force){if(!this.visible){return
}var p=this.map.fromLatLngToDivPixel(this.point);
var intLeft=intBottom=0;
if(this.directionX=="right"&&this.directionY=="bottom"){intLeft=(p.x-this.offset.x+this.moBR.x);
intBottom=(-p.y+this.offset.y+this.moBR.y-this.height(this.div1))
}if(this.directionX=="right"&&this.directionY=="top"){intLeft=(p.x-this.offset.x+this.moTR.x);
intBottom=(-p.y+this.offset.y+this.moTR.y)
}if(this.directionX=="left"&&this.directionY=="bottom"){intLeft=(p.x-this.offset.x+this.moBL.x-this.width(this.div1));
intBottom=(-p.y+this.offset.y+this.moBL.y-this.height(this.div1))
}if(this.directionX=="left"&&this.directionY=="top"){intLeft=(p.x-this.offset.x+this.moTL.x-this.width(this.div1));
intBottom=(-p.y+this.offset.y+this.moTL.y)
}this.div1.style.left=intLeft+"px";
this.div1.style.bottom=intBottom+"px";
if(this.DEBUG){GLog.write("new EWindow position at: "+this.point.toString()+p.toString());
GLog.write("current EWindow offset: "+this.offset.toString());
GLog.write("current EWindow.width/Height: "+this.width(this.div1)+", "+this.height(this.div1));
GLog.write("current EWindow style.left/bottom: "+this.div1.style.left+", "+this.div1.style.bottom)
}this.corners(intLeft,intBottom)
};
EWindow.prototype.corners=function(intLeft,intBottom){this.cornerLT=new GPoint(intLeft,(-intBottom-this.height(this.div1)));
this.cornerRB=new GPoint((intLeft+this.width(this.div1)),(-intBottom));
if(this.DEBUG){var boundRT_Latlng=this.map.getBounds().getNorthEast();
var boundLB_Latlng=this.map.getBounds().getSouthWest();
var boundLT_Latlng=new GLatLng(boundRT_Latlng.lat(),boundLB_Latlng.lng());
var boundRB_Latlng=new GLatLng(boundLB_Latlng.lat(),boundRT_Latlng.lng());
var boundLT=this.map.fromLatLngToDivPixel(boundLT_Latlng);
var boundRB=this.map.fromLatLngToDivPixel(boundRB_Latlng);
GLog.write("window LT/RB: ["+this.cornerLT.toString()+this.cornerRB.toString()+"] within map LT/RB: ["+boundLT.toString()+boundRB.toString()+"]["+boundLT_Latlng.toString()+boundRB_Latlng+"]")
}};
EWindow.prototype.clearCorners=function(){this.cornerLT=this.cornerRB=0
};
EWindow.prototype.getPixelPositionImpl1=function(latlng){var pixelPos=this.map.fromLatLngToDivPixel(latlng);
if(this.DEBUG){GLog.write("tooltipbox ["+this.cornerLT.toString()+this.cornerRB.toString()+"], get pixle with fromLatLngToDivPixel: ("+pixelPos.x+","+pixelPos.y+")")
}return pixelPos
};
EWindow.prototype.getPixelPositionImpl2=function(latlng){var pixelPos=this.map.fromLatLngToContainerPixel(latlng);
if(this.DEBUG){GLog.write("tooltipbox ["+this.cornerLT.toString()+this.cornerRB.toString()+"], get pixle with fromLatLngToContainerPixel: ("+pixelPos.x+","+pixelPos.y+")")
}return pixelPos
};
EWindow.prototype.getPixelPositionImpl3=function(latlng){var debugId=geoMapWidth=geoMapHeight=mapEckeLT=mapEckeRB=X_pixpos=Y_pixpos=0;
debugId=document.getElementById("geoPortalMap");
if(this.DEBUG&&debugId){geoMapWidth=this.width(debugId);
geoMapHeight=this.height(debugId);
mapEckeLT=this.map.fromDivPixelToLatLng(new GPoint(0,0));
mapEckeRB=this.map.fromDivPixelToLatLng(new GPoint(geoMapWidth,geoMapHeight));
X_pixpos=Math.round(geoMapHeight*((latlng.lat()-mapEckeLT.lat())/(mapEckeRB.lat()-mapEckeLT.lat())));
Y_pixpos=Math.round(geoMapWidth*((latlng.lng()-mapEckeLT.lng())/(mapEckeRB.lng()-mapEckeLT.lng())))
}var pixelPos=new GPoint(Y_pixpos,X_pixpos);
if(this.DEBUG){GLog.write("tooltipbox ["+this.cornerLT.toString()+this.cornerRB.toString()+"], get pixle with meine: "+pixelPos.toString()+", mapEckeLT/RB: [(0,0)("+geoMapWidth+","+geoMapHeight+")]")
}return pixelPos
};
EWindow.prototype.getPixelPosition=function(latlng){var pixelPos1=this.getPixelPositionImpl1(latlng);
var pixelPos2=this.getPixelPositionImpl2(latlng);
var pixelPos3=this.getPixelPositionImpl3(latlng);
GLog.write("new click position at: "+latlng.toString()+pixelPos1.toString());
return pixelPos1
};
EWindow.prototype.precision=function(latlng){if(this.DEBUG){GLog.write("latlng: ("+latlng.toString()+")")
}latlng=new GLatLng(latlng.lat().toPrecision(7),latlng.lng().toPrecision(7));
if(this.DEBUG){GLog.write("new latlng: ("+latlng.toString()+")")
}return latlng
};
EWindow.prototype.insideEW=function(latlng){return true;
if(!this.cornerLT||!this.cornerRB||this.cornerRB==null||this.cornerLT==0||this.cornerRB==0){if(this.DEBUG){GLog.write("outside tooltip window")
}return false
}var clickpoint=this.getPixelPosition(latlng);
if(clickpoint.x>this.cornerLT.x&&clickpoint.x<this.cornerRB.x&&clickpoint.y>this.cornerLT.y&&clickpoint.y<this.cornerRB.y){if(this.DEBUG){GLog.write("("+clickpoint.x+","+clickpoint.y+") inside tooltip window")
}return true
}if(this.DEBUG){GLog.write("("+clickpoint.x+","+clickpoint.y+") outside tooltip window")
}return false
};
EWindow.prototype.outsideEW=function(latlng){return(!this.insideEW(latlng))
};
EWindow.prototype.remove=function(){this.div1.parentNode.removeChild(this.div1);
this.visible=false
};
EWindow.prototype.copy=function(){return new EWindow(this.map)
};
EWindow.prototype.show=function(){this.div1.style.display="";
this.visible=true
};
EWindow.prototype.hide=function(){this.div1.style.display="none";
this.visible=false;
if(this.hideCallback!=null){this.hideCallback();
this.hideCallback=null
}this.clearCorners();
this.restoreMapEvents()
};
EWindow.prototype.isHidden=function(){return !this.visible
};
EWindow.prototype.supportsHide=function(){return true
};
EWindow.prototype.zindex=function(zin){var z=GOverlay.getZIndex(this.point.lat());
this.div1.style.zIndex=z+zin
};
EWindow.prototype.supressMapEvents=function(){this.map.disableScrollWheelZoom();
this.map.disableDragging()
};
EWindow.prototype.restoreMapEvents=function(){this.map.enableScrollWheelZoom();
this.map.enableDragging()
};
EWindow.prototype.width=function(div){if(div.clip&&div1.clip.width){return div.clip.width
}else{if(div.offsetWidth){return div.offsetWidth
}else{if(div.style.pixelWidth){return div.style.pixelWidth
}else{return false
}}}};
EWindow.prototype.height=function(div){if(div.clip&&div1.clip.height){return div.clip.height
}else{if(div.offsetHeight){return div.offsetHeight
}else{if(div.style.pixelHeight){return div.style.pixelHeight
}}}return false
};
EWindow.prototype.emptyBox=function(){var top='<div class="top"><div class="leftCorner"><hr/></div><div class="title">Kurierdienste und Postdienste</div><div class="leftBorder"><hr/></div><div class="rBorder"><hr/></div><div class="close"><a href="javascript:GeoPortalMap.ew.hide()"><img width="13" height="13" border="0" src="/images/common/tooltip/btn_closeSmall.png" title=""/></a></div><div class="rightCorner"><hr/></div></div>';
var bottom='<div class="bottomBorder"><div class="leftCorner"><hr/></div><div class="middle"><hr/></div><div class="rightCorner"><hr/></div></div><div class="bottomBorder"><div class="leftCorner"><hr/></div><div class="middle"><hr/></div><div class="rightCorner"><hr/></div></div><div class="bottomBorder"><div class="leftCorner"><hr/></div><div class="middle"><hr/></div><div class="rightCorner"><hr/></div></div>';
var container='<div class="container"><div class="rightBorder"><hr/></div><div class="boxes"><div class="box"><h3><a target="_blank" title="..." href="#">&#160;</a></h3><div class="contact"><p>&#160;</p></div></div></div></div>';
var emptyContent=top+container+bottom;
return emptyContent
};
var PoiControl={mapControl:null,maxPoiAmount:20,poiIndexArray:new Array(),freeIndexes:20,init:function(){PoiControl.mapControl=GeoPortalMap
},loadSessionPois:function(){for(var i=0;
i<=PoiControl.maxPoiAmount;
i=i+1){var poiCookieInfo=$.cookie("POI"+i);
if(!isUndefOrNull(poiCookieInfo)&&poiCookieInfo.isNotEmpty()){continue
}PoiControl.poiIndexArray[i]="1";
PoiControl.freeIndexes=PoiControl.freeIndexes-1;
poiCookieArray=poiCookieInfo.split("|");
var lon=poiCookieArray[0].replace(/[^=]*\=/,"");
var lat=poiCookieArray[1].replace(/[^=]*\=/,"");
var poiHeading=poiCookieArray[2].replace(/[^=]*\=/,"");
var poiContent=poiCookieArray[3].replace(/[^=]*\=/,"");
var myPoi=PoiControl.mapControl.mapWidget.getFeed("clientside").addPoi([lon,lat],poiHeading,poiContent);
myPoi.show()
}return false
},setPoi:function(){var poiHeading=document.getElementById("poiHeading").value;
var poiContent=document.getElementById("poiContent").value;
var reg=new RegExp("[\n\r]","g");
poiContent=poiContent.replace(reg,"<br/>");
goUtils.hideElement("poiSpec");
if(PoiControl.freeIndexes>0){PoiControl.mapControl.mapWidget.captureNextClick(function(evt){(myPoi=PoiControl.mapControl.mapWidget.getFeed("clientside").addPoi(evt.wgs,poiHeading,poiContent)).show();
poiIndex=PoiControl.getNextPoiIndex();
PoiControl.poiIndexArray[poiIndex]="1";
PoiControl.freeIndexes=PoiControl.freeIndexes-1;
var cookieContent="lon="+evt.wgs[0]+"|lat="+evt.wgs[1]+"|head="+escape(poiHeading)+"|cont="+escape(poiContent);
$.cookie("POI"+poiIndex,escape(cookieContent),{expires:1,path:"/map"})
})
}else{alert(PoiControl.freeIndexes)
}return false
},clearTextField:function(){if(document.getElementById("poiContent").value==" "){document.getElementById("poiContent").value=""
}return false
},getNextPoiIndex:function(){for(var i=0;
i<PoiControl.maxPoiAmount;
i=i+1){if(PoiControl.poiIndexArray[i]!="1"){return i
}}return -1
}};
$(window).load(PoiControl.init);
$(function(){var containerTop=0;
window.onresize=function(){adjustContentSizes();
adjustPanelH();
setHeightRouteInfo();
containerTop=adjustTreeHeight(containerTop)
},adjustContentSizes=function(){var heightMapC=$(window).height()-$("#header").height()-$("#footer").height()-55;
var heightMapContent=(heightMapC>5)?heightMapC:6;
var mapHeight=heightMapContent-5;
nMapHeight=(mapHeight>0)?mapHeight:36;
$(".mapContainer").css({height:nMapHeight});
$(".mapContainer .map").css({height:nMapHeight});
$(".contentHolder").css({height:nMapHeight+26});
var heightArrowMiddle=nMapHeight-76;
$(".slider .arrowMiddle").css({height:heightArrowMiddle});
var widthStreetviewHolder=$(".mapContainer").width()-325;
$("#contentStreetview .streetviewHolder").css({width:widthStreetviewHolder-5});
$("#contentStreetview .streetviewHolder").css({height:this.nMapHeight});
$("#contentStreetview .smallMap").css({height:this.nMapHeight-225})
},adjustPanelH=function(){panelHeight=nMapHeight-35;
$(".mapContainer .panel").css({height:panelHeight})
},adjustTreeHeight=function(containerTop1){if(typeof containerTop1=="undefined"){return containerTop
}if($(".navbarMap .controlLinks .mapLink").hasClass("on")){var mapSearchHeight=$(".mapSearch").height();
var mapsectorSearchHeight=$(".mapsectorSearch").height();
var mapsectorSearchOffHeight=$(".mapsectorSearchOff").height();
var locateMapHeight=$(".locateMap").height();
containerTop1=mapSearchHeight+mapsectorSearchHeight+mapsectorSearchOffHeight+locateMapHeight+75;
var heightTreeContentA=panelHeight-containerTop1;
$(".poiTree .treeContent").css({height:heightTreeContentA})
}else{var heightTreeContentB=panelHeight-containerTop1;
$(".poiTree .treeContent").css({height:heightTreeContentB})
}return containerTop1
},setHeightRouteInfo=function(){if($(".getRoute").hasClass("off")){var routeInfoHeight=panelHeight-78;
$(".routeInfo").css({height:routeInfoHeight})
}else{var routeInfoHeight=nMapHeight-$(".getRoute").height()-77;
$(".routeInfo").css({height:routeInfoHeight})
}},$(".accordionArea h2").click(function(){var containerElement=$(this).next();
var headerElement=$(this);
var closeElement=$(this).children(".closeArea");
if((containerElement.is(".accordionArea .areaContent"))&&(containerElement.is(":visible"))){return false
}if((containerElement.is(".accordionArea .areaContent"))&&(!containerElement.is(":visible"))){$(".accordionArea .areaContent:visible").slideUp("slow");
$(".accordionArea h2").removeClass("active");
$(".accordionArea .closeArea").removeClass("active");
closeElement.addClass("active");
containerElement.slideDown("slow",function(){adjustTreeHeight()
});
headerElement.addClass("active");
return false
}}),$(".accordionArea .closeArea").click(function(){$(".accordionArea .areaContent:visible").slideUp("slow",function(){adjustTreeHeight()
});
$(".accordionArea h2").removeClass("active");
$(".accordionArea .closeArea").removeClass("active")
}),mapsectorSearchOpener=function(){$(".mapsectorSearch h2").addClass("active");
$(".mapsectorSearch .closeArea").addClass("active");
$(".mapsectorSearch .areaContent").show();
$(".mapSearch h2").removeClass("active");
$(".mapSearch .closeArea").removeClass("active");
$(".mapSearch .areaContent").hide();
$(".mapsectorSearchOff").css("visibility","hidden")
},mapsectorSearchOn=function(){$(".mapsectorSearchOff").css("visibility","hidden")
},mapsectorSearchOff=function(){$(".mapsectorSearchOff").css("visibility","visible");
$(".mapsectorSearch .areaContent:visible").hide();
$(".mapsectorSearch h2").removeClass("active");
$(".mapsectorSearch .closeArea").removeClass("active");
adjustTreeHeight()
},mapsectorSearchErrorOn=function(){$(".layerBox.error").show()
},mapsectorSearchErrorOff=function(){$(".layerBox.error").hide()
},$(".layerBox.error a").click(function(){mapsectorSearchErrorOff()
}),$(document.body).mouseup(function(){$(event.target).parents(".layerBox").length<=0?$(".layerBox").hide():0
});
layerTip=function(){$(".mapsectorSearchOff .openInfo").click(function(e){var posX=e.pageX+17;
var posY=e.pageY-30;
$(".layerBox.tip").css("left",posX).css("top",posY).show()
}).mouseout(function(){});
$(".layerBox.tip a").click(function(){$(".layerBox.tip").hide()
})
},openRoutePanel=function(){$(".routeLink").removeClass("off").addClass("on");
$(".mapLink").removeClass("on").addClass("off");
$(".panel .panelRoute").removeClass("off").addClass("on").show();
$(".panel .panelMap").addClass("off").removeClass("on").hide();
$(".slider").addClass("collapse").removeClass("expande");
setHeightRouteInfo()
},$(".mapLink").click(function(){if($(this).hasClass("off")){$(this).removeClass("off").addClass("on");
$(".routeLink").removeClass("on").addClass("off");
$(".panel .panelMap").addClass("on").removeClass("off").show();
$(".panel .panelRoute").addClass("off").removeClass("on").hide();
$(".slider").addClass("collapse").removeClass("expande")
}}),$(".routeLink").click(function(){if($(this).hasClass("off")){openRoutePanel()
}}),streetviewON=function(){$("#contentMap").css("z-index","199");
return false
};
streetviewOFF=function(){$("#contentMap").css("z-index","201");
return false
},$(".slider").click(function(){if($(this).hasClass("collapse")&&$(".panel .panelMap").hasClass("on")){$(this).removeClass("collapse").addClass("expande");
$(".panel .panelMap").hide()
}else{if($(this).hasClass("expande")&&$(".panel .panelMap").hasClass("on")){$(this).removeClass("expande").addClass("collapse");
$(".panel .panelMap").show()
}else{if($(this).hasClass("collapse")&&$(".panel .panelRoute").hasClass("on")){$(this).removeClass("collapse").addClass("expande");
$(".panel .panelRoute").hide()
}else{if($(this).hasClass("expande")&&$(".panel .panelRoute").hasClass("on")){$(this).removeClass("expande").addClass("collapse");
$(".panel .panelRoute").show()
}}}}}),$(".getRoute .close").click(function(){$(".getRoute .container").hide();
$(".showGetRoute").show();
$(".getRoute").addClass("off");
setHeightRouteInfo()
}),$(".showGetRoute").click(function(){$(".showGetRoute").hide();
$(".getRoute .container").show();
$(".getRoute").removeClass("off");
setHeightRouteInfo()
}),setObjHandlers=function(){this.arrToggles=[this.oToggleAddressInput,this.oTogglePoi];
var nCounter=0;
while(this.arrToggles[nCounter]){if(eval(this.arrToggles[nCounter])){$(this.arrToggles[nCounter]).bind("click",this.toggleSector)
}nCounter++
}},setBodyHandler=function(){onceFocussed=1
},defaultTexts=function(){new InputDefault(".panel input")
};
adjustContentSizes();
adjustPanelH();
defaultTexts();
containerTop=adjustTreeHeight(containerTop);
setObjHandlers();
textFocus=0;
onceFocussed=0;
layerTip()
});
var GeoPortalMap={iconCfg:new Array(),pois:new Array(),contId:"geoPortalMap",linkId:"switchMap",grfLoaderId:"loaderGraphic",isCompatible:((!isIE||isMinIE6)&&(!isOpera||isMinOpera8)&&!isNS4),showMap:1,isVisible:false,isInitialMap:false,mapType:"Hybrid",mapTypeHash:{},showCircle:0,goHome:0,urlHash:{},urlOrder:new Array(),lastAdserverCall:new Date().getTime()/1000,layerPngIcon:"&orOpen=yes&dataProvider=0&orClose=yes",layerTooltip:"&LAY=0",layerWas:"",clickedPoint:"",timeoutRefresh:null,timeoutClick:null,ivwOff4Map:1,ivwIgnoreNextMove:0,GPSiesStrecke:null,circleOverlay:null,fdfOverlay1:null,fdfOverlay2:null,streetViewPanorama:null,streetViewClient:null,streetViewOverlay:null,streetViewMap:null,streetViewMapMarkerIcon:null,streetViewMapMarkerOverlay:null};
GeoPortalMap.refreshIconLayer=function(){GeoPortalMap.ivwOff4Map=1;
var save=GeoPortalMap.map.getCurrentMapType();
if(save==G_SATELLITE_MAP){GeoPortalMap.map.setMapType(G_HYBRID_MAP)
}else{GeoPortalMap.map.setMapType(G_SATELLITE_MAP)
}GeoPortalMap.map.setMapType(save);
GeoPortalMap.ivwOff4Map=0
};
GeoPortalMap.handleLayerChange=function(enabledFeeds){var lyrs1="&dataProvider=0";
var lyrs2="0";
for(var i in enabledFeeds){if(enabledFeeds[i]!="0"){lyrs1=lyrs1+"&dataProvider="+enabledFeeds[i];
lyrs2=lyrs2+","+enabledFeeds[i]
}}GeoPortalMap.layerPngIcon="&orOpen=yes"+lyrs1+"&orClose=yes";
GeoPortalMap.layerTooltip="&LAY="+lyrs2;
if(GeoPortalMap.timeoutRefresh!=null){window.clearTimeout(GeoPortalMap.timeoutRefresh);
GeoPortalMap.timeoutRefresh=null
}GeoPortalMap.timeoutRefresh=setTimeout(function(){GeoPortalMap.refreshIconLayer()
},100)
};
GeoPortalMap.showTooltip=function(responseText){if(responseText==""){return
}GeoPortalMap.ew.openOnPoint(GeoPortalMap.clickedPoint,responseText,GeoPortalMap.removeGPSiesTrack);
goUtils.emitMessage("c1_map_totip");
GeoPortalMap.ivwIgnoreNextMove=1;
var pos1=responseText.indexOf("<!--@@@");
if(pos1!=-1){var pos2=responseText.indexOf("@@@-->",pos1);
var fileId=responseText.substring(pos1+7,pos2);
GeoPortalMap.drawGPSiesTrack(fileId)
}var mapPixelSize=GeoPortalMap.map.getSize();
if((mapPixelSize.width<600)||(mapPixelSize.height<400)){GeoPortalMap.timeoutClick=setTimeout(function(){GeoPortalMap.timeoutClick=null;
GeoPortalMap.ew.hide()
},10000)
}};
GeoPortalMap.getTooltip=function(lat,lon){var distance=4*(40000000/(1<<GeoPortalMap.map.getZoom()))/256;
distance=distance.toFixed(0);
if(distance<10){distance=10
}var parameter="&XCO="+lon+"&YCO="+lat+"&DIS="+distance+GeoPortalMap.layerTooltip;
if(GeoPortalMap.layerWas!=""){parameter=parameter+"&MDN="+encodeURIComponent(GeoPortalMap.layerWas)
}GeoPortalMap.clickedPoint=new GLatLng(lat,lon);
$.get("/IDA2?PAGE=googleMapToolTip&ACTION=search"+parameter,GeoPortalMap.showTooltip)
};
GeoPortalMap.clickOnMapAction=function(overlay,latlng){if($(".navbarMap .controlLinks .streetviewLink").hasClass("checkOn")){var z=GeoPortalMap.map.getZoom();
if(z<13){z=z+3;
if(z>13){z=13
}GeoPortalMap.map.setCenter(latlng,z)
}else{GeoPortalMap.streetViewClient.getNearestPanoramaLatLng(latlng,function(nextLatLng){if((nextLatLng==null)&&(goVars.txtFld["apachePngOsaIp"]=="www.goyellow.de")){var msg="Leider kein Street View Bild vorhanden";
showPeekabooBox(msg)
}else{streetviewON();
GeoPortalMap.streetViewJumpToMap(latlng)
}})
}return
}if((GeoPortalMap.timeoutClick==null)&&GeoPortalMap.ew.isHidden()){GeoPortalMap.timeoutClick=setTimeout(function(){GeoPortalMap.timeoutClick=null;
GeoPortalMap.getTooltip(latlng.y,latlng.x)
},300)
}else{if(!GeoPortalMap.ew.isHidden()&&GeoPortalMap.ew.outsideEW(latlng)){GeoPortalMap.ew.hide()
}window.clearTimeout(GeoPortalMap.timeoutClick);
GeoPortalMap.timeoutClick=null
}};
GeoPortalMap.dblclickOnMapAction=function(overlay,latlng){if(GeoPortalMap.timeoutClick!=null){window.clearTimeout(GeoPortalMap.timeoutClick);
GeoPortalMap.timeoutClick=null
}};
GeoPortalMap.verifyWasArg=function(suchbegriff){if(suchbegriff==""){mapsectorSearchErrorOn();
return(false)
}if(suchbegriff.search(/[a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9]/)!=-1){mapsectorSearchErrorOff();
return(true)
}if(suchbegriff.search(/\*/)==-1){mapsectorSearchErrorOff();
return(true)
}mapsectorSearchErrorOn();
return(false)
};
GeoPortalMap.truncateWasArg=function(suchbegriff){if(suchbegriff.length>22){suchbegriff=suchbegriff.substr(0,18)+" ..."
}return(suchbegriff)
};
GeoPortalMap.doWasSearch=function(synchron){GeoPortalMap.layerWas=$("#wasSuchbegriff").attr("value").replace(/\./," ");
if(!GeoPortalMap.verifyWasArg(GeoPortalMap.layerWas)){return
}$(".mapsectorSearch .wasSuchbegriff").text(GeoPortalMap.truncateWasArg(GeoPortalMap.layerWas));
if(!$(".mapsectorSearch .resultbox .check").hasClass("on")){$(".mapsectorSearch .resultbox .check").addClass("on")
}$(".mapsectorSearch .searchbox").hide();
if(synchron){GeoPortalMap.refreshIconLayer();
$(".mapsectorSearch .resultbox").show()
}else{var misImage=new Image();
misImage.src="/tracking.jsp?PAGE=geoSearch&ACTION=WasSuche&SUBACTION="+encodeURIComponent(GeoPortalMap.layerWas.toLowerCase().substr(0,32));
if(GeoPortalMap.timeoutRefresh!=null){window.clearTimeout(GeoPortalMap.timeoutRefresh);
GeoPortalMap.timeoutRefresh=null
}GeoPortalMap.timeoutRefresh=setTimeout(function(){GeoPortalMap.refreshIconLayer();
$(".mapsectorSearch .resultbox").show()
},100)
}};
GeoPortalMap.newWasSearch=function(){$(".mapsectorSearch .resultbox").hide();
$(".mapsectorSearch .searchbox").show()
};
GeoPortalMap.toggleWasLayer=function(){$(".mapsectorSearch .resultbox .check").toggleClass("on");
if($(".mapsectorSearch .resultbox .check").hasClass("on")){GeoPortalMap.layerWas=$("#wasSuchbegriff").attr("value")
}else{GeoPortalMap.layerWas=""
}if(GeoPortalMap.timeoutRefresh!=null){window.clearTimeout(GeoPortalMap.timeoutRefresh);
GeoPortalMap.timeoutRefresh=null
}GeoPortalMap.timeoutRefresh=setTimeout(function(){GeoPortalMap.refreshIconLayer()
},100)
};
GeoPortalMap.zoomInWas=function(){GeoPortalMap.ivwOff4Map=1;
if(GeoPortalMap.isInitialMap){GeoPortalMap.lon=13.4119;
GeoPortalMap.lat=52.5238;
GeoPortalMap.map.setCenter(new GLatLng(GeoPortalMap.lat,GeoPortalMap.lon),13)
}else{GeoPortalMap.map.setZoom(13)
}GeoPortalMap.ivwOff4Map=0;
mapsectorSearchOpener()
};
GeoPortalMap.homeAction=function(){var homeInfo=$.cookie("GY_HOME");
if(!isUndefOrNull(homeInfo)&&homeInfo.isNotEmpty()){$.cookie("GY_HOME",homeInfo,{path:"/"});
var homeHash=homeInfo.split("|");
var lon=homeHash[0];
var lat=homeHash[1];
var zoom=parseInt(homeHash[2]);
var mt=GeoPortalMap.mapTypeHash[homeHash[3]];
GeoPortalMap.ivwOff4Map=1;
GeoPortalMap.map.setCenter(new GLatLng(lat,lon),zoom,mt);
GeoPortalMap.ivwOff4Map=0
}else{var curMT=GeoPortalMap.map.getCurrentMapType().getName();
var curCenter=GeoPortalMap.map.getCenter();
var curLon=curCenter.x.toString();
var curLat=curCenter.y.toString();
var curZoom=GeoPortalMap.map.getZoom();
var home=curLon+"|"+curLat+"|"+curZoom+"|"+curMT;
$.cookie("GY_HOME",home,{expires:1,path:"/"});
GeoPortalMap.testHome()
}};
GeoPortalMap.homeDelete=function(){$.cookie("GY_HOME",null,{path:"/"});
document.getElementById("locateMapSwap").setAttribute("class","saveLocation");
document.getElementById("locateMapSwap").firstChild.nodeValue="Standort speichern";
$("#locateMapHide").hide()
};
GeoPortalMap.testHome=function(){var homeInfo=$.cookie("GY_HOME");
if(!isUndefOrNull(homeInfo)&&homeInfo.isNotEmpty()){document.getElementById("locateMapSwap").setAttribute("class","goLocation");
document.getElementById("locateMapSwap").firstChild.nodeValue="Zum Standort";
$("#locateMapHide").show();
adjustTreeHeight()
}else{$("#locateMapHide").hide();
adjustTreeHeight()
}};
GeoPortalMap.goHomeAction=function(){var homeInfo=$.cookie("GY_HOME");
if(!isUndefOrNull(homeInfo)&&homeInfo.isNotEmpty()){var homeHash=homeInfo.split("|");
GeoPortalMap.lon=homeHash[0];
GeoPortalMap.lat=homeHash[1];
GeoPortalMap.z=parseInt(homeHash[2]);
GeoPortalMap.mapType=homeHash[3]
}};
GeoPortalMap.initRouteIds=function(){GeoPortalMap.wayPoints=new Array(3);
GeoPortalMap.wayPoints[0]={title:"von",locId:"von_where",strId:"von_street",status:"on",X:0,Y:0};
GeoPortalMap.wayPoints[1]={title:"nach",locId:"nach_where",strId:"nach_street",status:"on",X:0,Y:0};
GeoPortalMap.wayPoints[2]={title:"ueber",locId:"ueber_where",strId:"ueber_street",status:"off",X:0,Y:0}
};
GeoPortalMap.fillMapTypeHash=function(){GeoPortalMap.mapTypeHash["Hybrid"]=G_HYBRID_MAP;
GeoPortalMap.mapTypeHash["Map"]=G_NORMAL_MAP;
GeoPortalMap.mapTypeHash["Satellite"]=G_SATELLITE_MAP;
GeoPortalMap.mapTypeHash["Terrain"]=G_PHYSICAL_MAP;
GeoPortalMap.mapTypeHash["vector"]=G_NORMAL_MAP;
GeoPortalMap.mapTypeHash["2"]=G_NORMAL_MAP;
GeoPortalMap.mapTypeHash["aerial"]=G_HYBRID_MAP;
GeoPortalMap.mapTypeHash["Karte"]=G_NORMAL_MAP;
GeoPortalMap.mapTypeHash["Satellit"]=G_SATELLITE_MAP;
GeoPortalMap.mapTypeHash["Gelände"]=G_PHYSICAL_MAP
};
GeoPortalMap.moveendAction=function(){GeoPortalMap.isInitialMap=false;
if(GeoPortalMap.ivwOff4Map==0){if(GeoPortalMap.ivwIgnoreNextMove==1){GeoPortalMap.ivwIgnoreNextMove=0
}else{goUtils.emitMessage("c1_map_move")
}}};
GeoPortalMap.zoomendAction=function(oldLevel,newLevel){GeoPortalMap.isInitialMap=false;
if(newLevel<2){GeoPortalMap.map.setZoom(oldLevel);
return
}if(GeoPortalMap.ivwOff4Map==0){if(oldLevel<newLevel){goUtils.emitMessage("c1_map_zmin")
}if(oldLevel>newLevel){goUtils.emitMessage("c1_map_zmout")
}GeoPortalMap.ivwIgnoreNextMove=1
}treeView.activateLyrsByZoom(oldLevel,newLevel);
if(newLevel>=13){mapsectorSearchOn();
if(GeoPortalMap.layerWas!=""){mapsectorSearchOpener()
}}if(newLevel<13){mapsectorSearchOff()
}if((GeoPortalMap.fdfOverlay1!=null)||(GeoPortalMap.fdfOverlay2!=null)){GeoPortalMap.fdfMarker(newLevel)
}};
GeoPortalMap.maptypechangedAction=function(){if(GeoPortalMap.ivwOff4Map==0){var mapType=GeoPortalMap.map.getCurrentMapType();
if(mapType==G_NORMAL_MAP){goUtils.emitMessage("c1_map_vectr")
}if(mapType==G_SATELLITE_MAP){goUtils.emitMessage("c1_map_arial")
}if(mapType==G_HYBRID_MAP){goUtils.emitMessage("c1_map_hybrd")
}if(mapType==G_PHYSICAL_MAP){goUtils.emitMessage("c1_map_physl")
}if((mapType!=G_HYBRID_MAP)&&(GeoPortalMap.fdfOverlay1!=null)){GeoPortalMap.map.removeOverlay(GeoPortalMap.fdfOverlay1);
GeoPortalMap.fdfOverlay1=null
}if((mapType!=G_HYBRID_MAP)&&(GeoPortalMap.fdfOverlay2!=null)){GeoPortalMap.map.removeOverlay(GeoPortalMap.fdfOverlay2);
GeoPortalMap.fdfOverlay2=null
}}};
GeoPortalMap.misTracking=function(page,action){var misImage=new Image();
misImage.src="/tracking.jsp?PAGE="+page+"&ACTION="+action
};
GeoPortalMap.init=function(){var detailLayer=new GTileLayer(new GCopyrightCollection(""));
detailLayer.getTileUrl=function(tile,zoom){return"http://"+goVars.txtFld["apachePngOsaIp"]+"/osa?png=1&x="+tile.x+"&y="+tile.y+"&z="+zoom+"&service=map"+GeoPortalMap.layerPngIcon
};
detailLayer.isPng=function(){return true
};
G_NORMAL_MAP.getTileLayers().push(detailLayer);
G_SATELLITE_MAP.getTileLayers().push(detailLayer);
G_HYBRID_MAP.getTileLayers().push(detailLayer);
G_PHYSICAL_MAP.getTileLayers().push(detailLayer);
var detailWasLayer=new GTileLayer(new GCopyrightCollection(""));
detailWasLayer.getTileUrl=function(tile,zoom){if(GeoPortalMap.layerWas==""){return("/images/map/empty.png")
}if(zoom<13){return("/images/map/empty.png")
}return"http://"+goVars.txtFld["apachePngOsaIp"]+"/osa?png=1&x="+tile.x+"&y="+tile.y+"&z="+zoom+"&service=sub&type=xlst&spec=hidecap&billingInformation=xxx&maxrecord=1000&maidenName="+encodeURIComponent(GeoPortalMap.layerWas)
};
detailWasLayer.isPng=function(){return true
};
G_NORMAL_MAP.getTileLayers().push(detailWasLayer);
G_SATELLITE_MAP.getTileLayers().push(detailWasLayer);
G_HYBRID_MAP.getTileLayers().push(detailWasLayer);
G_PHYSICAL_MAP.getTileLayers().push(detailWasLayer);
mapOptions={draggableCursor:"default"};
GeoPortalMap.map=new GMap2(document.getElementById(GeoPortalMap.contId),mapOptions);
if(GeoPortalMap.goHome==1){GeoPortalMap.goHomeAction()
}var fdfFlag=0;
if((GeoPortalMap.lon==10.4433)&&(GeoPortalMap.lat==52.931)){fdfFlag=52.925
}if((GeoPortalMap.lon==10.4467)&&(GeoPortalMap.lat==52.93015)){fdfFlag=52.925
}if((GeoPortalMap.lon==10.44376)&&(GeoPortalMap.lat==52.93013)){fdfFlag=52.925
}if((GeoPortalMap.lon==10.44497)&&(GeoPortalMap.lat==52.934)){fdfFlag=52.927
}if((GeoPortalMap.lon==10.44168)&&(GeoPortalMap.lat==52.91943)){fdfFlag=52.923
}if(fdfFlag!=0){GeoPortalMap.z=15;
treeView.setSpecifiedLayers("10!,11!,16!,27!,100!,5004!,6003")
}if(GeoPortalMap.z<2){GeoPortalMap.z=2
}if(GeoPortalMap.z>19){GeoPortalMap.z=19
}if(GeoPortalMap.z<13){mapsectorSearchOff()
}if(GeoPortalMap.z>=13){mapsectorSearchOn();
if(GeoPortalMap.layerWas!=""){mapsectorSearchOpener();
if(GeoPortalMap.layerWas!=" "){$("#wasSuchbegriff").attr("value",GeoPortalMap.layerWas);
GeoPortalMap.doWasSearch(true)
}else{GeoPortalMap.layerWas=""
}}}var mapControl=new GLargeMapControl();
var topRight=new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(10,30));
var bottomRight=new GControlPosition(G_ANCHOR_BOTTOM_RIGHT,new GSize(10,30));
GeoPortalMap.map.addControl(mapControl,topRight);
GeoPortalMap.map.addControl(new GMapTypeControl());
GeoPortalMap.map.addControl(new GScaleControl(),bottomRight);
GeoPortalMap.map.setCenter(new GLatLng((fdfFlag!=0)?fdfFlag:GeoPortalMap.lat,GeoPortalMap.lon),GeoPortalMap.z);
GeoPortalMap.map.addMapType(G_PHYSICAL_MAP);
GeoPortalMap.fillMapTypeHash();
GeoPortalMap.initRouteIds();
if((GeoPortalMap.lon==10.5)&&(GeoPortalMap.lat==51.7)){GeoPortalMap.isInitialMap=true
}var mt=GeoPortalMap.mapTypeHash[GeoPortalMap.mapType];
if(mt!=""){GeoPortalMap.map.setMapType(mt)
}else{GeoPortalMap.map.setMapType(G_HYBRID_MAP)
}GeoPortalMap.map.enableScrollWheelZoom(true);
if(GeoPortalMap.showCircle==1){var myIcon=new GIcon(G_DEFAULT_ICON);
myIcon.iconSize=new GSize(70,70);
myIcon.image="/images/de/map/common/target_area.png";
myIcon.shadow="";
myIcon.printImage="";
myIcon.mozPrintImage="";
myIcon.printShadow="";
myIcon.iconAnchor=new GPoint(35,35);
GeoPortalMap.circleOverlay=new GMarker(new GLatLng(GeoPortalMap.lat,GeoPortalMap.lon),{icon:myIcon,clickable:false});
GeoPortalMap.map.addOverlay(GeoPortalMap.circleOverlay);
GeoPortalMap.latlonCircle=GeoPortalMap.lat+","+GeoPortalMap.lon
}if(fdfFlag!=0){GeoPortalMap.fdfMarker(GeoPortalMap.z);
var markerDiv=GeoPortalMap.map.getPane(G_MAP_MARKER_PANE);
var theParent=markerDiv.parentNode;
var tileDiv=markerDiv.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling;
markerDiv.style.zIndex=2;
theParent.removeChild(markerDiv);
tileDiv.appendChild(markerDiv);
GeoPortalMap.misTracking("geoSearch","Finsdorf")
}GEvent.addListener(GeoPortalMap.map,"dblclick",GeoPortalMap.dblclickOnMapAction);
GEvent.addListener(GeoPortalMap.map,"click",GeoPortalMap.clickOnMapAction);
GEvent.addListener(GeoPortalMap.map,"moveend",GeoPortalMap.moveendAction);
GEvent.addListener(GeoPortalMap.map,"zoomend",GeoPortalMap.zoomendAction);
GEvent.addListener(GeoPortalMap.map,"maptypechanged",GeoPortalMap.maptypechangedAction);
GeoPortalMap.testHome();
GeoPortalMap.ew=new EWindow(GeoPortalMap.map,"layerTooltip buggybox","",false);
GeoPortalMap.map.addOverlay(GeoPortalMap.ew);
treeView.init();
treeView.activateLyrs(0,GeoPortalMap.z);
GeoPortalMap.route=new GDirections(GeoPortalMap.map,document.getElementById("routeInfoContent"));
$("#formueber_where").hide();
$("#formueber_street").hide();
GeoPortalMap.streetViewPanorama=new GStreetviewPanorama(document.getElementById("streetviewImage"));
GeoPortalMap.streetViewPanorama.setPOV({yaw:180});
GeoPortalMap.streetViewClient=new GStreetviewClient();
GeoPortalMap.streetViewMapMarkerIcon=new GIcon(G_DEFAULT_ICON);
GeoPortalMap.streetViewMapMarkerIcon.iconSize=new GSize(50,50);
GeoPortalMap.streetViewMapMarkerIcon.image="/images/map/pegPhant_s.png";
GeoPortalMap.streetViewMapMarkerIcon.shadow="";
GeoPortalMap.streetViewMapMarkerIcon.printImage="";
GeoPortalMap.streetViewMapMarkerIcon.mozPrintImage="";
GeoPortalMap.streetViewMapMarkerIcon.printShadow="";
GeoPortalMap.streetViewMapMarkerIcon.iconAnchor=new GPoint(25,25);
GeoPortalMap.streetViewMap=new GMap2(document.getElementById("smallMapImage"));
GeoPortalMap.streetViewMap.setMapType(G_NORMAL_MAP);
GeoPortalMap.streetViewMap.addControl(new GSmallZoomControl());
GeoPortalMap.streetViewMap.disableDragging();
GeoPortalMap.streetViewMapMarkerOverlay=null;
GEvent.addListener(GeoPortalMap.streetViewPanorama,"initialized",function(call){GeoPortalMap.streetViewMap.setCenter(call.latlng,18);
GeoPortalMap.adjustMapMarkerIcon();
GeoPortalMap.getStreetViewNextIcons()
});
GEvent.addListener(GeoPortalMap.streetViewMap,"moveend",function(){GeoPortalMap.streetViewPanorama.setLocationAndPOV(GeoPortalMap.streetViewMap.getCenter(),GeoPortalMap.streetViewPanorama.getPOV());
GeoPortalMap.adjustMapMarkerIcon();
GeoPortalMap.getStreetViewNextIcons();
GeoPortalMap.streetViewClient.getNearestPanoramaLatLng(GeoPortalMap.streetViewMap.getCenter(),function(nextLatLng){if(nextLatLng==null){var msg="Leider kein Street View Bild vorhanden"
}showPeekabooBox(msg)
})
});
GEvent.addListener(GeoPortalMap.streetViewPanorama,"yawchanged",function(yaw){GeoPortalMap.adjustMapMarkerIcon()
});
GeoPortalMap.ivwOff4Map=0
};
GeoPortalMap.fdfMarker=function(zoomLevel){if(GeoPortalMap.fdfOverlay1!=null){GeoPortalMap.map.removeOverlay(GeoPortalMap.fdfOverlay1);
GeoPortalMap.fdfOverlay1=null
}if(GeoPortalMap.fdfOverlay2!=null){GeoPortalMap.map.removeOverlay(GeoPortalMap.fdfOverlay2);
GeoPortalMap.fdfOverlay2=null
}if((zoomLevel<=10)&&(GeoPortalMap.circleOverlay!=null)){GeoPortalMap.map.removeOverlay(GeoPortalMap.circleOverlay);
GeoPortalMap.circleOverlay=null
}if((10<zoomLevel)&&(zoomLevel<16)){var myIcon1=new GIcon(G_DEFAULT_ICON);
var position;
if(zoomLevel==11){myIcon1.iconSize=new GSize(88,22);
position=new GLatLng(52.934,10.41)
}if(zoomLevel==12){myIcon1.iconSize=new GSize(174,23);
position=new GLatLng(52.9323,10.43)
}if(zoomLevel==13){myIcon1.iconSize=new GSize(288,34);
position=new GLatLng(52.93185,10.435)
}if(zoomLevel==14){myIcon1.iconSize=new GSize(463,25);
position=new GLatLng(52.93144,10.4082)
}if(zoomLevel==15){myIcon1.iconSize=new GSize(417,32);
position=new GLatLng(52.93129,10.42754)
}myIcon1.image="/images/de/map/Finsdorf/Schriftzug_z"+zoomLevel+".png";
myIcon1.shadow="";
myIcon1.printImage="";
myIcon1.mozPrintImage="";
myIcon1.printShadow="";
myIcon1.iconAnchor=new GPoint(0,0);
GeoPortalMap.fdfOverlay1=new GMarker(position,{icon:myIcon1,clickable:false,zIndexProcess:function(){return -200000000
}});
GeoPortalMap.map.addOverlay(GeoPortalMap.fdfOverlay1)
}if(10<zoomLevel){var myIcon2=new GIcon(G_DEFAULT_ICON);
var scale=1;
while(zoomLevel<15){scale=scale/2;
zoomLevel++
}while(zoomLevel>15){scale=scale*2;
zoomLevel--
}myIcon2.iconSize=new GSize(482*scale,380*scale);
myIcon2.image="/images/de/map/Finsdorf/Kachel_AKW.png";
myIcon2.shadow="";
myIcon2.printImage="";
myIcon2.mozPrintImage="";
myIcon2.printShadow="";
myIcon2.iconAnchor=new GPoint(0,0);
GeoPortalMap.fdfOverlay2=new GMarker(new GLatLng(52.92302,10.43561),{icon:myIcon2,clickable:false,zIndexProcess:function(){return -200000000
}});
GeoPortalMap.map.addOverlay(GeoPortalMap.fdfOverlay2)
}};
GeoPortalMap.streetViewToogleCheckBox=function(){if(GeoPortalMap.streetViewOverlay!=null){GeoPortalMap.map.removeOverlay(GeoPortalMap.streetViewOverlay);
GeoPortalMap.streetViewOverlay=null
}if($(".navbarMap .controlLinks .streetviewLink").hasClass("checkOff")){$(".navbarMap .controlLinks .streetviewLink").removeClass("checkOff");
$(".navbarMap .controlLinks .streetviewLink").addClass("checkOn");
GeoPortalMap.streetViewOverlay=new GStreetviewOverlay();
GeoPortalMap.map.addOverlay(GeoPortalMap.streetViewOverlay);
var msg="Straßenansichten sind vorhanden in blau markierten Bereichen. Klick auf die Karte für die Straßenansicht";
showPeekabooBox(msg)
}else{$(".navbarMap .controlLinks .streetviewLink").removeClass("checkOn");
$(".navbarMap .controlLinks .streetviewLink").addClass("checkOff")
}};
showPeekabooBox=function(msg){$(".peekabooBox.layerBox .msg").text(msg);
$(".peekabooBox.layerBox").show()
};
$(function(){$(".navbarMap .controlLinks li.streetviewLink").click(function(){GeoPortalMap.streetViewToogleCheckBox()
})
});
GeoPortalMap.streetViewJumpToMap=function(latlng){GeoPortalMap.streetViewMap.setCenter(latlng,18);
GeoPortalMap.streetViewPanorama.setLocationAndPOV(GeoPortalMap.streetViewMap.getCenter(),GeoPortalMap.streetViewPanorama.getPOV())
};
GeoPortalMap.adjustMapMarkerIcon=function(){var direction=GeoPortalMap.streetViewPanorama.getPOV().yaw;
var iconFileName="pegPhant_n.png";
if(direction>337){iconFileName="pegPhant_n.png"
}else{if(direction>292){iconFileName="pegPhant_nw.png"
}else{if(direction>247){iconFileName="pegPhant_w.png"
}else{if(direction>202){iconFileName="pegPhant_sw.png"
}else{if(direction>157){iconFileName="pegPhant_s.png"
}else{if(direction>112){iconFileName="pegPhant_se.png"
}else{if(direction>67){iconFileName="pegPhant_e.png"
}else{if(direction>22){iconFileName="pegPhant_ne.png"
}}}}}}}}GeoPortalMap.streetViewMapMarkerIcon.image="/images/map/"+iconFileName;
if(GeoPortalMap.streetViewMapMarkerOverlay!=null){GeoPortalMap.streetViewMap.removeOverlay(GeoPortalMap.streetViewMapMarkerOverlay)
}GeoPortalMap.streetViewMapMarkerOverlay=new GMarker(GeoPortalMap.streetViewMap.getCenter(),{icon:GeoPortalMap.streetViewMapMarkerIcon,clickable:false,draggable:true,bouncy:false});
GeoPortalMap.streetViewMap.addOverlay(GeoPortalMap.streetViewMapMarkerOverlay);
GEvent.addListener(GeoPortalMap.streetViewMapMarkerOverlay,"dragend",function(latlng){GeoPortalMap.streetViewMap.disableDragging();
GeoPortalMap.streetViewJumpToMap(latlng)
});
GEvent.addListener(GeoPortalMap.streetViewMapMarkerOverlay,"mouseover",function(latlng){GeoPortalMap.streetViewMap.enableDragging()
});
GEvent.addListener(GeoPortalMap.streetViewMapMarkerOverlay,"mouseout",function(latlng){GeoPortalMap.streetViewMap.disableDragging()
})
};
GeoPortalMap.getStreetViewNextIcons=function(){var parameter="&XCO="+GeoPortalMap.streetViewMap.getCenter().lng()+"&YCO="+GeoPortalMap.streetViewMap.getCenter().lat()+GeoPortalMap.layerTooltip;
if(GeoPortalMap.layerWas!=""){parameter=parameter+"&MDN="+encodeURIComponent(GeoPortalMap.layerWas)
}$.get("/IDA2?PAGE=googleSVToolTip&ACTION=search"+parameter,GeoPortalMap.showStreetViewNextIcons)
};
GeoPortalMap.showStreetViewNextIcons=function(html){$(".mapContainer .entriesBox").html(html)
};
GeoPortalMap.initPrintView=function(){printMap.initPrintView("bigmap","geoPortalMap","routeInfoContent")
};
GeoPortalMap.unload=function(){GUnload()
};
GeoPortalMap.tabChanged=function(name){GeoPortalMap.tab=name;
if(name=="mapLink"){GeoPortalMap.clearRoute()
}};
GeoPortalMap.getCoords4Address=function(){var loc=$("#where_map").attr("value");
var street=$("#street_map").attr("value");
$("#where_map").removeClass("notFound");
$("#street_map").removeClass("notFound");
GeoPortalMap.getCoords4InputAddress(-1,loc,street,"where_map","street_map");
return false
};
GeoPortalMap.getCoords4InputAddress=function(i,loc,street,inputFieldIdLoc,inputFieldIdStr){if(!loc){loc=""
}if(!street){street=""
}if(loc==goVars.txtFld["cityMap"]){loc=""
}if(street==goVars.txtFld["streetMap"]){street=""
}loc=loc.replace(/\s*\/\s*/g," ");
street=street.replace(/\s*\/\s*/g," ");
street=street.replace(/\+/g,"%2B");
var urlSuffix=encodeURIComponent(loc);
if(street!=""){urlSuffix=urlSuffix+"/"+encodeURIComponent(street)
}urlSuffix=urlSuffix+"/";
var results=goNav.splitLocalityDataFunc(loc);
var zcd=encodeURIComponent(results[0]);
loc=encodeURIComponent(results[1]);
street=encodeURIComponent(street);
var action=((street.length==0)?"locSearch":"streetSearch");
return $.ajax({async:false,url:"/IDA2?MIME=xml&PAGE=ajaxPos&ACTION="+action+"&ZCD="+zcd+"&LOC="+loc+"&STR="+street+"&locField="+inputFieldIdLoc+"&strField="+inputFieldIdStr,success:function(xml){var responseUrl=$(xml).find("url");
if(responseUrl!=undefined&&responseUrl[0]!=undefined&&responseUrl[0].firstChild!=undefined){if(0<=i&&i<3){var responseCoordX=responseCoordY=CoordX=CoordY=0;
responseCoordX=xml.getElementsByTagName("coordinateX");
if(responseCoordX!=undefined&&responseCoordX[0]!=undefined&&responseCoordX[0].firstChild!=undefined){CoordX=responseCoordX[0].firstChild.nodeValue;
GeoPortalMap.wayPoints[i]["X"]=CoordX
}responseCoordY=xml.getElementsByTagName("coordinateY");
if(responseCoordY!=undefined&&responseCoordY[0]!=undefined&&responseCoordY[0].firstChild!=undefined){CoordY=responseCoordY[0].firstChild.nodeValue;
GeoPortalMap.wayPoints[i]["Y"]=CoordY;
GeoPortalMap.wayPoints[i]["point"]=CoordY+","+CoordX
}}else{urlSuffix=responseUrl[0].firstChild.nodeValue;
urlSuffix=encodeURI(urlSuffix);
goUrl.loadURL("/map/"+urlSuffix);
return false
}return true
}else{var error=xml.getElementsByTagName("error");
var firstchild=error[0].firstChild;
var content=firstchild.nodeValue;
$("#geoPortalNav").empty();
$("#geoPortalNav").addClass("layerBox");
$("#geoPortalNav").html(content);
$("#geoPortalNav").css("visibility","visible");
$("#geoPortalNav").show();
var field=null;
if((content.indexOf("Ort nicht gefunden")!=-1)||(content.indexOf("Kein Ort eingegeben")!=-1)){field="where_map";
if(0<=i&&i<3){field=GeoPortalMap.wayPoints[i]["locId"]
}}if(content.indexOf("Straße nicht gefunden")!=-1){field="street_map";
if(0<=i&&i<3){field=GeoPortalMap.wayPoints[i]["strId"]
}}if(field!=null){if(document.getElementById(field)){$("#"+field).addClass("notFound");
$("#"+field).focus()
}}return false
}}})
};
GeoPortalMap.routeAddVia=function(){$("#formueber_where").show();
$("#formueber_street").show();
$("#formAddUeber").hide();
GeoPortalMap.wayPoints[2]["status"]="on";
new InputDefault(".panel input[id^='ueber_']")
};
GeoPortalMap.getPointFromForm=function(fieldId){var posText="";
var oFieldA=$("input[name='"+fieldId+"A"+"']");
var oFieldB=$("input[name='"+fieldId+"B"+"']");
var aValue=(oFieldA)?oFieldA.attr("value"):"";
var bValue=(oFieldB)?oFieldB.attr("value"):"";
if(aValue.length>0&&bValue!="undefined"&&bValue!=goVars.txtFld["cityMap"]){posText=aValue
}if(bValue.length>0&&bValue!="undefined"&&bValue!=goVars.txtFld["streetMap"]){posText=posText+", "+oFieldB.attr("value")
}return posText
};
GeoPortalMap.getInputValueWithoutDefault=function(fieldId){var value=$("#"+fieldId).attr("value");
if(!value){value=""
}var inputtype=$("#"+fieldId).attr("inputtype");
if(value==goVars.txtFld[inputtype]){value=""
}return value
};
GeoPortalMap.checkWayPoints=function(){for(i=0;
i<GeoPortalMap.wayPoints.length;
i++){$("#"+GeoPortalMap.wayPoints[i]["locId"]).removeClass("notFound");
$("#"+GeoPortalMap.wayPoints[i]["strId"]).removeClass("notFound")
}for(i=0;
i<GeoPortalMap.wayPoints.length;
i++){if(GeoPortalMap.wayPoints[i]["status"]!="off"){var loc=GeoPortalMap.getInputValueWithoutDefault(GeoPortalMap.wayPoints[i]["locId"]);
var str=GeoPortalMap.getInputValueWithoutDefault(GeoPortalMap.wayPoints[i]["strId"]);
if(!GeoPortalMap.getCoords4InputAddress(i,loc,str,GeoPortalMap.wayPoints[i]["locId"],GeoPortalMap.wayPoints[i]["strId"])){return false
}}}return true
};
GeoPortalMap.createRouteOptions=function(option){var optionValue=GeoPortalMap.optionInput;
var routeOptions={avoidHighways:false,locale:"de_DE"};
if(optionValue=="nbab"){routeOptions={avoidHighways:true,locale:"de_DE"}
}if(optionValue=="fuss"){routeOptions={avoidHighways:true,travelMode:G_TRAVEL_MODE_WALKING,locale:"de_DE"}
}return routeOptions
};
GeoPortalMap.calculateRoute=function(){GeoPortalMap.clearRoute();
var ok=GeoPortalMap.checkWayPoints();
var optionValue=$("#routeOption").val();
GeoPortalMap.optionInput=optionValue;
if(ok==true){GeoPortalMap.calculateRouteFromWayPoints()
}};
GeoPortalMap.calculateRouteFromWayPoints=function(){document.getElementById("routeInfoContent").firstChild.nodeValue="Route wird berechnet ...";
var routeOptions=GeoPortalMap.createRouteOptions(GeoPortalMap.optionInput);
var start=end=over=coords=0;
start=GeoPortalMap.wayPoints[0]["point"];
end=GeoPortalMap.wayPoints[1]["point"];
over=GeoPortalMap.wayPoints[2]["point"];
if(over){coords=[start,over,end]
}else{coords=[start,end]
}GeoPortalMap.route.loadFromWaypoints(coords,routeOptions);
GEvent.addListener(GeoPortalMap.route,"error",GeoPortalMap.calculateRouteError);
GEvent.addListener(GeoPortalMap.route,"load",GeoPortalMap.calculateRouteLoad)
};
GeoPortalMap.calculateRouteError=function(){document.getElementById("routeInfoContent").firstChild.nodeValue="Fehler:"+GeoPortalMap.route.getStatus()["code"]
};
GeoPortalMap.calculateRouteLoad=function(){document.getElementById("routeInfoContent").firstChild.nodeValue="";
$(".getRoute .container").hide();
$(".showGetRoute").show();
$(".getRoute").addClass("off");
setHeightRouteInfo()
};
GeoPortalMap.clearRoute=function(){GeoPortalMap.route.clear();
for(i=0;
i<GeoPortalMap.wayPoints.length;
i++){GeoPortalMap.wayPoints[i]["point"]=null;
GeoPortalMap.wayPoints[i]["X"]=0;
GeoPortalMap.wayPoints[i]["Y"]=0
}GeoPortalMap.optionInput=null
};
GeoPortalMap.isRouteActive=function(){return(GeoPortalMap.wayPoints[0]["point"]!=null&&GeoPortalMap.wayPoints[1]["point"]!=null)
};
GeoPortalMap.drawGPSiesTrack=function(fileId){if(fileId&&fileId!=""&&fileId.length>1){GeoPortalMap.GPSiesStrecke=new GGeoXml("http://www.gpsies.com/files/kmz/"+fileId.substr(0,1)+"/"+fileId+".kmz");
GeoPortalMap.map.addOverlay(GeoPortalMap.GPSiesStrecke)
}};
GeoPortalMap.removeGPSiesTrack=function(){if(GeoPortalMap.GPSiesStrecke!=null){GeoPortalMap.map.removeOverlay(GeoPortalMap.GPSiesStrecke);
GeoPortalMap.GPSiesStrecke=null
}};
GeoPortalMap.swapHinHer=function(idDisable,idEnable,idHidden,idText,text){var value=$("#"+idText).val();
$("#"+idEnable).removeClass("noLink");
$("#"+idDisable).addClass("noLink");
if(value==""||value=="Startadresse"||value=="Zieladresse"){$("#"+idText).val(text).addClass("default");
$("#"+idHidden).focus()
}document.getElementById(idHidden).setAttribute("name",document.getElementById(idText).getAttribute("name"));
document.getElementById(idText).setAttribute("name",text.substr(0,1))
};
GeoPortalMap.deletetextDBfield=function(idField){var value=$("#"+idField).val();
if(value=="Startadresse"){$("#"+idField).val("")
}else{if(value=="Zieladresse"){$("#"+idField).val("")
}}$("#"+idField).removeClass("default")
};
GeoPortalMap.writetextDBfield=function(idField){var name=$("#"+idField).attr("name");
var value=$("#"+idField).val();
if(name=="S"&&value==""){$("#"+idField).val("Startadresse");
$("#"+idField).addClass("default")
}else{if(name=="Z"&&value==""){$("#"+idField).val("Zieladresse");
$("#"+idField).addClass("default")
}}};
GeoPortalMap.initRoute=function(textA,textB,fieldIdPrefix){var oFeldA=$("#"+fieldIdPrefix+"_where");
var oFeldB=$("#"+fieldIdPrefix+"_street");
oFeldA.attr("value",textA);
oFeldB.attr("value",textB);
if(oFeldA.attr("value").length>0){oFeldA.removeClass("default")
}if(oFeldB.attr("value").length>0){oFeldB.removeClass("default")
}openRoutePanel()
};
GeoPortalMap.element2LocOrStr=function(fieldId,text){$("#"+fieldId).attr("value",text);
goUtils.hideElement("geoPortalNav");
if(fieldId=="street_map"){GeoPortalMap.getCoords4Address()
}};
GeoPortalMap.orderPrint=function(){goUtils.emitMessage("c1_map_print");
GeoPortalMap.misTracking("geoSearch","Print");
goPrint.openPrintWindow("bigmap","/IDA2?addr="+GeoPortalMap.lon+","+GeoPortalMap.lat+"&z="+GeoPortalMap.z);
return false
};
GeoPortalMap.sendMail=function(){var urlHash=GeoPortalMap.createPrettyUrl();
goUtils.emitMessage("map_sendmail");
GeoPortalMap.misTracking("geoSearch","Email form");
goUtils.win.openDefault("/MailformGeoPortal.jsp?url="+encodeURIComponent(urlHash["url"]),565,650);
return false
};
GeoPortalMap.createPrettyUrl=function(){var curMT=GeoPortalMap.map.getCurrentMapType().getName();
var curCenter=GeoPortalMap.map.getCenter();
var curLon=curCenter.x.toString();
var curLat=curCenter.y.toString();
var curZoom=GeoPortalMap.map.getZoom();
var url="";
var newParams=new Array();
var diff=(18-curZoom)*(18-curZoom)*0.00065+0.00065;
if(curLat.indexOf(".")+7<curLat.length){curLat=curLat.substring(0,curLat.indexOf(".")+6)
}if(curLon.indexOf(".")+7<curLon.length){curLon=curLon.substring(0,curLon.indexOf(".")+6)
}if(window.location.href.match(/^.*?\/map\/[^\?]/)&&Math.abs(curLon-GeoPortalMap.lon)<diff&&Math.abs(curLat-GeoPortalMap.lat)<diff){url=window.location.href.replace(/\#+/,"");
if(curZoom!=GeoPortalMap.z){newParams.push("z="+curZoom);
url=url.replace(/z\=[^\&]+\&?/,"")
}newParams.push("mt="+curMT);
url=url.replace(/curMapType\=[^\&]+\&?/,"");
url=url.replace(/\?\s*$/,"");
url=url.replace(/\&\s*$/,"");
for(var i=0;
i<newParams.length;
i=i+1){if(i>0||url.match(/\?\S/)){url=url+"&"+newParams[i]
}else{url=url+"?"+newParams[i]
}}}else{url=(window.location.href.match(/^(.*?\/map)(\W|$)/))?RegExp.$1:"http://www.goyellow.de/map/";
url=url+"/?lon="+curLon+"&lat="+curLat+"&z="+curZoom+"&mt="+curMT
}returnHash={};
returnHash["url"]=url;
returnHash["lat"]=curLat;
returnHash["lon"]=curLon;
return returnHash
};
GeoPortalMap.favorite={init:function(){goUtils.emitMessage("c1_map_bmark");
GeoPortalMap.misTracking("geoSearch","Lesezeichen");
GeoPortalMap.favorite.setValues();
GeoPortalMap.favorite.setDisplays();
GeoPortalMap.favorite.handleSelectables()
},setDisplays:function(){if($.browser.msie){$(".ie","#helpBox.bookmark").show()
}},handleSelectables:function(){$(".selectable","#helpBox.bookmark").click(function(){$(this).select()
})
},setValues:function(){var urlHash=GeoPortalMap.createPrettyUrl();
GeoPortalMap.favorite.url=urlHash["url"];
var anchorLink="<a href='"+urlHash["url"]+"' title='Standort auf der GoYellow-Luftbildkarte anzeigen'>Standort auf der GoYellow-Luftbildkarte anzeigen</a>";
$("#inputBMLink").val(urlHash["url"]);
$("#inputBMAnchorLink").val(anchorLink);
$("#inputBMLatLink").val(urlHash["lat"]);
$("#inputBMLonLink").val(urlHash["lon"])
},create:function(){var title="Telefonbuch - Auskunft - Telefonnummer - Branchenbuch - Kartensuche  GoYellow.de";
if(window.opera&&window.print){var mbm=document.createElement("a");
mbm.setAttribute("rel","sidebar");
mbm.setAttribute("href",GeoPortalMap.favorite.url);
mbm.setAttribute("title",title);
mbm.click()
}else{if(document.all){window.external.AddFavorite(GeoPortalMap.favorite.url,title)
}else{goUtils.help.show("noBookmark",{className:"geoPortalUsage"},"Fehler")
}}return false
}};
GeoPortalMap.generateUrlHash=function(urlRaw){GeoPortalMap.urlHash={};
GeoPortalMap.urlOrder=new Array();
paramString=urlRaw.replace(/^.*?\?/,"");
var inParams=paramString.split("&");
var reg=/^([^=]+)\=(.*)$/;
for(var i=0;
i<inParams.length;
i=i+1){var result=reg.exec(inParams[i]);
if(result!=null&&result.length>2&&result[1]!=""){GeoPortalMap.urlHash[result[1]]=result[2];
GeoPortalMap.urlOrder.push(result[1])
}}return false
};
$(window).unload(GeoPortalMap.unload);
function Hash(){this.length=0;
this.items=new Array();
this.removeItem=function(in_key){var tmp_value;
if(typeof(this.items[in_key])!="undefined"){this.length--;
var tmp_value=this.items[in_key];
delete this.items[in_key]
}return tmp_value
};
this.getItem=function(in_key){var test=this.items["test"];
return this.items[in_key]
};
this.setItem=function(in_key,in_value){if(typeof(in_value)!="undefined"){if(typeof(this.items[in_key])=="undefined"){this.items[in_key]=new Array();
this.length++
}this.items[in_key][this.items[in_key].length]=in_value
}return in_value
};
this.hasItem=function(in_key){return typeof(this.items[in_key])!="undefined"
}
}function TreeViewCtrl(){var self=this;
var arTreeV=null;
var autoActivation=new Hash();
var statLayers=new Hash();
var allFeeds=new Hash();
var enabledFeeds={};
var usrActionFlag=0;
var spezLyrs=0;
var divId="";
var layers="";
var spezLayers="";
var treeV=new Bs_Tree();
var lastChild=0;
var lastLayerAction=1;
var refreshDisabled=0;
enabledFeeds["0"]=0;
treeV=new Bs_Tree();
treeV.useCheckboxSystem=true;
treeV.checkboxSystemWalkTree=3;
treeV.checkboxSystemIfPartlyThenFull=false;
treeV.useFolderIcon=true;
treeV.captionBgColor="";
treeV.useAutoSequence=false;
treeV.imageDir="/js/tree/img/";
treeV.imageHeight=16;
treeV.checkboxSystemImgDir="/js/tree/img/";
treeV.walkTree=false;
var getTreeArray=function(treeViewLayers){var ta=new Array;
var idParentSequence=5000;
var idChildSequence=10000;
for(var i=0;
i<=(treeViewLayers.length-1);
i++){ta[i]=new Array;
ta[i]["id"]=idParentSequence+1;
ta[i]["caption"]=treeViewLayers[i].title;
ta[i]["icon"]=treeViewLayers[i].icon;
ta[i]["dataContainer"]=new Array;
ta[i]["dataContainer"]["feeds"]=treeViewLayers[i].id;
ta[i]["dataContainer"]["minZ"]=treeViewLayers[i].minZ;
ta[i]["dataContainer"]["maxZ"]=treeViewLayers[i].maxZ;
ta[i]["dataContainer"]["auto"]=treeViewLayers[i].auto;
autoActivation.setItem(treeViewLayers[i].auto,idParentSequence+1);
var feedIds=treeViewLayers[i].id.split("!,");
for(var m=0;
m<=(feedIds.length-1);
m++){allFeeds.setItem(feedIds[m],idParentSequence+1)
}idParentSequence++;
if(typeof treeViewLayers[i].sublayers!="undefined"){ta[i]["children"]=new Array;
for(var j=0;
j<=(treeViewLayers[i].sublayers.length-1);
j++){ta[i]["children"][j]=new Array;
ta[i]["children"][j]["id"]=idChildSequence+1;
ta[i]["children"][j]["caption"]=treeViewLayers[i].sublayers[j].title;
ta[i]["children"][j]["icon"]=treeViewLayers[i].sublayers[j].icon;
ta[i]["children"][j]["dataContainer"]=new Array;
ta[i]["children"][j]["dataContainer"]["feeds"]=treeViewLayers[i].sublayers[j].id;
ta[i]["children"][j]["dataContainer"]["minZ"]=treeViewLayers[i].sublayers[j].minZ;
ta[i]["children"][j]["dataContainer"]["maxZ"]=treeViewLayers[i].sublayers[j].maxZ;
ta[i]["children"][j]["dataContainer"]["auto"]=treeViewLayers[i].sublayers[j].auto;
autoActivation.setItem(treeViewLayers[i].sublayers[j].auto,idChildSequence+1);
var feedIds=treeViewLayers[i].sublayers[j].id.split("!,");
for(var n=0;
n<=(feedIds.length-1);
n++){allFeeds.setItem(feedIds[n],idChildSequence+1)
}idChildSequence++
}}}return ta
};
var setEvents=function(treeArray){for(var i=0;
i<=(treeArray.length-1);
i++){treeArray[i]["onClickCaption"]=self.clickOnNode;
treeArray[i]["onChangeCheckbox"]=self.checkboxChanged;
if(typeof treeArray[i]["children"]!="undefined"){for(var j=0;
j<=(treeArray[i]["children"].length-1);
j++){treeArray[i]["children"][j]["onChangeCheckbox"]=self.checkboxChanged;
treeArray[i]["children"][j]["onClickCaption"]=self.clickOnNode
}}}};
this.setSpecifiedLayers=function(spezLrs){spezLayers=spezLrs
};
this.setStatLayers=function(inStatLayers){if(inStatLayers!=undefined){for(var i=0;
i<=(inStatLayers.length-1);
i++){statLayers.setItem(inStatLayers[i].minZ,inStatLayers[i].id)
}}};
this.getLayers=function(){return layers
};
this.setLayers=function(inLayers){layers=inLayers
};
this.getDiv=function(){return divId
};
this.setDiv=function(inDiv){divId=inDiv
};
var controlStaticLayers=function(oldLevel,newLevel){var counter=0;
if(oldLevel<newLevel){for(var k=oldLevel+1;
k<=newLevel;
k++){var feeds=statLayers.getItem(k);
if(typeof(feeds)!="undefined"){for(var i=0;
i<=(feeds.length-1);
i++){GeoPortalMap.misTracking("geoSearchAuto","layerOn"+feeds[i]);
var feedIds=feeds[i].split("!,");
for(var j=0;
j<=(feedIds.length-1);
j++){enabledFeeds[feedIds[j]]=feedIds[j];
counter++
}}}}}else{for(var k=oldLevel;
k>newLevel;
k--){var feeds=statLayers.getItem(k);
if(typeof(feeds)!="undefined"){for(var i=0;
i<=(feeds.length-1);
i++){var feedIds=feeds[i].split("!,");
for(var j=0;
j<=(feedIds.length-1);
j++){delete enabledFeeds[feedIds[j]];
counter++
}}}}}if(counter!=0){GeoPortalMap.handleLayerChange(enabledFeeds)
}};
this.updateParentBox=function(treeElement){var offPresent=0;
var onPresent=0;
if(treeElement.caption=="root"){return
}for(var i=0;
i<=(treeElement._children.length-1);
i++){if(treeElement._children[i].isChecked==0){offPresent=1
}if(treeElement._children[i].isChecked==2){onPresent=1
}}if((offPresent==1)&&(onPresent==1)){treeElement.setCheckboxValue(1,false,false)
}else{if(offPresent==1){treeElement.setCheckboxValue(0,false,false)
}else{if(onPresent==1){treeElement.setCheckboxValue(2,false,false)
}}}};
var activateSpecifiedLayers=function(spezLayers){spezLyrs=1;
spezLayers=spezLayers.replace(/!,/g,",");
spezLayers=spezLayers.replace(/ /g,"+");
var lyrs=spezLayers.split(",");
var lastFeed="";
var counter=0;
refreshDisabled=1;
for(var i=0;
i<lyrs.length;
i=i+1){var key=lyrs[i];
var feed=allFeeds.getItem(key);
if(typeof(feed)!="undefined"){if(feed[0]!=lastFeed[0]){var treeElement=treeV.getElement(feed);
treeV.elementOpenWalkUp(treeElement.id);
if(treeElement._children.length==0){treeElement.setCheckboxValue(2,true,false);
counter++;
treeView.updateParentBox(treeElement.parent)
}}lastFeed=feed
}}refreshDisabled=0;
spezLyrs=0;
if(counter!=0){GeoPortalMap.handleLayerChange(enabledFeeds)
}};
var autoLayerCtrl=function(oldLevel,newLevel){var counter=0;
refreshDisabled=1;
if(oldLevel<newLevel){for(var k=oldLevel+1;
k<=newLevel;
k++){var elementIds=autoActivation.getItem(k);
if(typeof(elementIds)!="undefined"){for(var i=0;
i<=(elementIds.length-1);
i++){var treeElement=treeV.getElement(elementIds[i]);
if(treeElement.isChecked!=2){treeV.elementOpenWalkUp(treeElement.id);
GeoPortalMap.misTracking("geoSearchAuto","layerOn"+treeElement.dataContainer.feeds);
if(treeElement._children.length==0){treeElement.setCheckboxValue(2,false,false);
var feedIds=treeElement.dataContainer.feeds.split("!,");
for(var j=0;
j<=(feedIds.length-1);
j++){enabledFeeds[feedIds[j]]=feedIds[j];
counter++
}treeView.updateParentBox(treeElement.parent)
}}}}}}else{for(var k=oldLevel;
k>newLevel;
k--){var elementIds=autoActivation.getItem(k);
if(typeof(elementIds)!="undefined"){for(var i=0;
i<=(elementIds.length-1);
i++){var treeElement=treeV.getElement(elementIds[i]);
if(treeElement.isChecked!=0){treeV.elementCloseWalkDown(treeElement.id);
if(treeElement._children.length==0){treeElement.setCheckboxValue(0,false,false);
var feedIds=treeElement.dataContainer.feeds.split("!,");
for(var j=0;
j<=(feedIds.length-1);
j++){delete enabledFeeds[feedIds[j]];
counter++
}treeView.updateParentBox(treeElement.parent)
}}}}}}refreshDisabled=0;
if(counter!=0){GeoPortalMap.handleLayerChange(enabledFeeds)
}};
this.checkboxChanged=function(treeElement,usrAction){usrActionFlag=1;
var feedIds=treeElement.dataContainer.feeds.split("!,");
if(treeElement.isChecked==2){lastLayerAction=2;
if(treeElement._children.length==0){for(var i=0;
i<=(feedIds.length-1);
i++){enabledFeeds[feedIds[i]]=feedIds[i]
}}}else{if(treeElement.isChecked==0){lastLayerAction=0;
if(treeElement._children.length==0){for(var i=0;
i<=(feedIds.length-1);
i++){delete enabledFeeds[feedIds[i]]
}}}else{return
}}if(refreshDisabled==1){return
}if(treeElement._children.length>0){return
}if((lastChild==0)||(treeElement.id==lastChild)){if(lastLayerAction==2){goUtils.emitMessage("c1_map_laon")
}if(lastLayerAction==0){goUtils.emitMessage("c1_map_loff")
}lastLayerAction=1;
lastChild=0;
GeoPortalMap.handleLayerChange(enabledFeeds)
}};
this.clickOnNode=function(treeElement){if(treeElement.isChecked==0){GeoPortalMap.misTracking("geoSearchAuto","layerOn"+treeElement.dataContainer.feeds)
}if(treeElement._children.length==0){lastChild=0;
if(treeElement.isChecked!=2){treeElement.setCheckboxValue(2,true,true)
}else{treeElement.setCheckboxValue(0,true,true)
}}else{var i=treeElement._children.length-1;
if(treeElement.isChecked==1){while((i>0)&&(treeElement._children[i].isChecked==0)){i--
}}lastChild=treeElement._children[i].id;
if(treeElement.isOpen){treeV.elementCloseWalkDown(treeElement.id);
if(treeElement.isChecked==0){treeV.elementOpenWalkUp(treeElement.id);
treeElement.setCheckboxValue(2,false,true)
}else{treeElement.setCheckboxValue(0,false,true)
}}else{treeV.elementOpenWalkUp(treeElement.id);
if(treeElement.isChecked==0){treeElement.setCheckboxValue(2,false,true)
}else{treeElement.setCheckboxValue(0,false,true)
}}}};
this.clickOnCheckBox=function(treeElement){if(treeElement.isChecked==0){GeoPortalMap.misTracking("geoSearch","layerOn"+treeElement.dataContainer.feeds)
}if(treeElement._children.length==0){lastChild=0
}else{var i=treeElement._children.length-1;
if(treeElement.isChecked==1){while((i>0)&&(treeElement._children[i].isChecked==0)){i--
}}lastChild=treeElement._children[i].id
}};
this.activateLyrsByZoom=function(oldLevel,newLevel){if(statLayers!=undefined){controlStaticLayers(oldLevel,newLevel)
}if(usrActionFlag==0){autoLayerCtrl(oldLevel,newLevel)
}};
this.activateLyrs=function(oldLevel,newLevel){if(spezLayers!=""){usrActionFlag=1;
activateSpecifiedLayers(spezLayers)
}this.activateLyrsByZoom(oldLevel,newLevel)
};
this.getEnabledLyrs=function(){return enabledFeeds
};
this.init=function(){arTreeV=getTreeArray(layers);
setEvents(arTreeV);
treeV.initByArray(arTreeV);
treeV.drawInto(divId)
}
}var treeView=new TreeViewCtrl();
var GM={DEBUG:false,mapDivId:"googleMap",initialized:false,gearthApi:false,visible:false,provideGE:false,toggleIcon:false,noPois:false,ivwIgnoreNextMove:0,ivwOn:false,showMap:(Pref.getSuggestCookie()&4)?1:0,getMapFilter:function(){var fCookie=$.cookie("GY_CONTEXTNAV");
if(fCookie){return parseInt(fCookie.substr(fCookie.indexOf("showMap=")+8,1))
}else{return 0
}},setMapOptionSearchResults:function(){this.options=new Array();
this.options["defview"]=G_HYBRID_MAP;
this.options["ctrlPanZoom"]=new GLargeMapControl();
this.options["ctrlMapType"]=new GHierarchicalMapTypeControl();
this.options["ctrlGE"]=G_SATELLITE_3D_MAP
},setMapOptionEntryDetail:function(){this.options=new Array();
this.options["defview"]=G_HYBRID_MAP;
this.options["ctrlPanZoom"]=new GSmallMapControl();
this.options["ctrlMapType"]=new GHierarchicalMapTypeControl();
this.options["ctrlGE"]=null
},init:function(){if(this.checkToBeLoad(false)==true){this.setMapOptionSearchResults();
window.setTimeout("GM.initialize(); ",3)
}},initShowMap:function(){GM.mapDivId="routeMapContent";
this.toggleIcon=true;
this.noPois=true;
if(this.checkToBeLoad(true)==true){this.setMapOptionEntryDetail();
window.setTimeout("GM.initialize(); ",3)
}},checkToBeLoad:function(forceshow){if(!arrCoordinates||arrCoordinates.length==1){this.hideElement($("#switchMap"));
return false
}if(this.DEBUG){GLog.write("There are "+(arrCoordinates.length-1)+" coords to be shown.")
}this.showElement($("#switchMap"));
if((!forceshow||forceshow!=true)&&(this.getMapFilter()==0&&!this.pageLoaded)){this.pageLoaded=true;
if(this.DEBUG){GLog.write("page loaded "+this.pageLoaded)
}return false
}if(this.getMapFilter()==1||this.pageLoaded){$("#mapContainer").show()
}return true
},initialize:function(){if(GBrowserIsCompatible()){var mapDiv=document.getElementById(GM.mapDivId);
var map=new google.maps.Map2(mapDiv);
GM.map=map;
GEvent.addListener(map,"load",function(){$("#loaderGraphic").hide()
});
this.setBackgroundLoaderGraphic(mapDiv);
if(this.provideGE&&google.earth){this.gearthApi=true;
this.isSupported=google.earth.isSupported();
this.isGEInstalled=google.earth.isInstalled();
if(this.isGEInstalled){map.getEarthInstance(function(ge){GE.ge=ge;
GE.init(ge)
})
}else{if(this.isSupported){$(".geplugin").show()
}}}var bounds=this.getBoundsOfPois();
var zoomLevel=map.getBoundsZoomLevel(bounds);
map.setCenter(bounds.getCenter(),zoomLevel);
this.addControls(map);
GM.gmarkers=[];
this.loadPois();
this.adjustZoomLevel(zoomLevel,map);
GM.initOpenWindow(map);
this.addListener(map);
this.initialized=true;
this.ivwOn=true;
this.visible=true;
this.toggleTextAnzeige(true,"Karte ausblenden");
this.toggleIcons(true)
}else{alert("Sorry, the Google Maps API is not compatible with this browser")
}},unload:function(){arrCoordinates=null;
GUnload()
},setBackgroundLoaderGraphic:function(mapDiv){mapDiv.style.backgroundImage="url(/images/de/map/loaderMapBG.png)";
mapDiv.style.backgroundPosition="center center";
mapDiv.style.backgroundRepeat="no-repeat"
},initOpenWindow:function(map){var ew=new EWindow(map,"layerTooltip buggybox","",this.DEBUG);
var moTopLeft=new GPoint(0,-15);
var moBottomLeft=new GPoint(0,-5);
var moTopRight=new GPoint(5,3);
var moBottomRight=new GPoint(20,-5);
ew.stemCorrection(moTopLeft,moBottomLeft,moTopRight,moBottomRight);
map.addOverlay(ew);
GEvent.addListener(map,"click",function(overlay,point){if(point&&ew.outsideEW(point)){ew.hide()
}});
GM.ew=ew
},addControls:function(map){map.setMapType(this.options["defview"]);
if(this.options["ctrlGE"]&&GM.isGEInstalled){map.addMapType(this.options["ctrlGE"])
}map.addControl(GM.options["ctrlPanZoom"]);
var GYEarthControlImageWidth=66;
var basicTopMargin=10;
var basicRightMargin=10;
var topMargin=basicTopMargin;
var rightMargin=(GM.isGEInstalled)?basicRightMargin:basicRightMargin+GYEarthControlImageWidth;
if(!GM.provideGE||!GM.gearthApi||!GM.isSupported){rightMargin=basicRightMargin
}var topRight=new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(rightMargin,topMargin));
map.addControl(GM.options["ctrlMapType"],topRight)
},removeControls:function(map){map.removeControl(GM.options["ctrlPanZoom"]);
map.removeControl(GM.options["ctrlMapType"])
},adjustZoomLevel:function(zoomLevel,map){var currentView=map.getCurrentMapType();
if(this.DEBUG){GLog.write("adjustZoomLevel.zoom level: "+zoomLevel)
}if(zoomLevel>17){zoomLevel=17;
if(this.DEBUG){GLog.write("new zoom level: "+zoomLevel)
}}if(zoomLevel<1){zoomLevel=1
}map.setZoom(zoomLevel);
return zoomLevel
},addListener:function(map){GEvent.addListener(map,"moveend",function(){if(GM.ivwOn){var channel=(typeof ivwchid!="undefined"&&ivwchid)?ivwchid:1;
if(GM.ivwIgnoreNextMove==1){GM.ivwIgnoreNextMove=0
}else{goUtils.emitMessage("c"+channel+"_det_move")
}}});
GEvent.addListener(map,"zoomend",function(oldLevel,newLevel){if(GM.ivwOn){var channel=(typeof ivwchid!="undefined"&&ivwchid)?ivwchid:1;
if(oldLevel<newLevel){goUtils.emitMessage("c"+channel+"_det_zmin")
}if(oldLevel>newLevel){goUtils.emitMessage("c"+channel+"_det_zmout")
}GM.ivwIgnoreNextMove=1
}});
GEvent.addListener(map,"maptypechanged",function(){var ivwCurrent=GM.ivwOn;
GM.ivwOn=false;
if(GM.ew){GM.ew.hide()
}GM.adjustZoomLevel(map.getZoom(),map);
map.savePosition();
map.returnToSavedPosition();
if(map.getCurrentMapType()==G_SATELLITE_3D_MAP){map.removeControl(GM.options["ctrlPanZoom"])
}else{map.addControl(GM.options["ctrlPanZoom"])
}GM.ivwOn=ivwCurrent;
if(GM.ivwOn){var channel=(typeof ivwchid!="undefined"&&ivwchid)?ivwchid:1;
var mapType=map.getCurrentMapType();
if(mapType==G_NORMAL_MAP){goUtils.emitMessage("c"+channel+"_det_vectr")
}if(mapType==G_SATELLITE_MAP){goUtils.emitMessage("c"+channel+"_det_arial")
}if(mapType==G_HYBRID_MAP){goUtils.emitMessage("c"+channel+"_det_hybrd")
}GM.ivwIgnoreNextMove=1
}})
},myclick:function(label){GEvent.trigger(GM.gmarkers[(GM.gmarkers.length-label)],"click")
},readInfoBoxContent:function(index){var htmlStr=$(".mapInfoContent:eq("+index+")").html();
return htmlStr
},selectInfoBox:function(index){return $(".mapInfoContent:eq("+index+")")
},createIconAdvanced:function(labelnr){var icon=new GIcon();
icon=this.setIconImageUrl(icon,labelnr);
icon=this.setIconShadowImageUrl(icon,false);
icon=this.setIconPrintImageUrl(icon,labelnr);
icon.iconSize=new GSize(20,20);
icon.iconAnchor=new GPoint(11,11);
icon.infoWindowAnchor=new GPoint(5,3);
icon.shadowSize=new GSize(30,34);
return icon
},createIconSimple:function(labelnr){var icon=new GIcon(G_DEFAULT_ICON);
return icon
},setIconPrintImageUrl:function(icon,labelnr){if(isMoz&&!isMinFF3){icon.printImage="/images/common/icon_entry_"+((labelnr==10)?"":"0")+labelnr+".gif";
icon.mozPrintImage="/images/common/icon_entry_"+((labelnr==10)?"":"0")+labelnr+".gif"
}else{icon.printImage="/images/common/icon_entry_"+((labelnr==10)?"":"0")+labelnr+".png";
icon.mozPrintImage="/images/common/icon_entry_"+((labelnr==10)?"":"0")+labelnr+".png"
}icon.printShadow="";
return icon
},setIconImageUrl:function(icon,labelnr){icon.image="/images/common/icon_entry_"+((labelnr==10)?"":"0")+labelnr+".png";
return icon
},setIconShadowImageUrl:function(icon,useGShadow){if(useGShadow){icon.shadow="http://www.google.com/mapfiles/shadow50.png"
}else{icon.shadow="http://www.google.com/mapfiles/shadow.png"
}return icon
},importanceOrder:function(marker){return marker.importance
},createMarker:function(labelnr,point,html,id){var marker=new GMarker(point,{icon:this.createIconAdvanced(labelnr),zIndexProcess:this.importanceOrder});
marker.importance=10-labelnr;
if(this.DEBUG){GLog.write("new GMarker"+labelnr+": "+point.toString())
}GEvent.addListener(marker,"click",function(){if(GM.map.getCurrentMapType()==G_SATELLITE_3D_MAP){return
}else{GM.ew.openOnMarker(marker,html)
}});
GM.gmarkers.push(marker);
return marker
},loadPois:function(){if(this.noPois){return
}var map=GM.map;
for(var i=arrCoordinates.length-2;
i>-1;
i--){var point=new GLatLng(arrCoordinates[i].lat,arrCoordinates[i].lon,13);
var labelnr=i+1;
var marker=this.createMarker(labelnr,point,this.readInfoBoxContent(i),"mapInfoContent"+arrCoordinates[i].pos);
map.addOverlay(marker)
}},getBoundsOfPois:function(){var map=GM.map;
var bounds=new GLatLngBounds();
for(var i=0;
i<arrCoordinates.length-1;
i++){var point=new GLatLng(arrCoordinates[i].lat,arrCoordinates[i].lon,13);
bounds.extend(point)
}return bounds
},toggleDisplay:function(){if(this.pageLoaded&&!GM.initialized){if(this.DEBUG){GLog.write("arrCoordinates.length: "+arrCoordinates.length)
}if(arrCoordinates.length==0){return
}this.toggleMap();
window.setTimeout("GM.initialize()",3);
this.toggleTextAnzeige(true,"Karte ausblenden");
return
}else{this.toggleMap();
if(this.toggleIcon){$(".imgnr").toggle()
}this.toggleTextAnzeige(false,"")
}},toggleMap:function(){if(this.visible){this.hideElement($("#mapContainer"));
GM.visible=false
}else{this.showElement($("#mapContainer"));
GM.visible=true
}},toggleIcons:function(flag){if(this.toggleIcon){$(".imgnr").toggle()
}},toggleTextAnzeige:function(force,text){if(!force){text=($("#mapContainer").is(":hidden"))?"Treffer in Karte anzeigen":"Karte ausblenden"
}$("#switchMap").text(text);
this.toggleInlineStyle();
this.showElement($("#switchMap"))
},toggleInlineStyle:function(){var obj=$("#switchMap");
var width=((obj.text()=="Karte ausblenden")?"100px":"140px");
obj.css("width",width);
if(this.DEBUG){GLog.write("toggle to text: "+obj.text()+" with inline css.width: "+width)
}},hideElement:function(object){object.css("display","none");
object.css("visibility","hidden")
},showElement:function(object){object.css("visibility","visible");
object.css("display","block")
},loadPoisRandom:function(){var map=GM.map;
var bounds=map.getBounds();
var southWest=bounds.getSouthWest();
var northEast=bounds.getNorthEast();
var lngSpan=northEast.lng()-southWest.lng();
var latSpan=northEast.lat()-southWest.lat();
for(var i=0;
i<10;
i++){var point=new GLatLng(southWest.lat()+latSpan*Math.random(),southWest.lng()+lngSpan*Math.random());
map.addOverlay(new GMarker(point))
}},formatInfoBox:function(nam,str,loc){var formatted='<div id="infoBox" style="width:150;">';
formatted+="<b>"+nam+"</b>";
formatted+="<br/><br/>";
formatted+=str;
formatted+="<br/>";
formatted+=loc;
formatted+="</div>";
return formatted
},addScreenOverlay:function(map){logo=new GScreenOverlay("/images/de/map/buttons/btn_3dkarte.png",new GScreenPoint(180,0.9,"pixels","fraction"),new GScreenPoint(0,0),new GScreenSize(66,19));
map.addOverlay(logo)
}};
$(window).unload(GM.unload);
function loadJavaScript(url){var head=document.getElementsByTagName("head")[0];
var script=document.createElement("script");
script.id="uploadScript";
script.type="text/javascript";
script.language="javascript";
script.src=url;
head.appendChild(script)
}var stepOfDynamicLoad=1;
function toogleDisplayMapInResult(){if(stepOfDynamicLoad==1){loadJavaScript("/js/goyellowGeo.js");
stepOfDynamicLoad++;
window.setTimeout("GM.init(); GM.init(); ",3);
return
}GM.toggleDisplay()
}var GR={DEBUG:false,mapDivId:"googleMap",routeDivId:"routeInfoContent",addrCheckMessageLayerId:"unlocatedDetail",routeDiv:null,route:null,wayPoints:new Array(),option:null,callback:null};
GR.init=function(map,routeDivId){if(routeDivId&&routeDivId.length>1){GR.routeDivId=routeDivId
}GR.routeDiv=document.getElementById(routeDivId);
if(this.DEBUG){GLog.write("parameter map: "+map)
}if(this.DEBUG){GLog.write("parameter routeDivId: "+routeDivId)
}GR.route=new GDirections(map,GR.routeDiv);
GR.initWayPointsArray4homepage()
};
GR.unload=function(){arrCoordinates=null;
GUnload()
};
GR.initWayPointsArray4homepage=function(){GR.wayPoints[0]=new WayPoint("from");
GR.wayPoints[1]=new WayPoint("to",null,null,null,"off");
GR.wayPoints[2]=new WayPoint("per",null,null,null,"off")
};
GR.initWayPointsArray4bigmap=function(){GR.wayPoints[0]=new WayPoint("von");
GR.wayPoints[1]=new WayPoint("nach");
GR.wayPoints[2]=new WayPoint("ueber")
};
GR.setRouteWayPoints=function(waypoints){for(i=0;
i<waypoints.length;
i++){for(j=0;
j<GR.wayPoints.length;
j++){if(waypoints[i].title==GR.wayPoints[j].title){GR.wayPoints[j].setCoord(waypoints[i].X,waypoints[i].Y);
GR.wayPoints[j].setPoint(waypoints[i].point);
GR.wayPoints[j].setStatus(waypoints[i].status);
GR.wayPoints[j].setAddr(waypoints[i].addr)
}}}};
GR.getCoords4InputAddress=function(i,loc,street,inputFieldIdLoc,inputFieldIdStr){if(!loc){loc=""
}if(!street){street=""
}if(loc==goVars.txtFld["cityMap"]){loc=""
}if(street==goVars.txtFld["streetMap"]){street=""
}loc=loc.replace(/\s*\/\s*/g," ");
street=street.replace(/\s*\/\s*/g," ");
street=street.replace(/\+/g,"%2B");
var urlSuffix=encodeURIComponent(loc);
if(street!=""){urlSuffix=urlSuffix+"/"+encodeURIComponent(street)
}urlSuffix=urlSuffix+"/";
var results=goNav.splitLocalityDataFunc(loc);
var zcd=encodeURIComponent(results[0]);
loc=encodeURIComponent(results[1]);
street=encodeURIComponent(street);
var action=((street.length==0)?"locSearch":"streetSearch");
return $.ajax({async:false,url:"/IDA2?CALLBACK=RouteHomepage&MIME=xml&PAGE=ajaxPos&ACTION="+action+"&ZCD="+zcd+"&LOC="+loc+"&STR="+street+"&locField="+inputFieldIdLoc+"&strField="+inputFieldIdStr,success:function(xml){var responseUrl=$(xml).find("url");
if(responseUrl!=undefined&&responseUrl[0]!=undefined&&responseUrl[0].firstChild!=undefined){if(0<=i&&i<3){var responseCoordX=responseCoordY=CoordX=CoordY=0;
responseCoordX=xml.getElementsByTagName("coordinateX");
if(responseCoordX!=undefined&&responseCoordX[0]!=undefined&&responseCoordX[0].firstChild!=undefined){CoordX=responseCoordX[0].firstChild.nodeValue
}responseCoordY=xml.getElementsByTagName("coordinateY");
if(responseCoordY!=undefined&&responseCoordY[0]!=undefined&&responseCoordY[0].firstChild!=undefined){CoordY=responseCoordY[0].firstChild.nodeValue;
GR.wayPoints[i].setCoord(CoordX,CoordY)
}}else{urlSuffix=responseUrl[0].firstChild.nodeValue;
urlSuffix=encodeURI(urlSuffix);
goUrl.loadURL("/map/"+urlSuffix);
return false
}return true
}else{var error=xml.getElementsByTagName("error");
var firstchild=error[0].firstChild;
var content=firstchild.nodeValue;
$("#"+GR.addrCheckMessageLayerId).empty();
$("#"+GR.addrCheckMessageLayerId).addClass("layerBox");
$("#"+GR.addrCheckMessageLayerId).html(content);
$("#"+GR.addrCheckMessageLayerId).css("visibility","visible");
$("#"+GR.addrCheckMessageLayerId).show();
var field=null;
if((content.indexOf("Ort nicht gefunden")!=-1)||(content.indexOf("Kein Ort eingegeben")!=-1)){field="where_map";
if(0<=i&&i<3){field=GR.wayPoints[i]["locId"]
}}if(content.indexOf("Straße nicht gefunden")!=-1){field="street_map";
if(0<=i&&i<3){field=GR.wayPoints[i]["strId"]
}}if(field!=null){if(document.getElementById(field)){$("#"+field).addClass("notFound");
$("#"+field).focus()
}}return false
}}})
};
GR.checkWayPoints=function(){for(i=0;
i<GR.wayPoints.length;
i++){$("#"+GR.wayPoints[i]["locId"]).removeClass("notFound");
$("#"+GR.wayPoints[i]["strId"]).removeClass("notFound")
}for(i=0;
i<GR.wayPoints.length;
i++){if(GR.wayPoints[i]["status"]!="off"){var loc=getInputValueWithId(GR.wayPoints[i]["locId"]);
var str=getInputValueWithId(GR.wayPoints[i]["strId"]);
if(!GR.getCoords4InputAddress(i,loc,str,GR.wayPoints[i]["locId"],GR.wayPoints[i]["strId"])){return(false)
}}}return true
};
GR.createRouteOptions=function(optionValue){var routeOptions={avoidHighways:false,locale:"de_DE"};
if(optionValue=="nbab"){routeOptions={avoidHighways:true,locale:"de_DE"}
}if(optionValue=="fuss"){routeOptions={avoidHighways:true,travelMode:G_TRAVEL_MODE_WALKING,locale:"de_DE"}
}return routeOptions
};
GR.calculate=function(waypoints,routeOption,callback){GR.clearRoute();
GR.callback=callback;
if(waypoints&&routeOption){this.debugWayPoints("parameter: ",waypoints);
GR.setRouteWayPoints(waypoints);
this.debugInternalWayPoints("after set, internal: ");
GR.option=routeOption
}var ok=GR.checkWayPoints();
if(this.DEBUG){GLog.write("checkWayPoints() returns: "+ok)
}this.debugInternalWayPoints("after check, internal: ");
if(ok==true){GR.calculateFromWayPoints()
}};
GR.calculateFromWayPoints=function(){if(GR&&GR.routeDiv&&GR.routeDiv.firstChild){GR.routeDiv.firstChild.nodeValue="Route wird berechnet ..."
}var routeOptions=GR.createRouteOptions(GR.option);
var start=end=over=coords=0;
start=GR.wayPoints[0]["point"];
end=GR.wayPoints[1]["point"];
over=(GR.wayPoints[2].isPoint())?GR.wayPoints[2]["point"]:null;
if(over){coords=[start,over,end]
}else{coords=[start,end]
}GR.route.loadFromWaypoints(coords,routeOptions);
GM.ivwOn=false;
GEvent.addListener(GR.route,"error",GR.calculateRouteError);
GEvent.addListener(GR.route,"load",GR.calculateRouteLoad);
GEvent.addListener(GR.route,"addoverlay",GR.calculateRouteAddoverlay)
};
GR.calculateRouteError=function(){GR.routeDiv.firstChild.nodeValue="Fehler:"+GR.route.getStatus()["code"];
GM.ivwOn=true
};
GR.calculateRouteLoad=function(){GR.routeDiv.firstChild.nodeValue="";
if(addPrintOptionRoutenplaner){addPrintOptionRoutenplaner()
}};
GR.calculateRouteAddoverlay=function(){GM.ivwOn=true;
if(GR.callback){GR.callback()
}};
GR.clearRoute=function(callback){GR.callback=null;
if(GR.route){GR.route.clear()
}for(i=0;
i<GR.wayPoints.length;
i++){GR.wayPoints[i]["point"]=null;
GR.wayPoints[i]["X"]=0;
GR.wayPoints[i]["Y"]=0
}GR.option=null;
if(GR.callback){GR.callback()
}};
GR.debugInternalWayPoints=function(prefix){this.debugWayPoints(prefix,this.wayPoints)
};
GR.debugWayPoints=function(prefix,wayPoints){if(!prefix){prefix=""
}if(this.DEBUG){for(i=0;
i<wayPoints.length;
i++){GLog.write(prefix+wayPoints[i].toString())
}}};
GR.element2LocOrStr=function(fieldId,text){$("#"+fieldId).attr("value",text);
$("#"+this.addrCheckMessageLayerId).hide()
};
$(window).unload(GM.unload);
function WayPoint(title,x,y,point,status,locId,strId){this.title=title;
this.locId=((locId&&locId.length>0)?locId:this.title+"_where");
this.strId=((strId&&strId.length>0)?strId:this.title+"_street");
this.setStatus(status);
this.setCoord(x,y);
this.setPoint(point);
return this
}WayPoint.prototype.isPoint=function(){return(this.point&&this.point.length>0&&this.point!="0,0")
};
WayPoint.prototype.setStatus=function(status){var defvalue="on";
if(this.title.indexOf("ueber")>-1){defvalue="off"
}this.status=((status&&status.length>0)?status:defvalue)
};
WayPoint.prototype.setCoord=function(x,y){if(!x||!y||x.length==0||y.length==0){return
}this.X=((x)?x:0);
this.Y=((y)?y:0);
this.setPoint();
this.getLocStr()
};
WayPoint.prototype.setPoint=function(point){this.point=((point&&point.length>0)?point:this.Y+","+this.X)
};
WayPoint.prototype.setLocStr=function(loc,str){this.loc=loc;
this.str=str;
this.addr=this.str+((this.str&&this.str.length>0)?", ":"")+this.loc
};
WayPoint.prototype.getLocStr=function(){loc=getInputValueWithId(this.locId);
str=getInputValueWithId(this.strId);
this.setLocStr(loc,str)
};
WayPoint.prototype.setAddr=function(addr){this.addr=(addr)?addr:"";
if(this.addr&&this.addr.length>0){var addrSplitted=this.addr.split(", ");
if(addrSplitted.length==2){this.str=addrSplitted[0];
this.loc=addrSplitted[1]
}else{this.str="";
this.loc=addr
}}};
WayPoint.prototype.getAddr=function(){return(this.addr)?this.addr:""
};
WayPoint.prototype.toString=function(){var ret="title="+this.title;
ret=ret+", status="+this.status;
ret=ret+", point="+this.point;
ret=ret+", addr="+this.addr;
return ret
};
WayPoint.prototype.toStringLong=function(){var ret="title="+this.title;
ret=ret+", status="+this.status;
ret=ret+", x="+this.X;
ret=ret+", y="+this.Y;
ret=ret+", point="+this.point;
ret=ret+", loc="+this.loc;
ret=ret+", str="+this.str;
ret=ret+", addr="+this.addr;
return ret
};
var printMap={DEBUG:false,MapTypeArray:{"Hybrid":G_HYBRID_MAP,"Map":G_NORMAL_MAP,"Karte":G_NORMAL_MAP,"Satellite":G_SATELLITE_MAP,"Satellit":G_SATELLITE_MAP,"Gelände":G_PHYSICAL_MAP,"Terrain":G_PHYSICAL_MAP},mapState:null,routeState:null,callback:null};
printMap.initPrintView=function(name,mapDivId,directionDivId,callback){printMap.ivwOff4Map=1;
printMap.callback=(callback)?callback:null;
printMap.restoreState4PrintWindow();
var map=new GMap2(document.getElementById(mapDivId));
if(this.mapState.curLyrs&&this.mapState.curLyrs.length>0){var detailLayer=new GTileLayer(new GCopyrightCollection(""));
detailLayer.getTileUrl=function(tile,zoom){return"http://"+goVars.txtFld["apachePngOsaIp"]+"/osa?png=1&x="+tile.x+"&y="+tile.y+"&z="+zoom+printMap.mapState.curLyrs
};
detailLayer.isPng=function(){return true
};
G_NORMAL_MAP.getTileLayers().push(detailLayer);
G_SATELLITE_MAP.getTileLayers().push(detailLayer);
G_HYBRID_MAP.getTileLayers().push(detailLayer);
G_PHYSICAL_MAP.getTileLayers().push(detailLayer)
}map.setMapType(printMap.MapTypeArray[this.mapState.curMT]);
map.setCenter(this.mapState.curCenter,this.mapState.curZoom,printMap.MapTypeArray[this.mapState.curMT]);
this.refreshLayer(map);
if(this.mapState.coordCircle.length>1){var latlon=this.mapState.coordCircle.split(",");
this.drawRedCircle(map,latlon[0],latlon[1])
}if(this.mapState.routeActive){GR.init(map,directionDivId);
if(name=="bigmap"){GR.initWayPointsArray4bigmap()
}else{if(name=="homepage"){GR.initWayPointsArray4homepage()
}}GR.calculate(this.routeState.waypoints,this.routeState.routeOption,this.callbackWithDelay)
}else{if(this.mapState.showCircle==1){this.drawRedCircle(map,this.mapState.curLat,this.mapState.curLon)
}if(this.callback){this.callbackWithDelay()
}}printMap.ivwOff4Map=0
};
printMap.callbackWithDelay=function(){var timeout=500;
if(isMinFF3_5){timeout=1000
}if(printMap.callback){window.setTimeout("printMap.callback();",timeout)
}};
printMap.refreshLayer=function(map){var save=map.getCurrentMapType();
if(save==G_SATELLITE_MAP){map.setMapType(G_HYBRID_MAP)
}else{map.setMapType(G_SATELLITE_MAP)
}map.setMapType(save)
};
printMap.drawRedCircle=function(map,lat,lon){var myIcon=new GIcon(G_DEFAULT_ICON);
myIcon.iconSize=new GSize(70,70);
myIcon.image="/images/de/map/common/target_area.png";
myIcon.shadow="";
myIcon.printImage="";
myIcon.mozPrintImage="";
myIcon.printShadow="";
myIcon.iconAnchor=new GPoint(35,35);
markerOptions={icon:myIcon,clickable:false};
map.addOverlay(new GMarker(new GLatLng(lat,lon),markerOptions))
};
printMap.unload=function(){GUnload()
};
printMap.saveState4PrintWindow=function(map,curLyrs,coordCircle,route,waypoints,routeOption){var curMT=map.getCurrentMapType().getName();
var curCenter=map.getCenter();
var curLon=curCenter.x.toString();
var curLat=curCenter.y.toString();
var curZoom=map.getZoom();
var mapState=routeState=0;
if(route&&route.getStatus()["request"]=="directions"&&route.getStatus()["code"]==200){routeState=new RouteState("route state",waypoints,routeOption);
routeState.save2Cookie();
this.routeState=routeState;
mapState=new MapState("map state with route",curMT,null,curCenter,curLon,curLat,waypoints[0]["loc"],waypoints[0]["str"],curZoom,curLyrs,coordCircle,true)
}else{mapState=new MapState("map state",curMT,null,curCenter,curLon,curLat,waypoints[0]["loc"],waypoints[0]["str"],curZoom,curLyrs,coordCircle,false)
}mapState.save2Cookie();
this.mapState=mapState
};
printMap.restoreState4PrintWindow=function(){var routeState=null;
var mapState=(new MapState("unknown")).parseCookie();
if(mapState.routeActive==true){routeState=(new RouteState("unknown")).parseCookie()
}this.mapState=mapState;
this.routeState=routeState;
if(this.DEBUG){GLog.write("mapState: "+this.mapState.toString())
}if(this.DEBUG&&this.routeState){GLog.write("routeState: "+this.routeState.toString())
}};
printMap.deleteState4PrintWindow=function(){Cookie4Print.deleteStateCookies()
};
printMap.preparePrintView=function(map,curLyrs,route,waypoints,routeOption){printMap.saveState4PrintWindow(map,curLyrs,route,waypoints,routeOption)
};
printMap.displayAddr4homepage=function(){var waypoints=this.routeState.waypoints;
for(i=0;
i<waypoints.length;
i++){var divI=$("#"+waypoints[i].title);
if(divI){if(waypoints[i].title=="from"){divI.html("Von: "+waypoints[i].addr)
}if(waypoints[i].title=="to"){divI.html("Nach: "+waypoints[i].addr)
}}}};
printMap.url4OpenPrintWindow=function(url,waypointsWithAddr){printMap.generateUrlHash(url);
url=url.replace(/\?.*$/,"?");
printMap.urlHash["w"]="655";
printMap.urlHash["h"]="655";
var urlParam=printMap.composeUrlFromHash(url);
if(this.DEBUG){GLog.write("urlParam: "+urlParam)
}var lon=(printMap.urlHash["addr"].match(/^\s*([\d\.]+)\,/))?RegExp.$1:"10.5";
var lat=(printMap.urlHash["addr"].match(/\s*\,([\d\.]+)$/))?RegExp.$1:"51.7";
var z=printMap.urlHash["z"];
var curLon=GeoPortalMap.lon;
var curLat=GeoPortalMap.lat;
if(!printMap.mapState.routeActive){curLon=GeoPortalMap.map.getCenter().x;
curLat=GeoPortalMap.map.getCenter().y
}var diff=(18-z)*(18-z)*0.00065+0.00065;
if(this.DEBUG){GLog.write("diff.lon: "+(Math.abs(lon-curLon)+", diff.lat: "+Math.abs(lat-curLat)))
}var locInfoParams="";
if(Math.abs(lon-curLon)<diff&&Math.abs(lat-curLat)<diff){var addr;
if(printMap.mapState.routeActive){addr=printMap.addr.init(waypointsWithAddr[0]["locId"],waypointsWithAddr[0]["strId"],waypointsWithAddr[1]["locId"],waypointsWithAddr[1]["strId"],waypointsWithAddr[2]["locId"],waypointsWithAddr[2]["strId"])
}else{addr=printMap.addr.init("where_map","street_map")
}if(this.DEBUG){GLog.write("addr: "+addr.toString())
}locInfoParams=addr.createUrlParams();
if(this.DEBUG){GLog.write("locInfoParams: "+locInfoParams)
}}var request="/IDA2?ACTION=printMap&MIME=html&"+locInfoParams;
return request
};
printMap.addr={init:function(loc1Id,str1Id,loc2Id,str2Id,loc3Id,str3Id){this.loc1Id=loc1Id;
this.str1Id=str1Id;
this.loc2Id=loc2Id;
this.str2Id=str2Id;
this.loc3Id=loc3Id;
this.str3Id=str3Id;
this.loc1=this.getAttr(loc1Id);
this.str1=this.getAttr(str1Id);
this.loc2=this.getAttr(loc2Id);
this.str2=this.getAttr(str2Id);
this.loc3=this.getAttr(loc3Id);
this.str3=this.getAttr(str3Id);
return this
},getAttr:function(id){return getInputValueWithId(id)
},isRoute:function(){if(this.loc1.length>0&&this.loc2.length>0){return true
}return false
},createUrlParams:function(){var locInfoParams="&LOC="+encodeURIComponent(this.loc1)+"&STR="+encodeURIComponent(this.str1);
if(this.isRoute()){locInfoParams=locInfoParams+"&LOC2="+encodeURIComponent(this.loc2);
locInfoParams=locInfoParams+"&STR2="+encodeURIComponent(this.str2);
if(this.loc3&&this.loc3.length>0){locInfoParams=locInfoParams+"&LOC3="+encodeURIComponent(this.loc3);
locInfoParams=locInfoParams+"&STR3="+encodeURIComponent(this.str3)
}}return locInfoParams
},toString:function(){var val=this.loc1Id+"="+this.loc1+",";
val=val+this.str1Id+"="+this.str1+",";
val=val+this.loc2Id+"="+this.loc2+",";
val=val+this.str2Id+"="+this.str2+",";
val=val+this.loc3Id+"="+this.loc3+",";
val=val+this.str3Id+"="+this.str3;
return val
}};
printMap.generateUrlHash=function(urlRaw){printMap.urlHash={};
printMap.urlOrder=new Array();
paramString=urlRaw.replace(/^.*?\?/,"");
var inParams=paramString.split("&");
var reg=/^([^=]+)\=(.*)$/;
for(var i=0;
i<inParams.length;
i=i+1){var result=reg.exec(inParams[i]);
if(result!=null&&result.length>2&&result[1]!=""){printMap.urlHash[result[1]]=result[2];
printMap.urlOrder.push(result[1])
}}return false
};
printMap.composeUrlFromHash=function(url){var key="";
for(var i=0;
i<printMap.urlOrder.length;
i=i+1){key=printMap.urlOrder[i];
url=url+key+"="+printMap.urlHash[key]+"&"
}url=url.replace(/\&$/,"");
url=encodeURIComponent(url);
url=url.replace(/\+/g,"%2B");
url=url.replace(/\//g,"%2F");
url=encodeURIComponent(url);
return url
};
$(window).unload(printMap.unload);
var Cookie4Print={name:"GY_DRUCK",name_r:"GY_DRUCK_ROUTE",days:"1",domain:"",path:"/",deleteStateCookies:function(){MapState.deleteCookie();
RouteState.deleteCookie()
}};
concat=function(s,seperator,forceSepator){var str=(s)?s:"";
var sep=(seperator)?seperator:"";
var retval=(str.isNotEmpty()||forceSepator==true)?sep:"";
retval=retval+str;
return retval
};
function MapState(name,curMT,curMTs,curCenter,curLon,curLat,curLoc,curStr,curZoom,curLyrs,coordCircle,routeActive){this.name=name;
this.curMT=((curMT&&curMT.length>0)?curMT:"Map");
this.curLon=((curLon&&curLon!=0)?curLon:10.5);
this.curLat=((curLat&&curLat!=0)?curLat:51.7);
this.curCenter=((curCenter)?curCenter:new GLatLng(this.curLat,this.curLon));
this.curLoc=(curLoc&&curLoc.isNotEmpty())?curLoc:"";
this.curStr=(curStr&&curStr.isNotEmpty())?curStr:"";
this.curAddr=this.curStr+((this.curStr.isEmpty())?"":", ")+this.curLoc;
this.curZoom=((curZoom&&curZoom>2&&curZoom<20)?curZoom:6);
this.curLyrs=curLyrs;
this.coordCircle=(coordCircle)?coordCircle:"";
this.routeActive=routeActive;
this.mapOptions=null
}MapState.prototype.toString=function(){var stateInfo=this.curLat+","+this.curLon+"|"+this.curAddr+"|"+this.curZoom+"|"+this.curMT+"|"+this.curLyrs+"|"+this.coordCircle;
if(this.routeActive==true){stateInfo=stateInfo+"|route=1"
}return stateInfo
};
MapState.prototype.save2Cookie=function(){var stateInfo=this.toString();
$.cookie(Cookie4Print.name,stateInfo,{expires:Cookie4Print.days,path:Cookie4Print.path})
};
MapState.prototype.parseCookie=function(){var stateInfo=$.cookie(Cookie4Print.name);
var lat=lon=addr=loc=str=zoom=mt=lyrs=routeActive=0;
if(!isUndefOrNull(stateInfo)&&stateInfo.isNotEmpty()){var stateHash=stateInfo.split("|");
latlon=stateHash[0].split(",");
lat=latlon[0];
lon=latlon[1];
addr=stateHash[1];
var addrSplitted=addr.split(", ");
if(addrSplitted.length==2){str=addrSplitted[0];
loc=addrSplitted[1]
}else{str="";
loc=addr
}zoom=parseInt(stateHash[2]);
mt=stateHash[3];
lyrs=stateHash[4];
coordCircle=stateHash[5];
var routeBerechnet=(stateHash[6])?stateHash[6].split("="):null;
if(routeBerechnet&&routeBerechnet[1]==1){routeActive=true
}}mapState=new MapState("map state from cookie",mt,null,null,lon,lat,loc,str,zoom,lyrs,coordCircle,routeActive);
return mapState
};
MapState.prototype.deleteCookie=function(){$.cookie(Cookie4Print.name,null,{path:Cookie4Print.path})
};
function RouteState(name,waypoints,routeOption){this.name=name,this.waypoints=waypoints;
this.routeOption=routeOption
}RouteState.prototype.toString=function(){var sep=":";
var routeInfo=this.routeOption+"|"+this.waypoints[0]["title"]+concat(this.waypoints[0]["point"],sep)+concat(this.waypoints[0]["addr"],sep)+"|"+this.waypoints[1]["title"]+concat(this.waypoints[1]["point"],sep)+concat(this.waypoints[1]["addr"],sep)+((this.waypoints[2]&&this.waypoints[2]["point"]&&this.waypoints[2]["point"].length>0)?("|"+this.waypoints[2]["title"]+concat(this.waypoints[2]["point"],sep)):"");
return routeInfo
};
RouteState.prototype.save2Cookie=function(){var routeInfo=this.toString();
$.cookie(Cookie4Print.name_r,routeInfo,{expires:Cookie4Print.days,path:Cookie4Print.path})
};
RouteState.prototype.parseCookie=function(){var routeInfo=$.cookie(Cookie4Print.name_r);
var routeHash=routeInfo.split("|");
var routeOption=routeHash[0];
var waypoints=new Array();
for(i=1;
i<routeHash.length;
i++){var tp=routeHash[i].split(":");
if(this.DEBUG){GLog.write("parseCookie: title="+tp[0]+", point="+tp[1]+", addr="+tp[2])
}waypoints[i-1]={title:tp[0],"point":tp[1],addr:tp[2],status:"off"}
}routeState=new RouteState("route state from cookie",waypoints,routeOption);
return routeState
};
RouteState.prototype.deleteCookie=function(){$.cookie(Cookie4Print.name_r,null,{path:Cookie4Print.path})
};