BDPMap=function(){};BDPMap.prototype.RegStreet="[-\\w., äöüß]";BDPMap.prototype.RegCity="[-\\w., äöüß]";BDPMap.prototype.provider="GoogleMaps";BDPMap.prototype.windows=new ArrayA();BDPMap.prototype.resizeables=[];BDPMap.prototype.minHeight=480;BDPMap.prototype.mainContainer=null;BDPMap.prototype.searchFormContainer=null;BDPMap.prototype.searchResultsContainer=null;BDPMap.prototype.featuresControl=null;BDPMap.prototype.searchRequest=window.location.getParameter("search");BDPMap.prototype.startCLoc=window.location.getParameter("cLoc");BDPMap.prototype.startBookmark=(window.location.getParameter("longitude")&&window.location.getParameter("latitude")&&window.location.getParameter("zoom"));BDPMap.prototype.setContainerSize=function(){var o=renderer.getWindowSize();var j=renderer.assimilate(document.getElementById("wrap"));var g;var v=this.mainContainer.getCSSValue("borderTopWidth","int")+this.mainContainer.getCSSValue("borderBottomWidth","int");var b=cssHandler.getCSSValue(document.getElementById("footer"),"height","int");var u=document.getElementById("navi");var m=u.offsetWidth;var n=cssHandler.getCSSValue(u,"marginRight","int");var q=renderer.assimilate(document.getElementById("right"));var t=q.getCSSValue("marginBottom","int");var c=q.getCSSValue("paddingRight","int");var h=q.getCSSValue("paddingLeft","int");var d=q.getCSSValue("paddingBottom","int");var f=q.getCSSValue("paddingTop","int");var a=0;document.body.style.width=o.width+"px";document.body.style.height=o.height+"px";if(this.mainContainer!=null){var s=null;if(typeof this.map!="undefined"&&typeof this.map.map!="undefined"){s=this.map.getCoordinates();if(this.map.initialLoading==0&&this.map.fullScreen==true){document.getElementById("head").style.display="none";document.getElementById("footer").style.display="none";document.getElementById("tips").style.display="none";b=0;j.style.width=o.width+"px";q.style.width=this.mainContainer.style.width=o.width-m-n-c-h-a+"px";document.getElementsByTagName("h1")[0].style.width=parseInt(q.style.width)-10+"px";q.style.marginTop=u.style.top=0;}else{this.searchResultsContainer.style.top="";document.getElementById("head").style.display="";document.getElementById("footer").style.display="";document.getElementById("tips").style.display="";document.getElementsByTagName("h1")[0].style.width="";q.style.width=q.style.marginTop=u.style.top=j.style.width="";this.mainContainer.style.width=this.map.defaultContainerWidth;}if(typeof this.map.throbber!="undefined"){this.map.throbber.style.left=(this.map.throbber.visible?this.mainContainer.offsetWidth-43:this.mainContainer.offsetWidth)+"px";}if(typeof this.map.hint!="undefined"){this.map.hint.style.left=Math.round((this.mainContainer.offsetWidth-45)/2)+"px";}}g=q.getScreenOffset().y;var p=o.height-g-v-b-f-d-t;p=(p>=this.minHeight?p>1000?1000:p:this.minHeight)+"px";if(parseInt(p)<=this.minHeight){document.body.style.overflow="auto";}else{document.body.style.overflow="hidden";}for(var r=0;r<this.resizeables.length;r++){if(typeof this.resizeables[r].container!="undefined"&&this.resizeables[r].container!=null){this.resizeables[r].container.style.height=p;}if(document.getElementById("contentarea")){document.getElementById("contentarea").style.height=p;}}if(typeof this.map!="undefined"&&typeof this.map.map!="undefined"){google.maps.event.trigger(this.map.map,"resize");this.map.zoomToCoordinateRect(s);}}if(this.searchResultsContainer!=null){g=this.searchResultsContainer.getScreenOffset().y;this.searchResultsContainer.style.height=((o.height-g)>=this.minHeight?(o.height-g):this.minHeight)+"px";}if(this.tipsContainer!=null){g=this.tipsContainer.getScreenOffset().y;this.tipsContainer.style.height=((o.height-g)>=this.minHeight?(o.height-g):this.minHeight)+"px";}if(this.featuresControl!=null){var k=21;this.featuresControl.style.top=(this.map.featuresControl.show?(this.mainContainer.offsetHeight-this.featuresControl.offsetHeight-k):(this.mainContainer.offsetHeight-20-k))+"px";this.featuresControl.style.left=(this.map.featuresControl.show?(this.mainContainer.offsetWidth-this.featuresControl.offsetWidth):this.mainContainer.offsetWidth-20)+"px";}if(typeof this.map!="undefined"&&typeof this.map.updateView=="function"&&this.map.initialLoading==false){if(typeof arguments[0]!="undefined"){this.map.updateView();}else{this.map.updateView();}}};BDPMap.prototype.addCompaniesAction=function(g){g=g||"initCLoc";var c=getElementsByClassName("searchResult"),a,d;if(c&&c.length>0){for(var b=0;b<c.length;b++){a=c[b].getElementsByTagName("a");for(var f=0;f<a.length;f++){d=a[f];eventHandler.addEvent(d,"click",function(i,h){i=eventHandler.getEvent(i);i.preventDefault();if(h.href.match(/^.*?([0-9]+)\.html$/)){if(typeof g=="function"){g(RegExp.$1);}else{this.map.call(g,RegExp.$1);}}}.bindTo(this,d));}}}};BDPMap.prototype.loadMap=function(){if(document.getElementById("indexMapBlank")){document.getElementById("indexMapBlank").title="Stadtplansuche";document.getElementById("indexMapBlank").onclick=function(){BDPMap.Search.Address.init();};var b=this.mainContainer.getClientSize().Height;var f=Math.ceil(b/100)*100;var c=Math.floor((f-b)/2);var d=document.getElementById("indexMap");var g=[];this.mainContainer.style.backgroundImage=this.mainContainer.getCSSValue("backgroundImage").replace(/x[0-9]{3,4}/,"x"+f);this.mainContainer.style.backgroundPosition="0 -"+c+"px";renderer.empty(d);BDPMap.mapRequest=new HttpRequest();BDPMap.mapRequest.init(function(j){j=JSON.parse(j);for(var k=0;k<j.length;k++){g[k]={};g[k].coords=j[k].coords;g[k].name=j[k].name;g[k].lon=j[k].Longitude;g[k].lat=j[k].Latitude;g[k].width=j[k].width;var m=renderer.createElement("area",{"shape":"rect","coords":g[k].coords,"href":"javascript:void(0)","alt":'Stadtplan "'+g[k].name+" aufrufen","title":'Stadtplan "'+g[k].name+'" aufrufen',"onclick":function(n){return function(i){i=eventHandler.getEvent(i);i.preventDefault();i.stopPropagation();BDPMap.map.simpleLocation({"tileState":"HYBRID","Longitude":parseFloat(g[n].lon),"Latitude":parseFloat(g[n].lat),"width":parseInt(g[n].width)});};}.call(this,k)});m.renderIn(d);}}.bindTo(this));this.mainContainer.getCSSValue("backgroundImage").match(/([0-9]{3})x([0-9]{3,4})/);var a=RegExp.$1,h=RegExp.$2;this.indexMapName=a+"x"+h;BDPMap.mapRequest.load("indexMap_"+this.indexMapName+".html");document.getElementById("indexMapBlank").style.width=a+"px";document.getElementById("indexMapBlank").style.height=h+"px";document.getElementById("indexMapBlank").style.top="-"+c+"px";document.getElementById("indexMapBlank").style.border="none";}};BDPMap.prototype.unload=function(){BDPMap.map=null;Map24=null;BDPMap=null;contentLoader=null;SubPageLinkProcessor=null;renderer=null;eventHandler.flushAll();eventHandler=null;};BDPMap.prototype.parseAjaxResponse=function(a,b){b=b||this.map.throbber;try{a=JSON.parse(a);if(typeof a=="object"&&(a.status==200||a.status=="ok"||(typeof a.count!="undefined"&&a.count>0))){throw true;}else{throw false;}}catch(c){if(c!==true){b.hide();return false;}else{return a;}}};BDPMap.prototype.teaseMap=function(){};BDPMap.prototype.MapTeaser=function(){};BDPMap.prototype.MapTeaser.prototype.header=renderer.createElement("h4",{"id":"mapTeaserHeader","innerHTML":"Ihre virtuelle Rundreise..."});BDPMap.prototype.MapTeaser.prototype.container=renderer.createElement("div",{"id":"mapTeaser"});BDPMap.prototype.MapTeaser.prototype.textBox=renderer.createElement("div",{"id":"mapTeaserText"});BDPMap.prototype.MapTeaser.prototype.text=new ArrayA("führt Sie über Firmen in Ihrer Nachbarschaft...<br />oder Branchen Ihrer Umgebung...","über Bilder Ihres Wohnortes...<br />zu Fotos aus Ihrer Umgebung.","Sehen Sie Ihre Straße aus der Luft<br />und Ihren Arbeitsplatz von oben.");BDPMap.prototype.MapTeaser.prototype.init=function(){var b=0,a=null;this.header.renderIn(this.container);this.textBox.innerHTML=this.text[b];this.textBox.renderIn(this.container);this.container.style.width=BDPMap.mainContainer.offsetWidth+"px";this.container.renderIn(BDPMap.mainContainer);this.interval=window.setInterval(function(){this.textBox.onfadeready=function(){if(this.textBox.getOpacity()===0){b=b+1>=this.text.length?0:b+1;this.textBox.innerHTML=this.text[b];}this.textBox.onfadeready=undefined;this.textBox.fade();}.bindTo(this);this.textBox.fade();}.bindTo(this),6000);};BDPMap.prototype.WindowManager=function(){};BDPMap.prototype.WindowManager.prototype.buffer=new ArrayA();BDPMap.prototype.WindowManager.prototype.minZindex=5000;BDPMap.prototype.WindowManager.prototype.register=function(a){a.BDPWindowIndex=this.buffer.length;a.draggable.style.zIndex=this.minZindex+this.buffer.length+1;this.buffer.push(a);eventHandler.addEvent(a.draggable,"remove",function(){BDPMap.WindowManager.unregister(this.BDPWindowIndex);}.bindTo(a));eventHandler.addEvent(a.draggable,"mousedown",function(){BDPMap.WindowManager.focus(this.BDPWindowIndex);}.bindTo(a));BDPMap.WindowManager.focus(a.BDPWindowIndex);};BDPMap.prototype.WindowManager.prototype.unregister=function(a){this.buffer.splice(a,1);this.focus(0);};BDPMap.prototype.WindowManager.prototype.focus=function(b){if(this.buffer.length==0){return;}var a=this.buffer[b];this.buffer.splice(b,1);var c=new ArrayA;this.buffer.foreach(function(d){if(d!=a&&!d.dragHandle.hasClassName("backgroundWin")){d.dragHandle.addClassName("backgroundWin");}d.BDPWindowIndex=c.length;d.draggable.style.zIndex=this.minZindex+c.length+1;c.push(d);}.bindTo(this));a.BDPWindowIndex=c.length;a.draggable.style.zIndex=this.minZindex+c.length+1;a.dragHandle.removeClassName("backgroundWin");c.push(a);this.buffer=c;c=undefined;};BDPMap.prototype.WindowManager.prototype.rearrange=function(){this.buffer.foreach(function(b){var c=b.draggable.getScreenOffset();var a=b.dragHandle.getCustomOffset(b.draggable);if(c.x<b.borderPadding){c.x=b.borderPadding;}else{if(c.x+b.dragHandle.offsetWidth+a.x+b.borderPadding>b.border.clientWidth){c.x=b.border.clientWidth-b.dragHandle.offsetWidth-a.x-b.borderPadding;}}if(c.y<b.borderPadding){c.y=b.borderPadding;}else{if(c.y+b.dragHandle.offsetHeight+a.y+b.borderPadding>b.border.clientHeight){c.y=b.border.clientHeight-b.dragHandle.offsetHeight-a.y-b.borderPadding;}}b.draggable.style.left=c.x+"px";b.draggable.style.top=c.y+"px";});};BDPMap.Root=function(a){if(!a){BDPMap.resizeables.push(this);}};BDPMap.Root.prototype.key="";eventHandler.addLoadEvent(function(){BDPMap.WindowManager=new BDPMap.WindowManager();BDPMap.Search=new BDPMap.Search();BDPMap.Search.Business=new BDPMap.Search.Business();BDPMap.Search.Address=new BDPMap.Search.Address();BDPMap.MapTeaser=new BDPMap.MapTeaser();SubPageLinkProcessor.init();document.getElementById("right").style.overflow="hidden";BDPMap.mainContainer=renderer.assimilate(document.getElementById("maparea"));BDPMap.searchResultsContainer=renderer.assimilate(document.getElementById("searchResults"));BDPMap.resizeables.push({"container":BDPMap.mainContainer});BDPMap.tipsContainer=renderer.assimilate(renderer.getElement(".resultListContainer",renderer.getElement("#tips")));BDPMap.setContainerSize();BDPMap.socialBookmarksContainer=document.getElementById("socialBookmarks");BDPMap.socialBookmarks=BDPMap.socialBookmarksContainer.innerHTML;document.body.className="bdpMapBody";eventHandler.addEvent(window,"resize",function(){if(typeof setContainerSizeTimeout!="undefined"){window.clearTimeout(setContainerSizeTimeout);}setContainerSizeTimeout=window.setTimeout(function(){BDPMap.setContainerSize();BDPMap.loadMap();BDPMap.WindowManager.rearrange();if(typeof BDPMap.map.map!="undefined"){google.maps.event.trigger(BDPMap.map.map,"resize");}},500);});BDPMap.loadMap();BDPMap.addCompaniesAction();BDPMap.MapTeaser.init();if(!document.getElementById("contentarea")){if(BDPMap.searchRequest){var a;do{a=BDPMap.searchRequest;BDPMap.searchRequest=decodeURIComponent(BDPMap.searchRequest);}while(a!=BDPMap.searchRequest);BDPMap.map.call(BDPMap.map.search,BDPMap.searchRequest);}else{if(BDPMap.startCLoc){BDPMap.map.call(BDPMap.map.initCLoc,BDPMap.startCLoc);}else{if(BDPMap.startBookmark){BDPMap.map.init();}else{BDPMap.Search.Address.init();}}}}else{if(BDPMap.RegCustomerDeepLink.test(location.pathname.replace(/\.html$/,"").replace(/^\/suche-/,""))){var b=RegExp.$7,d=undefined;try{d=typeof window.opener.BDPMap;}catch(c){}if((window.opener==null||d==undefined)&&b!=""&&!isNaN(b)){window.setTimeout(function(){BDPMap.map.call("initCLoc",b);},1000);}}}BDPMap.map=new BDPMap[BDPMap.provider]();});BDPMap.prototype.error=function(f,d,g){if(typeof this.map!="undefined"&&this.map instanceof this[this.provider]&&typeof this.map.throbber!="undefined"&&this.map.throbber instanceof this.Throbber){this.map.throbber.hide(true);}};eventHandler.addEvent(window,"error",BDPMap.error);BDPMap.prototype.GoogleMaps=function(){this.updateTimer=false;this.polygons={};this.container=BDPMap.mainContainer;this.searchResultsContainer=BDPMap.searchResultsContainer;this.defaultContainerWidth=this.container.getCSSValue("width");this.protectedChilds=new ArrayA();this.initialLoading=true;this.initialData={};this.zoomSlider=new BDPMap.ZoomSlider(this);this.calculator=new BDPMap.Calculator();this.zoomlevel=0;this.validTileStates=new ArrayA("HYBRID","MAP","SATELLITE");var a=window.location.getParameter("tileState");this.defaultTileState=this.validTileStates.inArray(a)?a:BDPMap.defaultTileState;this.activeTileState=this.defaultTileState;this.searchLocWidth=2500;this.searchResults=new BDPMap.SearchResults({"map":this});this.bubbleFactory=new BDPMap.Bubble({"map":this});this.panoramio=new Panoramio();this.panoramioTimeout=this.picBubbleTimeout=5;this.panoramio.show=false;this.picsLocIcon={"width":"32","height":"32"};this.initWebcams();this.initCompanies();if(window.location.getParameter("test")!==false){this.initTraffic();}this.throbber=new BDPMap.Throbber({"map":this});this.throbber.renderIn(this.container);this.throbber.protectedChild=true;this.hintTimeout=5;this.hint=new BDPMap.Hint({"map":this});this.hint.renderIn(this.container);this.hint.protectedChild=true;this.initialBounds={"sw":this.calculator.transFormCoordinate("degToDec",this.calculator.transFormCoordinate("dmsToDeg",{"Latitude":{"GG":47,"MM":16,"SS":15},"Longitude":{"GG":5,"MM":52,"SS":1}})),"ne":this.calculator.transFormCoordinate("degToDec",this.calculator.transFormCoordinate("dmsToDeg",{"Latitude":{"GG":55,"MM":3,"SS":33},"Longitude":{"GG":15,"MM":2,"SS":37}})),"center":this.calculator.transFormCoordinate("degToDec",this.calculator.transFormCoordinate("dmsToDeg",{"Latitude":{"GG":51,"MM":0,"SS":0},"Longitude":{"GG":10,"MM":0,"SS":0}}))};};BDPMap.prototype.GoogleMaps.prototype.defaultMapType=google.maps.MapTypeId.HYBRID;BDPMap.prototype.GoogleMaps.prototype.geocoder=new google.maps.Geocoder();BDPMap.prototype.GoogleMaps.prototype.updateTimeout=500;BDPMap.prototype.GoogleMaps.prototype.call=function(){contentLoader.unload();var a=Array.prototype.slice.call(arguments);if(typeof this[a[0]]!="undefined"||typeof a[0]=="function"){this.callback=function(){var b=a.shift();typeof this[b]!="undefined"?this[b].apply(this,a):b.apply(this,a);};if(this.initialLoading==true){this.init();}else{this.callback();this.callback=undefined;}}else{throw ("BDPMap.map."+arguments[0]+" is undefined. BDPMap.map.call");}};BDPMap.prototype.GoogleMaps.prototype.emptyContainer=function(){var f=this.container.childNodes;var a=new Object;for(var b=0;b<f.length;b++){a[b]=f[b];}for(var d in a){if(a[d].protectedChild){continue;}else{a[d].parentNode.removeChild(a[d]);}}};BDPMap.prototype.GoogleMaps.prototype.init=function(){window.clearInterval(BDPMap.MapTeaser.interval);if(typeof BDPMap.Search.Address.adressInput!="undefined"&&typeof BDPMap.Search.Address.adressInput.container!="undefined"){BDPMap.Search.Address.adressInput.container.destruct();}this.emptyContainer();this.container.className="mapinuse";var a=new google.maps.LatLng(this.initialBounds.center.Latitude,this.initialBounds.center.Longitude);this.loadMap(this.options={zoom:4,center:a,mapTypeId:this.defaultMapType,disableDefaultUI:true,noClear:true});return true;};BDPMap.prototype.GoogleMaps.prototype.OverlayView=function(a){this.setMap(a);};BDPMap.prototype.GoogleMaps.prototype.OverlayView.prototype=new google.maps.OverlayView();BDPMap.prototype.GoogleMaps.prototype.OverlayView.prototype.draw=function(){};BDPMap.prototype.GoogleMaps.prototype.OverlayView.prototype.onAdd=function(){};BDPMap.prototype.GoogleMaps.prototype.OverlayView.prototype.onRemove=function(){};BDPMap.prototype.GoogleMaps.prototype.loadMap=function(a){this.map=new google.maps.Map(this.container,a);this.helperOverlay=new this.OverlayView(this.map);google.maps.event.addListenerOnce(this.map,"tilesloaded",function(){google.maps.event.addListener(this.map,"center_changed",this.setTimer.bindTo(this,"updateTimer",this.updateView,this.updateTimeout));this.initialZoomlevel=this.getZoomlevel();this.initialDistance=this.getCurrentWidth();this.initControls();this.initFeaturesControl();this.searchResultsContainer.empty();this.updateView();}.bindTo(this));return this.map;};BDPMap.prototype.GoogleMaps.prototype.setTimer=function(d,c,b,a){if(!a){window.clearTimeout(this["refName"]);}this["refName"]=window.setTimeout(c.bindTo(this),b);return this["refName"];};BDPMap.prototype.GoogleMaps.prototype.getPolygon=function(a){var b=new HttpRequest();b.init(this.drawPolygon.bindTo(this));b.load("test.php?pid="+a);};BDPMap.prototype.GoogleMaps.prototype.drawPolygon=function(a){var b=0,d=null,c;c=JSON.parse(a);a=undefined;this.polygons[c.pid]={};for(d in c.polygons){this.polygons[c.pid][d]={};this.polygons[c.pid][d].coords=[];l=c.polygons[d].length;for(b=0;b<l;b++){this.polygons[c.pid][d].coords.push(new google.maps.LatLng(c.polygons[d][b][0],c.polygons[d][b][1]));}this.polygons[c.pid][d].polygon=new google.maps.Polygon({paths:this.polygons[c.pid][d].coords,strokeColor:"#2F99FF",strokeOpacity:0.8,strokeWeight:1,fillColor:"#2F99FF",fillOpacity:0.35});this.polygons[c.pid][d].polygon.GoogleMaps={};this.polygons[c.pid][d].polygon.GoogleMaps.pid=c.pid;google.maps.event.addListenerOnce(this.polygons[c.pid][d].polygon,"click",function(){for(var f in this.polygons[c.pid]){this.polygons[c.pid][f].polygon.setMap(null);}}.bindTo(this));this.polygons[c.pid][d].polygon.setMap(this.map);}};BDPMap.prototype.GoogleMaps.prototype.initControls=function(){var d=this;this.zoomSlider.init();this.naviRose=renderer.createElement("img",{"src":"images/mapControls/rose.png","id":"naviRosePic","useMap":"#naviRoseMap","width":"115","height":"115"});var a=document.getElementById("naviRoseMap").getElementsByTagName("area");for(var b=0;b<a.length;b++){eventHandler.addEvent(a[b],"click",function(g){g=eventHandler.getEvent(g);g.preventDefault();d.pan(this.alt.toUpperCase());});}this.fullScreenButton=renderer.createElement("img",{"id":"toggleFullscreen","src":"images/mapControls/fullscreen.png","title":"Vollbild an/aus"});this.bookmarkButton=renderer.createElement("img",{"id":"mapBookmarkButton","src":"images/actions/bookmarklinkbutton.png","title":"URL zu dieser Karte"});this.tileStateSelector=renderer.createElement("div",{"id":"tileStateSelector"});this.tileStateSelectorActivator=renderer.createElement("div",{"id":"tileStateSelectorActivator"});eventHandler.addEvent(this.tileStateSelector,"click",function(){this.tileStateSelectorNames.style.display=this.tileStateSelectorNames.style.display!="block"?"block":"none";}.bindTo(this));eventHandler.addEvent(this.tileStateSelector,"mouseover",function(){if(this.tileStateSelector.closeTimeout){window.clearTimeout(this.tileStateSelector.closeTimeout);}}.bindTo(this));eventHandler.addEvent(this.tileStateSelector,"mouseout",function(){this.tileStateSelector.closeTimeout=window.setTimeout(function(){this.tileStateSelectorNames.style.display="none";}.bindTo(this),1500);}.bindTo(this));this.tileStateSelector.appendChild(this.tileStateSelectorActivator);this.tileStateSelectorActivator.appendChild(renderer.createElement("div"));this.tileStateSelectorActiveName=renderer.createElement("div",{"id":"tileStateSelectorActiveName","className":"tileStateSelectorNames"});this.tileStateSelectorNames=renderer.createElement("div",{"id":"tileStateSelectorNames","className":"tileStateSelectorNames","onrender":function(){var h=this;var j={"MAP":{"name":"Karte","argument":"MAP"},"HYBRID":{"name":"Hybrid","argument":"HYBRID"},"SATELLITE":{"name":"Satelit","argument":"SATELLITE"}};this.tileStateSelector.setState=function(i){if(typeof j[i]!="undefined"){j[i].trigger.call(j[i].element);}else{if(typeof console!="undefined"){throw'Tilestate "'+i+'" is not valid. Choose one of '+BDPMap.map.validTileStates.join(", ");}}};for(var g in j){j[g].element=renderer.createElement("div");j[g].element.argument=j[g].argument;j[g].element.appendChild(document.createTextNode(j[g].name));if(g==this.defaultTileState){j[g].element.renderIn(this.tileStateSelectorActiveName);}else{j[g].element.renderIn(this.tileStateSelectorNames);}eventHandler.addEvent(j[g].element,"click",j[g].trigger=function(){if(h.activeTileState!=this.argument){var n=this,m=this.parentNode.previousSibling.firstChild,k,i=null;k=renderer.assimilate(m.cloneNode(true));m.remove();m.className="";n.parentNode.insertBefore(m,n);n.remove();n.className="";n.renderIn(h.tileStateSelectorActiveName,"fade");k.style.position="absolute";k.style.left=n.offsetLeft+"px";k.style.top=n.offsetTop+"px";h.tileStateSelectorActiveName.appendChild(k);eventHandler.addEvent(k,"fadeready",i=function(){eventHandler.removeEvent(k,"fadeready",i);k=undefined;});k.remove("fade");h.activeTileState=this.argument;h.setTileState(this.argument);}});eventHandler.addEvent(j[g].element,"mouseover",function(){if(h.activeTileState!=this.argument){this.element.className="tileStateHover";}}.bindTo(j[g]));eventHandler.addEvent(j[g].element,"mouseout",function(){this.element.className="";}.bindTo(j[g]));}this.tileStateSelectorNames.style.width=this.tileStateSelector.clientWidth-this.tileStateSelector.getCSSValue("paddingLeft","int")-this.tileStateSelector.getCSSValue("paddingRight","int")-this.tileStateSelectorActivator.firstChild.offsetWidth+"px";this.tileStateSelectorActiveName.style.width=this.tileStateSelector.clientWidth-this.tileStateSelectorActiveName.getCSSValue("paddingLeft","int")-this.tileStateSelector.getCSSValue("paddingLeft","int")-this.tileStateSelector.getCSSValue("paddingRight","int")-this.tileStateSelectorActivator.firstChild.offsetWidth+"px";this.tileStateSelectorNames.style.left=this.tileStateSelectorActiveName.style.left=this.tileStateSelector.getCSSValue("paddingLeft","int")+this.tileStateSelectorActivator.firstChild.offsetWidth+"px";this.tileStateSelectorNames.style.top=this.tileStateSelector.clientHeight+"px";}.bindTo(this)});this.controlsArea=renderer.createElement("div",{"id":"controlsArea"});var c=renderer.createElement("div",{"id":"controlsAreaBackground","className":"bubbleBackgroundColor"});c.renderIn(this.controlsArea);var f=renderer.createElement("img",{"id":"controlsAreaOff","src":BDPMap.imgPrefix+"actions/off_small.png"});f.renderIn(this.controlsArea);this.naviRose.renderIn(this.controlsArea);this.bookmarkButton.renderIn(this.controlsArea);this.zoomSlider.border.renderIn(this.controlsArea);this.fullScreenButton.renderIn(this.controlsArea);this.container.insertBefore(this.controlsArea,this.container.firstChild);this.tileStateSelector.renderIn(this.controlsArea);this.tileStateSelectorActiveName.renderIn(this.tileStateSelector);this.tileStateSelectorNames.renderIn(this.tileStateSelector);eventHandler.addEvent(this.fullScreenButton,"click",this.toggleFullScreen=function(){if(navigator.cookieEnabled){BDPMap.Cookie.set({"name":"fullScreen","value":BDPMap.Cookie.get("fullScreen")=="true"?"false":"true","expires":"+1hour"});}this.fullScreen=!this.fullScreen;var g=new BDPMap.Coordinate(this.getCoordinates().Center).setMapPosition("Center");BDPMap.setContainerSize(g);}.bindTo(this));eventHandler.addEvent(this.bookmarkButton,"click",this.toggleFullScreen=function(){var h=this.calculator.MmToDd(this.getCoordinates().Center),g=this.getZoomlevel(1);BDPMap.Element.bookmarkBox("http://"+location.host+"/?longitude="+h.Longitude+"&latitude="+h.Latitude+"&zoom="+g);}.bindTo(this));eventHandler.addEvent(f,"click",function(){this.controlsArea.slideOut();}.bindTo(this));this.controlsArea.slideIn=function(){if(!this.controlsArea.moving){renderer.move(this.controlsArea,{"x":0,"y":0},true);this.controlsArea.onmoveready=function(){eventHandler.removeEvent(this.controlsArea,"mouseover",this.controlsArea.slideIn);}.bindTo(this);}}.bindTo(this);this.controlsArea.slideOut=function(){renderer.move(this.controlsArea,{"x":-(this.controlsArea.offsetWidth-20),"y":-(this.controlsArea.offsetHeight-20)},true);this.controlsArea.onmoveready=function(){eventHandler.addEvent(this.controlsArea,"mouseover",this.controlsArea.slideIn);}.bindTo(this);}.bindTo(this);};BDPMap.prototype.GoogleMaps.prototype.initFeaturesControl=function(){var d={"panoramio":{"title":"Fotos","invoke":function(){this.loadPics();}.bindTo(this),"disable":function(){this.removePicLocs();}.bindTo(this)},"webcams":{"title":"Webcams","invoke":function(){this.webcams.load();}.bindTo(this),"disable":function(){this.webcams.removeAll();}.bindTo(this)},"traffic":{"title":"Verkehr","invoke":function(){this.traffic.load();}.bindTo(this),"disable":function(){this.traffic.removeAll();}.bindTo(this)},"weather":{"title":"Wetter","invoke":function(){this.weather.copyright.show();this.weather.load();}.bindTo(this),"disable":function(){this.weather.copyright.remove();this.weather.removeAll();}.bindTo(this)},"companies":{"title":"Firmen","invoke":function(){this.companies.load();}.bindTo(this),"disable":function(){this.companies.removeAll();this.searchResults.removeAll();}.bindTo(this)}},b=21,a=BDPMap.featuresControl=renderer.createElement("div",{"id":"featureControlsContainer","className":"bubbleBackgroundColor"}),c=null,g,h;this.featuresControl={show:true};h=renderer.createElement("img",{"id":"featureControlsOff","src":BDPMap.imgPrefix+"actions/off_small.png"});h.renderIn(a);eventHandler.addEvent(h,"click",function(){a.slideOut();}.bindTo(this));a.slideIn=function(){if(!a.moving){renderer.move(a,{"x":(this.container.offsetWidth-a.offsetWidth),"y":(this.container.offsetHeight-a.offsetHeight-b)},true);a.onmoveready=function(){eventHandler.removeEvent(a,"mouseover",a.slideIn);this.featuresControl.show=true;}.bindTo(this);}}.bindTo(this);a.slideOut=function(){renderer.move(a,{"x":(this.container.offsetWidth-20),"y":(this.container.offsetHeight-a.offsetHeight-b)},true);a.onmoveready=function(){eventHandler.addEvent(a,"mouseover",a.slideIn);this.featuresControl.show=false;}.bindTo(this);}.bindTo(this);for(c in d){if(typeof this[c]!="undefined"){d[c].button=renderer.createElement("div",{"className":"controlsButton"});d[c].buttonBg=renderer.createElement("div",{"className":"controlsButtonBg"});d[c].buttonBg.renderIn(d[c].button);d[c].buttonBgRight=renderer.createElement("div",{"className":"controlsButtonBgRight"});d[c].buttonBgRight.renderIn(d[c].buttonBg);d[c].textBox=renderer.createElement("div",{"className":"controlsButtonLabel"});d[c].textBox.appendChild(document.createTextNode(d[c].title));d[c].textBox.renderIn(d[c].buttonBg);d[c].toggle=function(f){return function(){if(this[f].show==true){d[f].disable();d[f].button.removeClassName("controlsButtonActive");this[f].show=false;}else{d[f].invoke();d[f].button.addClassName("controlsButtonActive");this[f].show=true;}}.bindTo(this);}.bindTo(this);g=this[c].show?"addClassName":"removeClassName";d[c].button[g]("controlsButtonActive");eventHandler.addEvent(d[c].button,"mousedown",function(f){f=eventHandler.getEvent(f);f.preventDefault();});eventHandler.addEvent(d[c].button,"click",d[c].toggle.call(this,c));d[c].button.renderIn(a);}}this.container.insertBefore(a,this.controlsArea.nextSibling);a.style.top=(this.container.offsetHeight-a.offsetHeight-b)+"px";a.style.left=(this.container.offsetWidth-a.offsetWidth)+"px";};BDPMap.prototype.GoogleMaps.prototype.centerCoordinate=function(a){this.zoomToWidth(a);};BDPMap.prototype.GoogleMaps.prototype.center=function(a,b){var d,c=undefined;if(a instanceof google.maps.LatLng){d=a;}else{if(a instanceof google.maps.Marker){d=a.getPosition();}else{return;}}if(b){c=this.getCurrentWidth();}this.centerCoordinate({"Latitude":d.lat(),"Longitude":d.lng(),"width":c});};BDPMap.prototype.GoogleMaps.prototype.zoomToWidth=function(b){var f=new google.maps.LatLng(b.Latitude,b.Longitude),g,a,c,d=b.width||2500;g=google.maps.geometry.spherical.computeOffset(f,d/4,90);a=google.maps.geometry.spherical.computeOffset(f,d/4,270);c=new google.maps.LatLngBounds(a,g);this.map.fitBounds(c);};BDPMap.prototype.GoogleMaps.prototype.zoomToCoordinateRect=function(g){var c=new google.maps.LatLng(g.Center.Latitude,g.Center.Longitude),b=new google.maps.LatLng(g.LowerRight.Latitude,g.TopLeft.Longitude),i,h,a,d,f;i=google.maps.geometry.spherical.computeDistanceBetween(c,b);h=(this.getDimensions().Width/2)/(this.getDimensions().Height/2);h=Math.atan(h);h=h*360/(2*Math.PI);h=parseFloat(h);a=google.maps.geometry.spherical.computeOffset(c,i/2,h);d=google.maps.geometry.spherical.computeOffset(c,i/2,180+h);f=new google.maps.LatLngBounds(d,a);this.map.fitBounds(f);};BDPMap.prototype.GoogleMaps.prototype.zoom=function(b){this.map.setZoom(b);var a=this.getZoomlevel(true);if(this.zoomlevel!=a){this.zoomSlider.slider.moveTo({"left":this.zoomSlider.calcPercentageSliderPos(a)},false);this.zoomlevel=a;}};BDPMap.prototype.GoogleMaps.prototype.getZoomlevel=function(b){var c;if(b){var a=100/(21-1);c=Math.round((this.map.getZoom()-1)*a);}else{c=this.map.getZoom();}return c;};BDPMap.prototype.GoogleMaps.prototype.pan=function(a){switch(a){case"NORTH":this.map.panBy(0,-this.container.clientHeight/2-1);break;case"NORTHEAST":this.map.panBy(this.container.clientWidth/2-1,-this.container.clientHeight/2-1);break;case"EAST":this.map.panBy(this.container.clientWidth/2-1,0);break;case"SOUTHEAST":this.map.panBy(this.container.clientWidth/2-1,this.container.clientHeight/2-1);break;case"SOUTH":this.map.panBy(0,this.container.clientHeight/2-1);break;case"SOUTHWEST":this.map.panBy(-this.container.clientWidth/2-1,this.container.clientHeight/2-1);break;case"WEST":this.map.panBy(-this.container.clientWidth/2-1,0);break;case"NORTHWEST":this.map.panBy(-this.container.clientWidth/2-1,-this.container.clientHeight/2-1);break;}};BDPMap.prototype.GoogleMaps.prototype.setTileState=function(a){a=a=="MAP"?"ROADMAP":a;this.map.setMapTypeId(google.maps.MapTypeId[a]);};BDPMap.prototype.GoogleMaps.prototype.getDistance=function(b,a){return google.maps.geometry.spherical.computeDistanceBetween(b,a);};BDPMap.prototype.GoogleMaps.prototype.getCurrentWidth=function(){var b=this.map.getBounds(),d=0,a=0,f=0,c=0;a=b.getSouthWest();d=b.getNorthEast();f=new google.maps.LatLng(d.lat(),d.lng());c=new google.maps.LatLng(d.lat(),a.lng());return this.getDistance(f,c);};BDPMap.prototype.GoogleMaps.prototype.getCurrentHeight=function(){var b=this.map.getBounds(),d=0,a=0,f=0,c=0;a=b.getSouthWest();d=b.getNorthEast();f=new google.maps.LatLng(d.lat(),d.lng());c=new google.maps.LatLng(a.lat(),d.lng());new google.maps.Marker({"pos":f,"map":this.map});new google.maps.Marker({"pos":c,"map":this.map});return this.getDistance(f,c);};BDPMap.prototype.GoogleMaps.prototype.getDimensions=function(){var a={Width:this.container.clientWidth,Height:this.container.clientHeight};return a;};BDPMap.prototype.GoogleMaps.prototype.getCoordinates=function(){var g=this.map.getCenter(),d=this.map.getBounds(),f,a;f=d.getNorthEast();a=d.getSouthWest();return{"Center":{"Longitude":g.lng(),"Latitude":g.lat(),"type":"Dd"},"TopLeft":{"Longitude":a.lng(),"Latitude":f.lat(),"type":"Dd"},"LowerRight":{"Longitude":f.lng(),"Latitude":a.lat(),"type":"Dd"}};};BDPMap.prototype.GoogleMaps.prototype.getCoordinateOffset=function(d){var c,a,b;if(typeof d.type!="undefined"&&d.type=="Mm"){d=this.calculator.MmToDd(d);}c=new google.maps.LatLng(d.Latitude,d.Longitude),b=this.helperOverlay.getProjection();if(typeof b=="undefined"){return false;}a=b.fromLatLngToContainerPixel(c);return{"screen":{"x":Math.round(a.x+this.mapAreaOffset.x),"y":Math.round(a.y+this.mapAreaOffset.y)},"mapArea":{"x":Math.round(a.x),"y":Math.round(a.y)}};};BDPMap.prototype.GoogleMaps.prototype.initWebcams=function(){this.webcams=new BDPMap.Locations({"map":this,"baseUrl":"getCams.html?q=","responseFilter":"webcams.webcam","CSSPrefix":"cam","onclick":function(a){this.bubbleFactory.buildWebcamBubble(a);},"getUrl":function(){var a=this.map.getCoordinates();a.Center={"Longitude":a.Center.Longitude,"Latitude":a.Center.Latitude};a.TopLeft={"Longitude":a.TopLeft.Longitude,"Latitude":a.TopLeft.Latitude};var d=Math.abs(Math.max(a.Center.Longitude,a.TopLeft.Longitude)-Math.min(a.Center.Longitude,a.TopLeft.Longitude));var c=Math.abs(Math.max(a.Center.Latitude,a.TopLeft.Latitude)-Math.min(a.Center.Latitude,a.TopLeft.Latitude));var b="deg";return this.baseUrl+'{"center":{"Longitude":"'+a.Center.Longitude+'","Latitude":"'+a.Center.Latitude+'"},"radius":"'+(d>c?c:d)+'","unit":"'+b+'"}';}});this.webcams.show=false;};BDPMap.prototype.GoogleMaps.prototype.initTraffic=function(){this.traffic=new BDPMap.Locations({"map":this,"baseUrl":"tools/getTrafficData.php?q=","responseFilter":"traffic","CSSPrefix":"traffic","onclick":function(a){},"getUrl":function(){var a=this.map.getCoordinates();a.LowerRight={"Longitude":a.LowerRight.Longitude,"Latitude":a.LowerRight.Latitude};a.TopLeft={"Longitude":a.TopLeft.Longitude,"Latitude":a.TopLeft.Latitude};a.LowerRight=this.map.calculator.decToDecMicro(a.LowerRight.Latitude,a.LowerRight.Longitude);a.TopLeft=this.map.calculator.decToDecMicro(a.TopLeft.Latitude,a.TopLeft.Longitude);return this.baseUrl+'{"TopLeft":{"Longitude":"'+a.TopLeft.Longitude+'","Latitude":"'+a.TopLeft.Latitude+'"},"LowerRight":{"Longitude":"'+a.LowerRight.Longitude+'","Latitude":"'+a.LowerRight.Latitude+'"}}';}});this.traffic.show=true;};BDPMap.prototype.GoogleMaps.prototype.initWeather=function(){this.weather=new BDPMap.Locations({"map":this,"baseUrl":"tools/getWeather.php?q=","responseFilter":"weather","CSSPrefix":"weather","onclick":function(a){},"onmouseover":function(a){if(typeof a.bubble=="undefined"){a.bubble=new this.bubbleFactory.Skeleton(a.origin.html);eventHandler.addEvent(a.bubble.container,"render",function(){var b={"Longitude":a.providerLoc._Longitude,"Latitude":a.providerLoc._Latitude};var c=this.getCoordinateOffset(b);a.bubble.setPosition(c.screen.x-Math.round(a.bubble.container.offsetWidth/2),c.screen.y-a.bubble.container.offsetHeight-24);}.bindTo(this));a.bubble.render();}},"onmouseout":function(a){if(typeof a.bubble!="undefined"){window.setTimeout(function(){if(typeof a.bubble!="undefined"){a.bubble.container.remove((userAgent.app=="MSIE"?"":"fade"));a.bubble=undefined;}}.bindTo(this),1000);}},"getUrl":function(){var a=this.map.getCoordinates();a.LowerRight={"Longitude":a.LowerRight.Longitude,"Latitude":a.LowerRight.Latitude};a.TopLeft={"Longitude":a.TopLeft.Longitude,"Latitude":a.TopLeft.Latitude};return this.baseUrl+'{"TopLeft":{"Longitude":"'+a.TopLeft.Longitude+'","Latitude":"'+a.TopLeft.Latitude+'"},"LowerRight":{"Longitude":"'+a.LowerRight.Longitude+'","Latitude":"'+a.LowerRight.Latitude+'"}}';}});this.weather.show=true;this.weather.copyright={display:0,element:function(){var a=renderer.createElement("span");a.createChild("a",{"href":"http://www.weatherbug.com","target":"_blank"}).write(" - ").createChild("b").write("Powered by Weatherbug©");return a;}.call(this),show:function(){if(this.weather.copyright.display==0){document.getElementById("footer").insertBefore(this.weather.copyright.element,document.getElementById("socialBookmarks"));this.weather.copyright.display=1;}}.bindTo(this),remove:function(){this.weather.copyright.display=0;this.weather.copyright.element.remove();}.bindTo(this)};};BDPMap.prototype.GoogleMaps.prototype.initCompanies=function(){this.companies=new BDPMap.Locations({"map":this,"baseUrl":"getCompanies.html?q=","responseFilter":"companies","CSSPrefix":"companies","additionalAction":function(a){this.searchResults.display(a);},"onclick":function(a){this.bubbleFactory.buildCompany(a);},"onmouseover":function(a){a.searchResult.scrollIntoView();a.searchResult.addClassName("highlight");},"onmouseout":function(a){a.searchResult.removeClassName("highlight");},"getUrl":function(){var a=this.map.getCoordinates();return this.baseUrl+'{"cLoc":"'+(this.map.currentCLoc!=""?+this.map.currentCLoc:"0")+'","TopLeft":{"Longitude":"'+a.TopLeft.Longitude+'","Latitude":"'+a.TopLeft.Latitude+'"},"LowerRight":{"Longitude":"'+a.LowerRight.Longitude+'","Latitude":"'+a.LowerRight.Latitude+'"},"page":'+this.page+"}";}});this.companies.show=true;};BDPMap.prototype.GoogleMaps.prototype.initCLoc=function(b,a){this.currentCLoc=b;a=a||"Dd";this.cLoc=new BDPMap.Locations({"map":this,"baseUrl":"getCLoc.html?q=","responseFilter":"companies","CSSPrefix":"companies","additionalAction":function(c){this.centerCoordinate({"Longitude":c.origin.longitude,"Latitude":c.origin.latitude,"Type":a},2500);this.bubbleFactory.buildCompany(c);this.cLoc.additionalAction=undefined;},"onclick":function(c){this.bubbleFactory.buildCompany(c);},"onmouseover":function(c){},"getUrl":function(){return this.baseUrl+'{"id":'+b+"}";}});this.cLoc.load();};BDPMap.prototype.GoogleMaps.prototype.simpleLocation=function(){if(typeof arguments[0].Longitude=="undefined"||isNaN(arguments[0].Longitude)||typeof arguments[0].Latitude=="undefined"||isNaN(arguments[0].Latitude)){throw"Wrong Argument - BDPMap.map.simpleLocation";}else{var f=arguments[0].Longitude,a=arguments[0].Latitude,d=arguments[0].width||2500,g=arguments[0].title||"",c=arguments[0].icon_url||BDPMap.imgPrefix+"locations/pointer_red.png",b=arguments[0].tileState||false;}this.call(function(){this.initLocation({"origin":{"longitude":f,"latitude":a,"title":g,"icon_url":c}});this.centerCoordinate({"Longitude":f,"Latitude":a,"width":d});this.validTileStates.inArray(b)?this.tileStateSelector.setState(b):null;});};BDPMap.prototype.GoogleMaps.prototype.loadPics=function(){this.throbber.show("GoogleMaps.loadPics");var a=this.getCoordinates();if(typeof this.getPicsRequest!="undefined"&&this.getPicsRequest instanceof HttpRequest&&this.getPicsRequest.loading==true){this.getPicsRequest.abort();}this.getPicsRequest=new HttpRequest;this.getPicsRequest.init(this.insertPicLocs.bindTo(this));this.getPicsRequestTries=5;this.getPicsUrl='getPics.html?q={"TopLeftLong":"'+a.TopLeft.Longitude+'","LowerRightLat":"'+a.LowerRight.Latitude+'","LowerRightLong":"'+a.LowerRight.Longitude+'","TopLeftLat":"'+a.TopLeft.Latitude+'"}';this.getPicsRequest.load(this.getPicsUrl);};BDPMap.prototype.GoogleMaps.prototype.removePicLocs=function(b){this.throbber.show("GoogleMaps.removePicLocs");b=b||false;if(!b){for(var a in this.picLocations){this.picLocations[a].googleLoc.remove();}this.picLocations=undefined;}else{if(b instanceof google.maps.Marker){b.remove();}}this.throbber.hide();};BDPMap.prototype.GoogleMaps.prototype.insertPicLocs=function(a){var h=this;if(this.picLocations){this.removePicLocs();}this.picLocations={};a=BDPMap.parseAjaxResponse(a);if(a===false){return;}if(a.photos.length==0){this.hint.show("noPics","Bilder für diesen Ausschnitt zur Zeit nicht verfügbar");this.throbber.hide();}else{window.clearTimeout(this.getPicsRequestTimeout);this.throbber.hide();}var j=a.photos;var d=a.has_more;for(var c=0;c<j.length;c++){this.picLocations[c]={};this.picLocations[c].origin=j[c];this.picLocations[c].current=0;var g=new google.maps.LatLng(j[c].latitude,j[c].longitude);this.picLocations[c].googleLoc=new google.maps.Marker({"position":g,"map":this.map,"icon":new google.maps.MarkerImage(j[c].photo_file_url.replace(/\/medium\//,"/mini_square/"),null,null,new google.maps.Point(16,16))});this.picLocations[c].googleLoc.remove=function(){google.maps.event.clearInstanceListeners(this);this.setVisible(false);delete this;};var f=this.helperOverlay.getProjection();var b=f.fromLatLngToContainerPixel(g);this.picLocations[c].offset={"screen":{"x":b.x+this.mapAreaOffset.x-Math.round(h.picsLocIcon.width/2),"y":b.y+this.mapAreaOffset.y-Math.round(h.picsLocIcon.height/2),"center":{"x":b.x+this.mapAreaOffset.x,"y":b.y+this.mapAreaOffset.y}},"mapArea":{"x":b.x-Math.round(h.picsLocIcon.width/2),"y":b.y-Math.round(h.picsLocIcon.height/2),"center":{"x":b.x,"y":b.y}}};this.picLocations[c].area={"TopLeft":{"pixel":{"x":this.picLocations[c].offset.mapArea.x-25,"y":this.picLocations[c].offset.mapArea.y-25},"coordinates":function(){var i={"x":this.picLocations[c].offset.mapArea.x-25,"y":this.picLocations[c].offset.mapArea.y-25};var k=this.helperOverlay.getProjection().fromContainerPixelToLatLng(new google.maps.Point(i.x,i.y));return{"degrees":{"Longitude":k.lng(),"Latitude":k.lat()}};}.bindTo(this)()},"LowerRight":{"pixel":{"x":this.picLocations[c].offset.mapArea.x+25,"y":this.picLocations[c].offset.mapArea.y+25},"coordinates":function(){var i={"x":this.picLocations[c].offset.mapArea.x+25,"y":this.picLocations[c].offset.mapArea.y+25};var k=this.helperOverlay.getProjection().fromContainerPixelToLatLng(new google.maps.Point(i.x,i.y));return{"degrees":{"Longitude":k.lng(),"Latitude":k.lat()}};}.bindTo(this)()},"Distance":function(){var i=this.getDistance(g,this.helperOverlay.getProjection().fromContainerPixelToLatLng(new google.maps.Point(this.picLocations[c].offset.mapArea.x-25,this.picLocations[c].offset.mapArea.y-25)));return{"m":i.toFixed(2),"km":(i/1000).toFixed(2)};}.bindTo(this)()};google.maps.event.addListener(this.picLocations[c].googleLoc,"click",this.picLocations[c].loader=function(p){if(typeof p=="string"){p=BDPMap.parseAjaxResponse(p);if(p===false){return;}}if(typeof p.has_more!="undefined"){this.has_more=p.has_more;}else{this.has_more=d;}if(typeof this.buffered!="undefined"){if(p.count==0||p.photos[0].photo_id==this.buffered.photo_id||p.photos[0].photo_id==this.origin.photo_id||this.surroundPicIds.inArray(p.photos[0].photo_id)){this.invokeNextImageTimeout=window.setTimeout(function(){this.nextImageListener();this.map.throbber.hide();}.bindTo(this),1000);return;}window.clearTimeout(this.getNextPicTimeout);this.surroundPicIds.push(p.photos[0].photo_id);this.origin=p.photos[0];if(p.count==this.current){this.current=0;}}else{this.surroundPicIds=new ArrayA(this.origin.photo_id);this.buffered=this.origin;}if(typeof this.picBubbleContainer!="undefined"){this.posLeft=this.picBubbleContainer.getCSSValue("left");this.posTop=this.picBubbleContainer.getCSSValue("top");this.picBubbleContainer.remove(userAgent.app=="MSIE"?"":"fade");}this.titleBar=renderer.createElement("div",{"className":"titleBar"});var k=new BDPMap.Draggable({"border":document.body,"dragHandle":this.titleBar});this.picBubbleContainer=k.draggable;BDPMap.WindowManager.register(k);this.picBubbleContainer.setProperties({"className":"picBubbleContainer bubbleContainer","onrender":function(){h.panoramio.initPicBubble.call(this,h);h.throbber.hide();}.bindTo(this)});if(userAgent.app!="MSIE"||(userAgent.app=="MSIE"&&userAgent.version>=7)){this.picBubbleBackground=renderer.createElement("div",{"className":"bubbleBackground bubbleBackgroundColor"});this.picBubbleBackground.renderIn(this.picBubbleContainer);this.picBubbleShadow=new Shadow();this.picBubbleShadow.renderIn(this.picBubbleContainer);}if(userAgent.app=="Opera"){eventHandler.addEvent(this.picBubbleContainer,"fadeready",this.picBubbleContainer.operaFix=function(){var r=this.picBubbleShadow.childNodes;for(var q=0;q<r.length;q++){r[q].style.border="none";}eventHandler.removeEvent(this.picBubbleContainer,"fadeready",this.picBubbleContainer.operaFix);}.bindTo(this));}this.picBubbleContainer.renderIn(document.body,(userAgent.app=="MSIE"?"":"fade"));if(userAgent.app=="Opera"){var o=this.picBubbleShadow.childNodes;var n=null;for(var m=0;m<o.length;m++){if(o[m].className.indexOf("op")>-1){n="borderBottom";}else{if(o[m].className.indexOf("ottom")>-1){n="borderTop";}else{if(o[m].className.indexOf("shadowRight")>-1){n="borderLeft";}else{if(o[m].className.indexOf("shadowLeft")>-1){n="borderRight";}else{if(o[m].className.indexOf("enter")>-1){n="borderBottom";}}}}}o[m].style[n]="1px solid black";n=null;}}}.bindTo(this.picLocations[c]));}};BDPMap.prototype.GoogleMaps.prototype.initLocation=function(a){var b=a.origin.icon_url.indexOf("http://")==0?a.origin.icon_url:"http://www."+BDPMap.siteName+"/"+a.origin.icon_url,d=new google.maps.LatLng(a.origin.latitude,a.origin.longitude),c=this;a.providerLoc=new google.maps.Marker({"map":this.map,"position":d,"icon":new google.maps.MarkerImage(b,null,null,new google.maps.Point(a.origin.icon_offset_x||20,a.origin.icon_offset_y||20)),"title":a.origin.title||undefined});if(typeof a.onclick=="function"){google.maps.event.addListener(a.providerLoc,"click",a.onclick.bindTo(a));}if(typeof a.onmouseover=="function"){google.maps.event.addListener(a.providerLoc,"mouseover",a.onmouseover.bindTo(a));}if(typeof a.onmouseout=="function"){google.maps.event.addListener(a.providerLoc,"mouseout",a.onmouseout.bindTo(a));}google.maps.event.addListener(a.providerLoc,"rightclick",function(){if(typeof c.addressSearchResults!="undefined"&&typeof a.index!="undefined"&&c.addressSearchResults[a.index]==a){c.addressSearchResults.splice(a.index,1);}if(typeof a.resultlistBox!="undefined"){a.resultlistBox.remove();}a.remove();});a.remove=function(){google.maps.event.clearInstanceListeners(a.providerLoc);this.providerLoc.setVisible(false);delete this;};a.showOnMap=function(){if(document.getElementById("contentarea")){return;}var i=a.providerLoc.getPosition();var g=this.getCoordinateOffset({"Latitude":i.lat(),"Longitude":i.lng()}).screen;if(!g){return;}if(typeof a.marker=="undefined"){a.marker=renderer.createElement("img",{"src":"images/locations/marker_32x47.gif","className":"searchResultsMarker"});}a.marker.style.left=g.x-16+"px";a.marker.style.top=g.y-47-a.origin.icon_offset_y+"px";a.marker.setOpacity(1);a.marker.renderIn(document.body);var h=new ArrayA();BDPMap.WindowManager.buffer.foreach(function(k){var j=k.draggable.getCSSValue("paddingTop","int");if(k.draggable.offsetTop-j<a.marker.offsetTop+a.marker.offsetHeight&&k.draggable.offsetLeft<a.marker.offsetLeft+(Math.round(a.marker.offsetWidth/2))&&k.draggable.offsetTop+k.draggable.offsetHeight-(Math.round(a.marker.offsetHeight/2))>a.marker.offsetTop&&k.draggable.offsetLeft+k.draggable.offsetWidth-(Math.round(a.marker.offsetWidth/2))>a.marker.offsetLeft){h.push(k);}});if(h.length>0){var f=0.5/h.length;h.foreach(function(j){if(typeof j.transparentMarker=="undefined"){if(userAgent.app=="MSIE"&&userAgent.version<9){j.draggable.getElement(".bubbleBackground").filters.item("DXImageTransform.Microsoft.Gradient").enabled=0;j.draggable.setOpacity(f);}else{renderer.fade(j.draggable,"out",25,0.1,f);}j.transparentMarker=1;}});}}.bindTo(this);a.removeMarker=function(){BDPMap.WindowManager.buffer.foreach(function(f){if(typeof f.transparentMarker!="undefined"){if(userAgent.app=="MSIE"&&userAgent.version<9){f.draggable.setOpacity(1);f.draggable.getElement(".bubbleBackground").filters.item("DXImageTransform.Microsoft.Gradient").enabled=1;}else{renderer.fade(f.draggable,"in",25,0.1,1);}f.transparentMarker=undefined;}});if(typeof a.marker!="undefined"){a.marker.remove();}}.bindTo(this);return a;};BDPMap.prototype.GoogleMaps.prototype.updateView=function(){var a=this.getZoomlevel(true),b=null;this.mapAreaOffset=this.container.getScreenOffset();if(this.zoomlevel!=a){this.zoomSlider.slider.moveTo({"left":this.zoomSlider.calcPercentageSliderPos(a)},false);this.zoomlevel=a;}if(this.newLocationsTimeout){window.clearTimeout(this.newLocationsTimeout);}this.newLocationsTimeout=window.setTimeout(function(){if(typeof this.panoramio!="undefined"&&this.panoramio.show==true){this.loadPics();}if(typeof this.webcams!="undefined"&&this.webcams.show==true){this.webcams.load();}if(typeof this.traffic!="undefined"&&this.traffic.show==true){this.traffic.load();}if(typeof this.weather!="undefined"&&this.weather.show==true){this.weather.copyright.show();if(typeof this.weather.locations!="undefined"){for(var c in this.weather.locations){try{b=this.weather.locations[c].bubble;if(typeof b!="undefined"){throw true;}else{throw false;}}catch(d){if(d==true){b.container.remove((userAgent.app=="MSIE"?"":"fade"));this.weather.locations[c].bubble="undefined";}}}}this.weather.load();}if(typeof this.companies!="undefined"&&this.companies.show==true){this.searchResults.removeAll();this.companies.load();}if(typeof this.addressSearchResults!="undefined"){for(var c=0;c<this.addressSearchResults.length;c++){this.addressSearchResults[c].remove();this.initLocation(this.addressSearchResults[c]);}}}.bindTo(this),1000);if(this.initialLoading==false&&typeof this.callback=="function"){this.callback();this.callback=undefined;}else{if(this.initialLoading==true){this.initialLoading=false;this.map.fitBounds(new google.maps.LatLngBounds(new google.maps.LatLng(this.initialBounds.sw.Latitude,this.initialBounds.sw.Longitude),new google.maps.LatLng(this.initialBounds.ne.Latitude,this.initialBounds.ne.Longitude)));}}if(typeof BDPMap.Search.Address.resizeWatchdog!="undefined"){BDPMap.Search.Address.resizeWatchdog.stroke("UpdateView");}};BDPMap.prototype.GoogleMaps.prototype.routingPoints={};BDPMap.prototype.GoogleMaps.prototype.calculateRoute=function(h,g,f,c,b,d){var a=new google.maps.DirectionsService();if(typeof this.routeRenderer!="undefined"){this.removeRoute();}this.routeRenderer=new google.maps.DirectionsRenderer();a.route({"origin":h,"destination":g.position,"travelMode":google.maps.DirectionsTravelMode.DRIVING,"waypoints":b,"provideRouteAlternatives":d},function(j,i){if(i==google.maps.DirectionsStatus.OK){this.routeRenderer.setMap(this.map);this.routeRenderer.setDirections(j);f({"success":true,"route":(b?j.routes[0].legs:j.routes[0].legs[0].steps),"parameter":c});}else{var k={};switch(i){case"INVALID_REQUEST":k.message="Ungültige Abfrage";break;case"MAX_WAYPOINTS_EXCEEDED":k.message="Zu viele Wegpunkte";break;case"NOT_FOUND":k.message="Start- oder Zielort konnte nicht gefunden werden";break;case"OVER_QUERY_LIMIT":k.message="Die Anfragebeschränkungen wurden von der Webseite in einem zu geringen Zeitraum überschritten.";break;case"REQUEST_DENIED":k.message="Zugriff verweigert.";break;case"UNKNOWN_ERROR":k.message="Eine Routenanfrage konnte aufgrund eines Serverfehlers nicht verarbeitet werden. Die Anfrage ist möglicherweise erfolgreich, wenn Sie es erneut versuchen.";break;case"ZERO_RESULTS":k.message="Zwischen Start- und Zielort konnte keine Route gefunden werden.";break;}f({"success":false,"error":k,"parameter":c});}}.bindTo(this));};BDPMap.prototype.GoogleMaps.prototype.removeRoute=function(){this.routeRenderer.setMap(null);};BDPMap.prototype.GoogleMaps.prototype.routeVia=function(f,d,c,b,a){this.calculateRoute(f,{"position":d},b.bindTo(this,a),undefined,c,true);};BDPMap.prototype.GoogleMaps.prototype.logRoute=function(){console.log(arguments);};BDPMap.prototype.GoogleMaps.prototype.prefetch=function(b){var a=b?"?falseId="+b:undefined;this.req=new HttpRequest();this.req.init(this.initPrefetch.bindTo(this));this.req.load("tools/prefetch.php"+(a?a:""));};BDPMap.prototype.GoogleMaps.prototype.initPrefetch=function(b){b=JSON.parse(b);if(b.length==0){window.clearInterval(prefetchInterval);}var g=b[0].street+", "+b[0].zip+" "+b[0].city,f=b[b.length-1].street+", "+b[b.length-1].zip+" "+b[b.length-1].city,d=new Array(),c=1,a=b.length-2;for(c;c<=a;c++){d.push({"location":b[c].street+", "+b[c].zip+" "+b[c].city});}this.routeVia(g,f,d,this.insertLatLng.bindTo(this,b));};BDPMap.prototype.GoogleMaps.prototype.insertLatLng=function(){var d=Array.prototype.slice.apply(arguments);if(d[0].success===false){this.falseReq=new HttpRequest();this.falseReq.init();this.falseReq.load("tools/prefetch.php?falseId="+d[2][0].id);return;}var c=d[0].route,h=d[2],f=0,b=d[0].route.length,a,g=new Array();for(f;f<b;f++){g.push("query["+f+"][address][zip]="+encodeURIComponent(h[f].zip)+"&query["+f+"][address][street]="+encodeURIComponent(h[f].street)+"&query["+f+"][address][city]="+encodeURIComponent(h[f].city)+"&query["+f+"][address][lat]="+c[f].start_location.lat()+"&query["+f+"][address][lng]="+c[f].start_location.lng());}g.push("query["+f+"][address][zip]="+encodeURIComponent(h[f].zip)+"&query["+f+"][address][street]="+encodeURIComponent(h[f].street)+"&query["+f+"][address][city]="+encodeURIComponent(h[f].city)+"&query["+f+"][address][lat]="+c[f-1].end_location.lat()+"&query["+f+"][address][lng]="+c[f-1].end_location.lng());this.req=new HttpRequest();this.req.init();this.req.load("tools/prefetch.php?"+g.join("&"));};BDPMap.prototype.GoogleMaps.prototype.search=function(a,b){this.alternativesCallback=b||false;if(a.bdpTrim()==""){return false;}this.addressSearchQuery=this.getSearchRequest(a)||a;if(this.addressSearchQuery){this.geocode(this.addressSearchQuery,this.handleLocations);return true;}else{return false;}};BDPMap.prototype.GoogleMaps.prototype.geocode=function(a,b){this.geocoder.geocode({"address":a},b.bindTo(this));};BDPMap.prototype.GoogleMaps.prototype.searchCustomCallback=function(b,c){if(b.bdpTrim()==""){return false;}var a=this.getSearchRequest(b)||b;if(a){this.geocode({"address":a,"region":"de"},c);return true;}else{return false;}};BDPMap.prototype.GoogleMaps.prototype.getSearchRequest=function(h){var c="("+BDPMap.RegStreet+"+(?:[ ]+[-0-9a-z]+)?)";var j="([0-9]{5})";var b="([0-9]{2,5})";var f="("+BDPMap.RegCity+"{3,})";var a=new RegExp(c+", +"+b+" "+f);var i=new RegExp(c+", *"+b);var g=new RegExp(c+", "+f);var d=new RegExp(b+" "+f);b=new RegExp(b);f=new RegExp(f);var k=null;if(h.match(a)){k=RegExp.$1+", "+RegExp.$2+" "+RegExp.$3;}else{if(h.match(i)){k=RegExp.$1+", "+RegExp.$2;}else{if(h.match(g)){k=RegExp.$1+", "+RegExp.$2;}else{if(h.match(d)){k=RegExp.$1+" "+RegExp.$2;}else{if(h.match(b)){k=RegExp.$1;}else{if(h.match(f)){k=RegExp.$1;}}}}}}return k;};BDPMap.prototype.GoogleMaps.prototype.handleLocations=function(o,g){this.throbber.hide();var b=maxLat=-180,d=minLat=180,m=new Array(),j=new Array(),n=new Array(),k=l=h=x=0,c=null,f=true,a=null;if(g==google.maps.GeocoderStatus.OK){if(typeof this.addressSearchResults!="undefined"){l=this.addressSearchResults.length;for(var h=l;h>0;h--){this.addressSearchResults[h-1].remove();this.addressSearchResults[h-1]=undefined;}}this.addressSearchResults=new Array();if(o.length==1){this.addressSearchResults.push(this.buildAddressSearchResult(o[0]));this.addressSearchResults[this.addressSearchResults.length-1].index=this.addressSearchResults.length-1;this.center(o[0].geometry.location);}else{for(h=0;h<o.length;h++){c=o[h].address_components;f=true;for(x=0;x<c.length;x++){if(c[x].types[0]=="country"&&c[x].long_name=="Deutschland"){f=false;break;}}if(f){continue;}j.push(o[h].geometry.location.lng());m.push(o[h].geometry.location.lat());this.addressSearchResults.push(this.buildAddressSearchResult(o[h],k+1));n.push({"description":o[h].formatted_address,"Longitude":o[h].geometry.location.lng(),"Latitude":o[h].geometry.location.lat(),"loc":this.addressSearchResults[k]});k++;}if(this.alternativesCallback){this.alternativesCallback(n);}m.sort(function(p,i){return p-i;});j.sort(function(p,i){return p-i;});a=new google.maps.LatLngBounds(new google.maps.LatLng(m[0],j[0]),new google.maps.LatLng(m[m.length-1],j[j.length-1]));this.map.fitBounds(a);}}};BDPMap.prototype.GoogleMaps.prototype.buildAddressSearchResult=function(g,c){var d={"Longitude":g.geometry.location.lng(),"Latitude":g.geometry.location.lat()},f=g.formatted_address,b=c?BDPMap.imgPrefix+"pictograms/locations/"+c+".png":"images/locations/pointer_red.png";var a={"origin":{"longitude":d.Longitude,"latitude":d.Latitude,"title":f,"icon_url":b,"icon_offset_x":11,"icon_offset_y":11},"onclick":function(){this.center(g.geometry.location);}.bindTo(this),"onmouseover":function(){if(typeof this.resultlistBox=="undefined"){return;}this.resultlistBox.addClassName("highlight");this.resultlistBox.scrollIntoView();},"onmouseout":function(){if(typeof this.resultlistBox=="undefined"){return;}this.resultlistBox.removeClassName("highlight");}};this.initLocation(a);return a;};BDPMap.prototype.Cookie={"set":function(){var b="",a="",f="",c="",d="";if(arguments[0] instanceof Object){if(typeof arguments[0].name=="string"&&typeof arguments[0].value=="string"){b=arguments[0].name+"="+escape(arguments[0].value);}else{throw ("Invalid Arguments in function BDPMap.Cookie.set, required name or value missing");}}else{throw ("Invalid Argument-Type, required Object in function BDPMap.Cookie.set");}document.cookie=b+this.getExpireDate(arguments[0].expires)+this.getPath(arguments[0].path)+this.getDomain(arguments[0].domain)+this.getSecure(arguments[0].secure);return document.cookie;},"get":function(a){return document.cookie.match("(^|;) ?"+a+"=([^;]*)(;|$)")?unescape(RegExp.$2):false;},"unset":function(){var b="",f="",c="",d="";if(arguments[0] instanceof Object){if(typeof arguments[0].name=="string"){b=arguments[0].name;}}else{b=arguments[0];}var a=new Date();a.setTime(a.getTime()-1);document.cookie=b+"=false; expires="+a.toGMTString()+this.getPath(arguments[0].path)+this.getDomain(arguments[0].domain)+this.getSecure(arguments[0].secure);},"setExpireDate":function(){document.cookie=arguments[0].name+"="+this.get(arguments[0].name)+"; expires="+this.getExpireDate(arguments[0].expires)+this.getPath(arguments[0].path)+this.getDomain(arguments[0].domain)+this.getSecure(arguments[0].secure);},"getExpireDate":function(b){var a=null,f,c,d;if(b){if(b instanceof Date){a=b;}else{if(b.match(/\+ ?([0-9]{1,}) ?(second(s)?|minute(s)?|hour(s)?|day(s)?|week(s)?|month(s)?|year(s)?)/i)){a=new Date();f=RegExp.$1;c=RegExp.$2.replace(/s$/,"");switch(c){case"second":f=f*1000;break;case"minute":f=f*60*1000;break;case"hour":f=f*60*60*1000;break;case"day":f=f*24*60*60*1000;break;case"week":f=f*7*24*60*60*1000;break;case"month":f=f*30*24*60*60*1000;break;case"year":f=f*365*24*60*60*1000;break;}a.setTime(a.getTime()+f);}else{if(b.match(/^(2[0-9][0-9][0-9])(0[1-9]|1[12])(0[0-9]|[12][0-9]|3[012])((0[0-9]|1[0-9]|2[0-3])([0-5][0-9])([0-5][0-9]))?$/)){d=RegExp.$1,month=RegExp.$2-1,day=RegExp.$3,hour=RegExp.$5|0,min=RegExp.$6|0,sec=RegExp.$7|0;a=new Date(d,month,day,hour,min,sec);}}}}return b?"; expires="+a.toGMTString():"";},"getPath":function(a){return a?"; path="+a:"";},"getDomain":function(a){return a?"; domain="+a:"";},"getSecure":function(a){return a?"; secure":"";}};BDPMap.prototype.Calculator=function(){};BDPMap.prototype.Calculator.prototype.DdToMm=function(a){return{"Longitude":a.Longitude*60,"Latitude":a.Latitude*60,"type":"Mm"};};BDPMap.prototype.Calculator.prototype.MmToDd=function(a){return{"Longitude":a.Longitude/60,"Latitude":a.Latitude/60,"type":"Dd"};};BDPMap.prototype.Calculator.prototype.WGS84millisecToMin=function(f,d){var c=Math.floor(f);var b=Math.floor(d);var a=Math.floor((f-c)*60);var i=Math.floor((d-b)*60);var h=Math.floor(((f-c)*60-a)*60);var g=Math.floor(((d-b)*60-i)*60);f=c+String.fromCharCode(176)+a+String.fromCharCode(8220)+h+String.fromCharCode(8216)+" Ost";d=b+String.fromCharCode(176)+i+String.fromCharCode(8220)+g+String.fromCharCode(8216)+" Nord";return{"Latitude":d,"Longitude":f};};BDPMap.prototype.Calculator.prototype.decMicroToDec=function(b,a){return{"Latitude":a/100000,"Longitude":b/100000};};BDPMap.prototype.Calculator.prototype.decToDecMicro=function(b,a){return{"Latitude":a*100000,"Longitude":b*100000};};BDPMap.prototype.Calculator.prototype.transFormCoordinate=function(c,d){var a={},f;for(var b in d){switch(c){case"dmsToDeg":f=d[b].SS/60;a[b]={"GG":d[b].GG,"MM":parseFloat((parseInt(d[b].MM,10)+parseFloat(f)))};break;case"degToDec":a[b]=parseFloat(parseInt(d[b].GG,10)+parseFloat(d[b].MM/60));break;}}return a;};BDPMap.prototype.Calculator.prototype.getDistance=function(o,n){var i=[o.Latitude,n.Latitude];var k=[o.Longitude,n.Longitude];var b=6378137;var g=(i[1]-i[0])*Math.PI/180;var j=(k[1]-k[0])*Math.PI/180;var m=Math.sin(g/2)*Math.sin(g/2)+Math.cos(i[0]*Math.PI/180)*Math.cos(i[1]*Math.PI/180)*Math.sin(j/2)*Math.sin(j/2);var h=2*Math.atan2(Math.sqrt(m),Math.sqrt(1-m));var f=b*h;return f;};BDPMap.prototype.Element=function(){};BDPMap.prototype.Element.CloseButton=function(a,c){var b=renderer.createElement("img",{"src":BDPMap.imgPrefix+"actions/off_small.png","className":"bubbleOff"});eventHandler.addEvent(b,"click",a.destruct=function(){if(typeof a.parentNode!="undefined"){a.remove((userAgent.app=="MSIE"?"":"fade"));}a=undefined;if(typeof c=="function"){c();}}.bindTo(this));return b;};BDPMap.prototype.Element.AddressInput=function(){var d=arguments[0];var h=false;if(typeof d.title=="undefined"){throw"No title defined BDPMap.Element.AddressInput";}if(typeof d.buttonLabel=="undefined"){throw"No buttonLabel defined BDPMap.Element.AddressInput";}if(typeof d.callback!="function"){throw"No callback function defined or not a function BDPMap.Element.AddressInput";}if(typeof d.offCallback=="function"){h=d.offCallback;}var c=renderer.createElement("div",{"className":"titleBar"});var a=new BDPMap.Draggable({"border":document.body,"dragHandle":c});BDPMap.WindowManager.register(a);this.container=a.draggable;var b,f,g;this.alternatives=undefined;this.container.className="addressSearchFormContainer bubbleContainer";g=new BDPMap.Element.CloseButton(a.draggable,h);g.renderIn(c);g.className="bubbleOff";this.form=renderer.createElement("form");eventHandler.addEvent(this.form,"submit",function(i){i=eventHandler.getEvent(i);i.preventDefault();d.callback();}.bindTo(this));this.form.renderIn(this.container);c.renderIn(this.form);c.appendChild(document.createTextNode(arguments[0].title));b=renderer.createElement("label");b.appendChild(document.createTextNode("Straße, Plz Ort"));this.input=renderer.createElement("input");eventHandler.addEvent(this.input,"focus",function(){this.value=this.value==""?b.firstChild.data:this.value;var i=this.value==""?0.3:1;this.setOpacity(i);this.select();});eventHandler.addEvent(this.input,"keyup",function(){this.input.value==b.firstChild.data?this.input.select():null;var i=1;this.input.setOpacity(i);}.bindTo(this));eventHandler.addEvent(this.input,"blur",function(){this.value=this.value==""?b.firstChild.data:this.value;var i=1;this.setOpacity(i);});f=renderer.createElement("div",{"className":"addressSearchFormSubmit"});f.appendChild(document.createTextNode(arguments[0].buttonLabel));this.input.renderIn(b);b.renderIn(this.form),f.renderIn(this.form);this.form.appendChild(renderer.createElement("br",{"clear":"all"}));eventHandler.addEvent(f,"mousedown",function(i){i=eventHandler.getEvent(i);i.preventDefault();this.addClassName("addressSearchFormSubmitActive");});eventHandler.addEvent(f,"mouseup",function(){this.removeClassName("addressSearchFormSubmitActive");});eventHandler.addEvent(f,"click",function(){if(this.input.value!=""&&this.input.value!=b.firstChild.data){d.callback();}}.bindTo(this));if(userAgent.app!="MSIE"||userAgent.version>6){this.form.background=renderer.createElement("div",{"className":"bubbleBackground bubbleBackgroundColor"});this.form.background.renderIn(this.container);this.form.shadow=new Shadow;this.form.shadow.renderIn(this.container);}else{}eventHandler.addEvent(this.container,"growready",function(){this.input.select();}.bindTo(this));this.container.renderIn(document.body,"grow");if(userAgent.app=="MSIE"&&userAgent.version<7){c.style.width=this.form.offsetWidth-this.form.getCSSValue("borderWidth","int")*2+"px";}};BDPMap.prototype.Element.bookmarkBox=function(b){if(!document.getElementById("bookmarkLink")){var c,f=renderer.createElement("div"),h=renderer.createElement("input"),d,g=renderer.createElement("div",{"className":"titleBar"}),j=new BDPMap.Draggable({"border":document.body,"dragHandle":g}),i,a;BDPMap.WindowManager.register(j);c=j.draggable;c.className="bubbleContainer";c.id="bookmarkLink";f.className="bubble";f.renderIn(c);eventHandler.addEvent(c,"dragbegin",function(k){if(typeof BDPMap.map.mapOverlay!="undefined"){BDPMap.map.mapOverlay.renderIn(BDPMap.map.container);}}.bindTo(this));eventHandler.addEvent(c,"drop",function(){if(typeof BDPMap.map.mapOverlay!="undefined"){BDPMap.map.mapOverlay.remove();}}.bindTo(this));d=new BDPMap.Element.CloseButton(c);g.renderIn(f);d.renderIn(g);g.appendChild(document.createTextNode("Kopieren Sie diese Adresse, um sie z.B. in einer E-Mail zu verwenden."));h.renderIn(f);h.value=b;if(userAgent.app!="MSIE"||userAgent.version>6){i=new Shadow;i.renderIn(c);a=renderer.createElement("div",{"className":"bubbleBackground bubbleBackgroundColor"});a.renderIn(c);}c.renderIn(document.body,"grow");h.select();}};BDPMap.prototype.Draggable=function(a){this.draggable=renderer.createElement("div");this.area=a.area||null;this.border=a.border||null;this.borderPadding=a.borderPadding||0;this.dragHandle=a.dragHandle||this.draggable;this.buffer={};var b=cssHandler.getCSSValue(this.border,"position");this.border.style.position=(b=="static"||b==false)?"relative":b;this.draggable.style.position="absolute";this.buffer.dragHandleCursor=cssHandler.getCSSValue(this.dragHandle,"cursor");eventHandler.addEvent(this.dragHandle,"mousedown",function(c){this.dragHandle.style.cursor="move";this.initDrag(c);}.bindTo(this));};BDPMap.prototype.Draggable.prototype.getCurrentRelativePos=function(){return{x:this.draggable.offsetLeft,y:this.draggable.offsetTop};};BDPMap.prototype.Draggable.prototype.getCurrentScreenPos=function(){var a=this.draggable.getScreenOffset();return{x:a.x,y:a.y};};BDPMap.prototype.Draggable.prototype.initDrag=function(b){var a;b=this.getEvent(b);this.buffer.screenOffset=this.draggable.getScreenOffset();if(typeof this.draggable.ondragbegin=="function"){b.startAt={"relative":{"x":this.draggable.offsetLeft,"y":this.draggable.offsetTop},"absolute":this.buffer.screenOffset};this.draggable.ondragbegin(b);}this.buffer.mouseOffset=this.getMouseOffset(b);if(typeof this.triggerCalcNewPos=="function"){eventHandler.removeEvent(document,"mousemove",this.triggerCalcNewPos);}if(typeof this.triggerDrop=="function"){eventHandler.removeEvent(document,"mouseup",this.triggerDrop);}eventHandler.addEvent(document,"mousemove",this.triggerCalcNewPos=function(c){this.calcNewPosition(c);}.bindTo(this));eventHandler.addEvent(document,"mouseup",this.triggerDrop=function(c){this.dragHandle.style.cursor=this.buffer.dragHandleCursor;this.drop(c);}.bindTo(this));};BDPMap.prototype.Draggable.prototype.calcNewPosition=function(d){d=this.getEvent(d);var b=d.clientX-this.buffer.screenOffset.x-this.buffer.mouseOffset.x;var a=d.clientY-this.buffer.screenOffset.y-this.buffer.mouseOffset.y;var c={"x":this.draggable.offsetLeft+b,"y":this.draggable.offsetTop+a};if(this.border){c=this.getValidPosition(c);}this.draggable.style.left=c.x+"px";this.draggable.style.top=c.y+"px";this.buffer.screenOffset=this.draggable.getScreenOffset();if(typeof this.draggable.ondrag=="function"){d.draggedTo={"relative":{"x":c.x,"y":c.y},"absolute":this.buffer.screenOffset};this.draggable.ondrag(d);}};BDPMap.prototype.Draggable.prototype.getValidPosition=function(b){var a={"x":0,"y":0};if(this.dragHandle!=this.draggable){a=this.dragHandle.getCustomOffset(this.draggable);}if(b.x+a.x<this.borderPadding){b.x=this.borderPadding-a.x;}else{if(b.x+this.dragHandle.offsetWidth+a.x+this.borderPadding>this.border.clientWidth){b.x=this.border.clientWidth-this.dragHandle.offsetWidth-a.x-this.borderPadding;}}if(b.y+a.y<this.borderPadding){b.y=this.borderPadding-a.y;}else{if(b.y+this.dragHandle.offsetHeight+a.y+this.borderPadding>this.border.clientHeight){b.y=this.border.clientHeight-this.dragHandle.offsetHeight-a.y-this.borderPadding;}}return b;};BDPMap.prototype.Draggable.prototype.drop=function(a){a=this.getEvent(a);eventHandler.removeEvent(document,"mousemove",this.triggerCalcNewPos);eventHandler.removeEvent(document,"mouseup",this.triggerDrop);this.triggerDropEvent(a);};BDPMap.prototype.Draggable.prototype.moveTo=function(a,b){if(typeof b=="undefined"){b=true;}a=a||{"left":this.borderPadding,"top":this.borderPadding};if(typeof a.left=="undefined"||isNaN(parseInt(a.left))){a.left=this.borderPadding;}if(typeof a.top=="undefined"||isNaN(parseInt(a.top))){a.top=this.borderPadding;}a.left=parseInt(a.left)+"px";a.top=parseInt(a.top)+"px";this.draggable.setProperties({"style":{"left":a.left,"top":a.top}});if(b==true){e={};this.triggerDropEvent(e);}};BDPMap.prototype.Draggable.prototype.triggerDropEvent=function(a){if(typeof this.draggable.ondrop=="function"){a.droppedAt={"relative":{"x":this.draggable.offsetLeft,"y":this.draggable.offsetTop},"absolute":this.buffer.screenOffset};this.draggable.ondrop(a);}};BDPMap.prototype.Draggable.prototype.getMouseOffset=function(b){var a=b.clientX-this.buffer.screenOffset.x;var c=b.clientY-this.buffer.screenOffset.y;return{x:a,y:c};};BDPMap.prototype.Draggable.prototype.getEvent=function(a){a=a||window.event;if(a.preventDefault){a.preventDefault();}else{a.returnValue=false;}return a;};BDPMap.prototype.ZoomSlider=function(a){this.wrapper=a;this.border=renderer.createElement("div");this.borderPadding=3;this.slider=new BDPMap.Draggable({"border":this.border,"borderPadding":this.borderPadding});this.minZoomLevel=3;this.maxZoomLevel=100;};BDPMap.prototype.ZoomSlider.prototype.defaultContainerProperties={"id":"zoomSliderContainer","style":{"width":"121px","height":"22px"}};BDPMap.prototype.ZoomSlider.prototype.defaultSliderProperties={"id":"zoomSlider","style":{"width":"7px","height":"16px","cursor":"pointer"}};BDPMap.prototype.ZoomSlider.prototype.init=function(a){if(!a){a={container:this.defaultContainerProperties,slider:this.defaultSliderProperties};a.container.style.backgroundImage="url("+BDPMap.imgPrefix+"mapControls/zoomSliderBackground.gif)";a.slider.style.backgroundImage="url("+BDPMap.imgPrefix+"mapControls/zoomSlider.png)";}this.border.setProperties(a.container);this.slider.draggable.setProperties(a.slider);this.slider.draggable.renderIn(this.border);eventHandler.addEvent(this.slider.draggable,"drop",function(b){this.trigger(b);}.bindAsEventListener(this));};BDPMap.prototype.ZoomSlider.prototype.trigger=function(a){var b=Math.round(100*(a.droppedAt.relative.x-this.borderPadding)/(this.border.getClientSize().Width-this.slider.draggable.getClientSize().Width-2*this.borderPadding));this.wrapper.zoom(b);};BDPMap.prototype.ZoomSlider.prototype.setZoom=function(b){var a=this.calcPercentageSliderPos(b);this.slider.moveTo({left:a+"px"});};BDPMap.prototype.ZoomSlider.prototype.calcPercentageSliderPos=function(a){if(a<0){a=0;}else{if(a>100){a=100;}}var b=((this.border.getClientSize().Width-this.slider.draggable.getClientSize().Width-2*this.borderPadding)*a)/100;return b+this.borderPadding;};BDPMap.prototype.Locations=function(){if(!arguments[0] instanceof Object||typeof arguments[0].map=="undefined"||typeof arguments[0].baseUrl=="undefined"||typeof arguments[0].baseUrl!="string"||typeof arguments[0].responseFilter=="undefined"||typeof arguments[0].responseFilter!="string"||typeof arguments[0].CSSPrefix=="undefined"||typeof arguments[0].CSSPrefix!="string"||typeof arguments[0].getUrl=="undefined"||typeof arguments[0].getUrl!="function"||typeof arguments[0].onclick=="undefined"||typeof arguments[0].onclick!="function"){throw"Invalid Arguments";return false;}if(typeof arguments[0].additionalAction=="function"){this.additionalAction=arguments[0].additionalAction;}if(typeof arguments[0].callback=="function"){this.callback=arguments[0].callback;}if(typeof arguments[0].onmouseover=="function"){this.onmouseover=arguments[0].onmouseover;}if(typeof arguments[0].onmouseout=="function"){this.onmouseout=arguments[0].onmouseout;}this.showOnMap=true;this.map=arguments[0].map;this.baseUrl=arguments[0].baseUrl;this.getUrl=arguments[0].getUrl;this.onclick=arguments[0].onclick;this.responseFilter=arguments[0].responseFilter.indexOf("response.")==0?arguments[0].responseFilter:"response."+arguments[0].responseFilter;this.CSSPrefix=arguments[0].CSSPrefix;this.page=0;return true;};BDPMap.prototype.Locations.prototype.load=function(a){if(typeof this.locations!="undefined"){this.removeAll();}if(typeof this.request!="undefined"&&this.request instanceof HttpRequest&&this.request.loading==true){this.request.abort();}this.map.throbber.show("BDPLocations.load");this.request=this.getRequest(a);this.request.load(this.getUrl());};BDPMap.prototype.Locations.prototype.buildLocs=function(response){var ret=false,locations=null;response=BDPMap.parseAjaxResponse(response);if(response===false){return;}try{locations=eval(this.responseFilter);if(locations instanceof Array&&locations.length>0){ret=true;throw true;}else{throw false;}}catch(e){if(e===true){this.locations={};for(var i=0;i<locations.length;i++){this.locations[i]={};this.locations[i].CSSPrefix=this.CSSPrefix;this.locations[i].origin=locations[i];this.locations[i].current=0;this.locations[i].onclick=function(i){return function(){this.onclick.call(this.map,this.locations[i]);}.bindTo(this);}.call(this,i);if(typeof this.onmouseover=="function"){this.locations[i].onmouseover=function(i){return function(){this.onmouseover.call(this.map,this.locations[i]);}.bindTo(this);}.call(this,i);}if(typeof this.onmouseout=="function"){this.locations[i].onmouseout=function(i){return function(){this.onmouseout.call(this.map,this.locations[i]);}.bindTo(this);}.call(this,i);}if(this.showOnMap==true){this.locations[i]=this.map.initLocation(this.locations[i]);}if(this.additionalAction){this.additionalAction.call(this.map,this.locations[i]);}}}}this.map.throbber.hide();if(this.callback){this.callback();}return ret;};BDPMap.prototype.Locations.prototype.removeAll=function(){this.map.throbber.show("BDPLocations.removeAll");for(var a in this.locations){if(this.showOnMap==true){this.locations[a].remove();}}this.locations=undefined;this.map.throbber.hide();};BDPMap.prototype.Locations.prototype.getRequest=function(b){b=b||this.buildLocs.bindTo(this);var a=new HttpRequest;a.init(b);return a;};BDPMap.prototype.Bubble=function(){this.map=arguments[0].map;};BDPMap.prototype.Bubble.prototype.Skeleton=function(c,f,d){var b=document.createElement("div");this.bubble=renderer.createElement("div",{"className":"bubble"});if(f){this.titleBar=renderer.createElement("div",{"className":"titleBar"});this.titleBar.appendChild(document.createTextNode(f));var a=new BDPMap.Draggable({"border":document.body,"dragHandle":this.titleBar});this.container=a.draggable;this.closeButton=new BDPMap.Element.CloseButton(this.container,d);BDPMap.WindowManager.register(a);eventHandler.addEvent(this.container,"dragbegin",function(){if(typeof BDPMap.map!="undefined"&&typeof BDPMap.map.mapOverlay!="undefined"){BDPMap.map.mapOverlay.renderIn(BDPMap.mainContainer);}}.bindTo(this));eventHandler.addEvent(this.container,"drop",function(){if(typeof BDPMap.map!="undefined"&&typeof BDPMap.map.mapOverlay!="undefined"){BDPMap.map.mapOverlay.remove();}}.bindTo(this));this.closeButton.renderIn(this.titleBar);this.titleBar.renderIn(this.bubble);}else{this.container=renderer.createElement("div");}this.container.className="bubbleContainer";if(c){b.innerHTML=c;this.bubble.appendChild(b.firstChild.cloneNode(true));b=undefined;}if(userAgent.app!="MSIE"||(userAgent.app=="MSIE"&&userAgent.version>=7)){this.container.background=renderer.createElement("div",{"className":"bubbleBackground bubbleBackgroundColor"});this.container.background.renderIn(this.container);this.container.shadow=new Shadow;this.container.shadow.renderIn(this.container);}this.bubble.renderIn(this.container);};BDPMap.prototype.Bubble.prototype.Skeleton.prototype.setPosition=function(b,a){this.container.style.top=a+"px";this.container.style.left=b+"px";};BDPMap.prototype.Bubble.prototype.Skeleton.prototype.render=function(){BDPMap.map.bubbleFactory.renderBubble(this.container,this.titleBar);};BDPMap.prototype.Bubble.prototype.buildCompany=function(location){var titleBar=renderer.createElement("div",{"className":"titleBar"}),draggable=new BDPMap.Draggable({"border":document.body,"dragHandle":titleBar}),container=draggable.draggable;BDPMap.WindowManager.register(draggable);titleBar.appendChild(document.createTextNode(location.origin.catName));container.className=location.CSSPrefix+"BubbleContainer bubbleContainer";container.bubble=renderer.createElement("div",{"className":location.CSSPrefix+"Bubble"});titleBar.renderIn(container.bubble);container.bubbleOff=BDPMap.Element.CloseButton(container);container.bubbleOff.renderIn(titleBar);container.bubble.renderIn(container);if(userAgent.app!="MSIE"||(userAgent.app=="MSIE"&&userAgent.version>=7)){container.background=renderer.createElement("div",{"className":"bubbleBackground bubbleBackgroundColor"});container.background.renderIn(container);container.shadow=new Shadow;container.shadow.renderIn(container);}container.request=new HttpRequest;container.request.init(function(response){response=BDPMap.parseAjaxResponse(response);if(response===false){return;}container.bubble.innerBox=renderer.createElement("div");container.bubble.innerBox.innerHTML=response.html;container.bubble.innerBox.renderIn(container.bubble);eventHandler.addEvent(container,"render",function(){var pt=container.bubble.getCSSValue("paddingTop","int");var pr=container.bubble.getCSSValue("paddingRight","int");var pl=container.bubble.getCSSValue("paddingLeft","int");var brw=container.bubble.getCSSValue("borderRightWidth","int");var blw=container.bubble.getCSSValue("borderLeftWidth","int");var Call2callWin=false,addTel,addTelSlider,addTelSliderHeight=0;container.getElement("p.freecall",function(freecall){eventHandler.addEvent(freecall,"click",function(){this.click2callBubble(location);return;if(Call2callWin&&!Call2callWin.closed){Call2callWin.close();}var width=540;var height=420;var left=(screen.availWidth-width)/2;var top=(screen.availHeight-height)/2;Call2callWin=open("call2call.html?id="+response.id+"","","width="+width+",height="+height+",left="+left+",top="+top+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=yes");}.bindTo(this));}.bindTo(this));container.getElement("p.freefax",function(freefax){eventHandler.addEvent(freefax,"click",function(e){e=eventHandler.getEvent(e);e.preventDefault();contentLoader.load('getContent.html?q={"name":"freefax","id":"'+response.id+'"}');});}.bindTo(this));addTel=container.getElements("p.addTel",function(){addTelSliderHeight+=arguments[0].offsetHeight;arguments[0].parentNode.removeChild(arguments[0]);});if(addTel instanceof Array&&addTel.length>0){addTelSlider=renderer.createElement("div",{"className":"addTelSlider"});addTelSlider.contentWrapper=renderer.createElement("div",{"className":"addTelSliderWrapper","style":{"height":addTelSliderHeight+"px"}});addTelSlider.shadow=renderer.createElement("div",{"className":"addTelSliderShadow","style":{"height":addTelSliderHeight+"px"}});addTelSlider.shadow.appendImage({"src":"images/decorations/shadow_bottom.png","style":{"position":"absolute","left":0,"bottom":0,"width":"162px","height":"8px"}});addTelSlider.shadow.appendImage({"src":"images/decorations/shadow_bottomRight.png","style":{"position":"absolute","right":0,"bottom":0}});addTelSlider.shadow.appendImage({"src":"images/decorations/shadow_right.png","style":{"position":"absolute","right":0,"top":0,"width":"8px","height":addTelSliderHeight-8+"px"}});addTelSlider.shadow.renderIn(addTelSlider);addTelSlider.contentWrapper.renderIn(addTelSlider);addTel.foreach(function(){addTelSlider.contentWrapper.appendChild(arguments[0]);});var rolloutButton=renderer.createElement("img",{"src":"images/icons/arrow_down_dark_17x17.png","className":"iepngfix rolloutButton","width":17,"height":17,"title":"Klicken für weitere Telefonnummern"});container.getElement("p.tel",function(tel){rolloutButton.style.left=tel.offsetWidth+"px";rolloutButton.style.top=tel.offsetTop+"px";rolloutButton.renderIn(tel.parentNode);addTelSlider.style.top=tel.offsetTop+tel.offsetHeight+"px";addTelSlider.renderIn(tel.parentNode);eventHandler.addEvent(rolloutButton,"click",function(){if(addTelSlider.getCSSValue("display")=="none"){addTelSlider.style.display="block";addTelSlider.interval=window.setInterval(function(){addTelSlider.style.height=addTelSlider.offsetHeight+10+"px";if(addTelSlider.offsetHeight>=addTelSliderHeight+3){addTelSlider.style.height=addTelSliderHeight+3+"px";window.clearInterval(addTelSlider.interval);rolloutButton.src="images/icons/arrow_up_dark_17x17.png";}},40);}else{window.clearInterval(addTelSlider.interval);addTelSlider.interval=window.setInterval(function(){if(addTelSlider.offsetHeight-10<=0){addTelSlider.style.height="0";window.clearInterval(addTelSlider.interval);addTelSlider.style.display="none";rolloutButton.src="images/icons/arrow_down_dark_17x17.png";}else{addTelSlider.style.height=addTelSlider.offsetHeight-10+"px";}},40);}});});}if(container.getElement(".tabContainer")){loader.instantiate("TabHandler",[renderer.assimilate(container.getElement(".tabContainer"))],function(tabHandler){var tabContainerHeight=tabHandler.container.offsetHeight,maxtabContainerHeight=200,stepWidth=30;var rolloutButton=renderer.createElement("img",{"src":"images/icons/arrow_down_dark_17x17.png","className":"iepngfix","width":17,"height":17});tabHandler.container.insertBefore(rolloutButton,tabHandler.container.firstChild);tabHandler.container.folded=true;var l=tabHandler.tabs.length,pt=tabHandler.tabs[0].content.getCSSValue("paddingTop","int"),pb=tabHandler.tabs[0].content.getCSSValue("paddingBottom","int"),bt=tabHandler.tabs[0].content.getCSSValue("borderTopWidth","int"),bb=tabHandler.container.getCSSValue("borderBottomWidth","int");tabHandler.container.rollout=function(){if(tabHandler.container.folded){var growInterval=window.setInterval(function(){newHeight=tabHandler.container.offsetHeight+stepWidth;if(newHeight<maxtabContainerHeight){tabHandler.container.style.height=newHeight+"px";}else{tabHandler.container.style.height=maxtabContainerHeight+"px";window.clearInterval(growInterval);rolloutButton.src="images/icons/arrow_up_dark_17x17.png";var i=0;for(i;i<l;i++){tabHandler.tabs[i].content.style.height=tabHandler.container.offsetHeight-tabHandler.tabs[i].content.offsetTop-pt-pb-bt-bb+"px";tabHandler.tabs[i].content.style.overflow="auto";}}},40);}else{var shrinkInterval=window.setInterval(function(){var newHeight=tabHandler.container.offsetHeight-stepWidth;if(newHeight>tabContainerHeight){tabHandler.container.style.height=newHeight+"px";}else{tabHandler.container.style.height=tabContainerHeight+"px";window.clearInterval(shrinkInterval);var i=0;for(i;i<l;i++){tabHandler.tabs[i].content.style.height="";tabHandler.tabs[i].content.style.overflow="hidden";}rolloutButton.src="images/icons/arrow_down_dark_17x17.png";}},40);}tabHandler.container.folded=!tabHandler.container.folded;};eventHandler.addEvent(rolloutButton,"click",tabHandler.container.rollout);var i=0,l=tabHandler.tabs.length;for(i;i<l;i++){eventHandler.addEvent(tabHandler.tabs[i],"click",function(){if(tabHandler.container.folded){tabHandler.container.rollout();}});}});}var toolbox=renderer.assimilate(container.getElement(".companyToolbox")),toolboxActivator=toolbox.getElement(".legend"),toolboxToggle,toolBoxWrapper=renderer.assimilate(container.getElement(".toolBoxWrapper")),toolBoxSlider=renderer.assimilate(container.getElement(".toolBoxSlider")),showCompanyContact=renderer.assimilate(container.getElement(".showCompanyContact")),toolboxButtons=toolbox.getElements(".toolboxButton"),sliderHeight=toolBoxSlider.offsetHeight,sliderMoveReady;var img=container.getElement("img.showCompanyImage");if(img){var imageNatural={"width":img.offsetWidth,"height":img.offsetHeight};with(img.style){width="50px";height="50px";cursor="pointer";}}toolbox.style.width=container.bubble.offsetWidth-pr-pl-brw-blw+"px";toolbox.style.position="relative";img.onclick=function(){var wrapper=renderer.createElement("div");with(wrapper.style){width=imageNatural.width+4+"px";height=imageNatural.height+4+"px";position="absolute";top="0";right="0";overflow="hidden";zIndex="10000";}wrapper.setOpacity(1);wrapper.renderIn(img.parentNode);var newImg=renderer.assimilate(img.cloneNode(false));newImg.onclick=function(){eventHandler.addEvent(newImg,"effectready",function(){wrapper.remove();}.bindTo(this));newImg.remove("slideOut",{"stopPos":"topRight"});};with(newImg.style){width="";height="";background="#E7E7E7";}newImg.renderIn(wrapper,"slideIn",{"startPos":"topRight"});}.bindTo(this);var moreImg=container.getElement("span.extraPics");if(moreImg&&response.extraPics!=""){moreImg.onclick=function(){window.picBox=new PicBox(response.extraPics);};}container.setProperties({"style":{"left":Math.round((this.map.container.offsetWidth-container.offsetWidth)/2)+this.map.mapAreaOffset.x+"px","top":Math.round((this.map.container.offsetHeight-container.offsetHeight)/2)+this.map.mapAreaOffset.y+"px"}});var routeButton=renderer.createElement("div",{"className":"aColor toolboxButton"});routeButton.appendChild(document.createTextNode("Routenplaner"));toolBoxSlider.insertBefore(routeButton,toolBoxSlider.firstChild);eventHandler.addEvent(routeButton,"click",function(){var routeBox=new BDPMap.Element.AddressInput({"title":"Routenplaner - Startadresse","buttonLabel":"Route berechnen","callback":function(){BDPMap.map.throbber.show();BDPMap.map.calculateRoute(routeBox.input.value,location.providerLoc,function(result){if(result.success){if(typeof routeBox.resultList!="undefined"){routeBox.resultList.remove();}var route=result.route;routeBox.resultList=renderer.createElement("fieldset",{"className":"resultList route"});var resultListLegend=renderer.createElement("legend");resultListLegend.appendChild(document.createTextNode("Wegbeschreibung:"));resultListLegend.renderIn(routeBox.resultList);routeBox.resultListContainer=renderer.createElement("ol",{"className":"resultListContainer"});routeBox.resultListContainer.renderIn(routeBox.resultList);var totalTime=((route.TotalTime)/(60*60)).toPrecision(3);var totalLength=(route.TotalLength/1000);for(var i=0;i<route.length;i++){var box=renderer.createElement("li");var content="";(i+1)+". ";box.className="resultListItem";box.className+=" "+(i%2==0?"even":"odd");box.innerHTML="<p>"+route[i].instructions+"</p>";box.renderIn(routeBox.resultListContainer);}routeBox.resultList.renderIn(routeBox.form);routeBox.resultListHeight=routeBox.resultList.clientHeight;routeBox.resultListContainer.style.height=0;var steps=5,i=0;var plusHeight=(routeBox.resultListHeight>200?200:routeBox.resultListHeight)/steps;this.growInterval=window.setInterval(function(){if(i<steps){routeBox.resultListContainer.style.height=routeBox.resultListContainer.clientHeight+plusHeight+"px";i++;}else{window.clearInterval(this.growInterval);routeBox.resultListContainer.style.overflow="auto";}}.bindTo(this),40);}else{alert(result.error.message);}BDPMap.map.throbber.hide();}.bindTo(this));}.bindTo(this),offCallback:function(){BDPMap.map.removeRoute();}.bindTo(this)});}.bindTo(this));var mailButton=showCompanyContact.getElement(".sendMail");if(mailButton){mailButton.innerHTML=mailButton.firstChild.innerHTML;mailButton.style.cursor="pointer";eventHandler.addEvent(mailButton,"click",function(e){e=eventHandler.getEvent(e);e.preventDefault();contentLoader.load('getContent.html?q={"name":"kontakt","id":"'+response.id+'"}');}.bindTo(this));}var commendButton=toolBoxSlider.getElement(".commend");if(commendButton){commendButton.innerHTML=commendButton.firstChild.innerHTML;commendButton.style.cursor="pointer";eventHandler.addEvent(commendButton,"click",function(e){e=eventHandler.getEvent(e);e.preventDefault();contentLoader.load('getContent.html?q={"name":"empfehlen","id":"'+response.id+'"}');}.bindTo(this));}var homeButton=renderer.createElement("div",{"className":"toolboxButton"});homeButton.appendChild(document.createTextNode("Auf der Karte zeigen"));eventHandler.addEvent(homeButton,"click",function(){BDPMap.map.center(location.providerLoc,true);}.bindTo(this));eventHandler.addEvent(homeButton,"mouseover",function(){location.showOnMap();}.bindTo(this));eventHandler.addEvent(homeButton,"mouseout",function(){location.removeMarker();}.bindTo(this));toolBoxSlider.insertBefore(homeButton,toolBoxSlider.firstChild);var bookmarkButton=renderer.createElement("a",{"className":"toolboxButton"});bookmarkButton.appendChild(document.createTextNode("Link zum kopieren"));eventHandler.addEvent(bookmarkButton,"click",function(e){e=eventHandler.getEvent(e);e.preventDefault();BDPMap.Element.bookmarkBox(location.origin.href);}.bindTo(this));toolBoxSlider.appendChild(bookmarkButton);}.bindTo(this));this.renderBubble(container,titleBar);}.bindTo(this));container.request.load('getCompany.html?q={"id":'+location.origin.id+"}");return draggable;};BDPMap.prototype.Bubble.prototype.click2callBubble=function(c){var d,g,f,a=0,b=renderer.createElement("div");g=c.origin.name.length>15?c.origin.name.substr(0,15)+"...":c.origin.name;d=new BDPMap.map.bubbleFactory.Skeleton(false,g);d.bubble.addClassName("freecallBubble");d.bubble.appendChild(b);d.Validator=function(){};d.Validator.prototype.errorMessages={"serviceError":"Leider steht dieser Service zur Zeit nicht zur Verfügung.<br />Bitte versuchen Sie es später noch mal.","falscheNummer":"Leider liegt uns eine falsche Telefonnummer vor,<br /> sodass wir diesen Service für diesen Eintrag leider nicht anbieten können.","vorwahlOhne0":"Die Vorwahl muss mit einer 0 beginnen!","checkVorwahl":"Bitte überprüfen Sie die Vorwahl!","checkTelnummer":"Bitte überprüfen Sie die Telefonnummer!","nurZahlen":"Bitte nur Zahlen eingeben!","vorwahlTel":"Bitte geben Sie Vorwahl und Telefonnummer an!"};d.Validator.prototype.check=function(){while(this.value.match(/[^0-9]/)){this.value=this.value.replace(/[^0-9]/,"");}};d.Validator.prototype.submit=function(){b.getElementsByTagName("button")[0].disabled=true;d.hints.init.className="";fields=b.getElementsByTagName("input");d.request.init(d.initCall.bindTo(this));BDPMap.map.throbber.show();d.request.load("invokeClick2Call-"+c.origin.id+".html?prefix="+fields[0].value+"&no="+fields[1].value);};d.validator=new d.Validator();d.initForm=function(k){var m=0,j,h;k=BDPMap.parseAjaxResponse(k);if(typeof k.html!="undefined"){b.innerHTML=k.html.replace(/\\n/,"\n");}h=b.getElementsByTagName("input");j=h.length;for(m;m<j;m++){h[m].onkeyup=d.validator.check;}b.getElementsByTagName("button")[0].onclick=d.validator.submit.bindTo(this);d.render();d.hints={"ok":document.getElementById("c2cOK"),"init":document.getElementById("c2cInit"),"error":document.getElementById("c2cError")};h[0].focus();BDPMap.map.throbber.hide();};d.initCall=function(i){var j,h,k;i=BDPMap.parseAjaxResponse(i);BDPMap.map.throbber.hide();d.hints.init.parentNode.removeChild(d.hints.init);d.durationBox=document.getElementById("c2cDuration");if(typeof i.call_error=="undefined"){j=parseInt(d.durationBox.innerHTML);h=parseInt(j/60,10);h=h<10?"0"+h:h;k=j%60;k=k<10?"0"+k:k;d.durationBox.innerHTML=h+":"+k;d.hints.ok.className="";window.setTimeout(function(){var m=d.hints.ok.getElementsByTagName("img")[0];m.parentNode.removeChild(m);},10000);d.durationInterval=window.setInterval(function(){if(document.getElementById("c2cDuration")){j--;h=parseInt(j/60,10);h=h<10?"0"+h:h;k=j%60;k=k<10?"0"+k:k;if(j<=0){window.clearInterval(d.durationInterval);window.setTimeout(function(){d.container.destruct();},3000);}d.durationBox.innerHTML=h+":"+k;}else{window.clearInterval(d.durationInterval);}},1000);}else{document.getElementById("c2cError").className="";window.setTimeout(function(){d.container.destruct();},10000);}};d.request=new HttpRequest();d.request.init(d.initForm.bindTo(this));BDPMap.map.throbber.show();d.request.load("getClick2Call-"+c.origin.id+".html");};BDPMap.prototype.Bubble.prototype.buildWebcamBubble=function(c){var f=renderer.createElement("div",{"className":"titleBar"});var a=new BDPMap.Draggable({"border":document.body,"dragHandle":f});var b=a.draggable;BDPMap.WindowManager.register(a);b.className=c.CSSPrefix+"BubbleContainer bubbleContainer";if(userAgent.app!="MSIE"||(userAgent.app=="MSIE"&&userAgent.version>=7)){b.background=renderer.createElement("div",{"className":"bubbleBackground bubbleBackgroundColor"});b.shadow=new Shadow;}b.bubble=renderer.createElement("div",{"className":c.CSSPrefix+"Bubble"});b.imageWrap=renderer.createElement("a",{"className":c.CSSPrefix+"BubbleThumb","href":c.origin.url,"target":"_blank"});b.image=renderer.createElement("img",{"src":c.origin.image});b.image.renderIn(b.imageWrap);b.bubbleOff=BDPMap.Element.CloseButton(b);b.bubble.renderIn(b);f.renderIn(b.bubble);if(b.background){b.background.renderIn(b);}if(b.shadow){b.shadow.renderIn(b);}b.bubbleOff.renderIn(f);b.imageWrap.renderIn(b.bubble);var h=renderer.createElement("b");h.appendChild(document.createTextNode(c.origin.title));h.style.display="block";h.renderIn(b.bubble);var d=renderer.createElement("a");d.href=c.origin.user_url;d.appendChild(document.createTextNode("by: "+c.origin.user));d.target="_blank";d.renderIn(b.bubble);d.style.display="block";renderer.createElement("br").renderIn(b.bubble);var g=renderer.createElement("a");g.href="http://webcams.travel";g.appendChild(document.createTextNode("Webcams provided by"));g.appendChild(document.createElement("br"));g.appendChild(document.createTextNode("webcams.travel"));g.target="_blank";g.renderIn(b.bubble);g.style.display="block";eventHandler.addEvent(b,"render",function(){var m=b.bubble.getCSSValue("paddingTop","int");var n=b.bubble.getCSSValue("paddingRight","int");var k=b.bubble.getCSSValue("paddingLeft","int");var j=b.bubble.getCSSValue("borderRightWidth","int");var i=b.bubble.getCSSValue("borderLeftWidth","int");b.setProperties({"style":{"left":Math.round((this.map.container.offsetWidth-b.offsetWidth)/2)+this.map.mapAreaOffset.x+"px","top":Math.round((this.map.container.offsetHeight-b.offsetHeight)/2)+this.map.mapAreaOffset.y+"px"}});b.bubble.style.width=b.bubble.offsetWidth-n-k+"px";d.style.width=g.style.width=h.style.width=b.imageWrap.offsetWidth+"px";}.bindTo(this));this.renderBubble(b,f);};BDPMap.prototype.Bubble.prototype.renderBubble=function(a,b){if(userAgent.app=="Opera"){eventHandler.addEvent(a,"fadeready",a.operaFix=function(){var h=shadow.childNodes;for(var g=0;g<h.length;g++){h[g].style.border="none";}eventHandler.removeEvent(a,"fadeready",a.operaFix);}.bindTo(this));}a.renderIn(document.body,(userAgent.app=="MSIE"?"grow":"fade"));if(userAgent.app=="MSIE"&&userAgent.version<7){b.style.width=b.parentNode.offsetWidth-b.parentNode.getCSSValue("borderWidth","int")*2+"px";}if(userAgent.app=="Opera"){var f=shadow.childNodes;var d;for(var c=0;c<f.length;c++){if(f[c].className.indexOf("op")>-1){d="borderBottom";}else{if(f[c].className.indexOf("ottom")>-1){d="borderTop";}else{if(f[c].className.indexOf("shadowRight")>-1){d="borderLeft";}else{if(f[c].className.indexOf("shadowLeft")>-1){d="borderRight";}else{if(f[c].className.indexOf("enter")>-1){d="borderBottom";}}}}}f[c].style[d]="1px solid black";d=null;}}};BDPMap.prototype.Throbber=function(){this.map=arguments[0].map;this.throbber=renderer.createElement("DIV",{"className":"iepngfix","count":0,"origins":[],"visible":false,"style":{"position":"absolute","zIndex":"10000","width":"43px","height":"43px","left":this.map.container.offsetWidth+"px","top":"-43px"},"show":function(a){if(this.throbber.visible==false&&this.throbber.count==0){this.throbber.move({"stopPos":{"x":this.container.offsetWidth-43,"y":0}});this.throbber.visible=true;}this.throbber.count++;}.bindTo(this.map),"hide":function(a){this.throbber.count-=this.throbber.count<=0?0:1;if((this.throbber.visible==true&&this.throbber.count<=0)||a){this.throbber.move({"stopPos":{"x":this.container.offsetWidth,"y":-43}});this.throbber.visible=false;this.throbber.count=0;}}.bindTo(this.map)});this.throbber.appendChild(renderer.createElement("IMG",{"style":{"position":"absolute","top":"-2px","left":0,"zIndex":"10000"},"src":BDPMap.imgPrefix+"throbber_back.png"}));this.throbber.firstChild.setOpacity(0.7);this.throbber.appendChild(renderer.createElement("IMG",{"style":{"position":"absolute","top":0,"left":0,"zIndex":"10000","width":"43px","height":"43px"},"src":BDPMap.imgPrefix+"throbber.gif"}));return this.throbber;};BDPMap.prototype.Hint=function(){this.map=arguments[0].map;this.hint=renderer.createElement("DIV",{"className":"iepngfix","style":{"position":"absolute","zIndex":"10000","width":"45px","height":"45px","left":Math.round((this.map.container.offsetWidth-45)/2)+"px","top":"-45px"},"show":function(a,b){a=a||BDPMap.imgPrefix+"noPics";b=b||"";if(typeof this.hint.visible=="undefined"||this.hint.visible==false){this.hint.currentType=a;this.hint.currentMessage=b;this.hint.firstChild.nextSibling.title=b;this.hint.firstChild.nextSibling.src=a+".png";this.hint.move({"stopPos":{"x":Math.round((this.container.offsetWidth-45)/2),"y":0}});this.hint.visible=true;eventHandler.addEvent(this.hint,"moveready",this.hintAddClick=function(){eventHandler.removeEvent(this.hint,"moveready",this.hintAddClick);var d=this.hint,c;eventHandler.addEvent(this.hint,"click",this.hintHideClick=function(){if(this.hint.timeout){window.clearTimeout(this.hint.timeout);}c=this.hintHideClick;window.setTimeout(function(){eventHandler.removeEvent(d,"click",c);},1);this.hint.hide();}.bindTo(this));this.hint.timeout=window.setTimeout(function(){this.hint.hide();}.bindTo(this),this.hintTimeout*1000);}.bindTo(this));}else{if(typeof this.hint.visible!="undefined"&&this.hint.visible==true&&(this.hint.currentType!=a||this.hint.currentMessage!=b)){this.hint.currentType=a;this.hint.currentMessage=b;this.hint.firstChild.nextSibling.title=b;this.hint.firstChild.nextSibling.src="images/"+a+".png";if(this.hint.timeout){window.clearTimeout(this.hint.timeout);}this.hint.timeout=window.setTimeout(function(){this.hint.hide();}.bindTo(this),this.map.hintTimeout*1000);}}}.bindTo(this.map),"hide":function(){if(this.hint.visible==true){this.hint.move({"stopPos":{"x":Math.round((this.container.offsetWidth-45)/2),"y":-45}});this.hint.visible=false;}}.bindTo(this.map)});this.hint.appendChild(renderer.createElement("IMG",{"style":{"position":"absolute","top":0,"left":0,"zIndex":"10000"},"src":BDPMap.imgPrefix+"throbber_back.png"}));this.hint.firstChild.setOpacity(0.7);this.hint.appendChild(renderer.createElement("IMG",{"style":{"position":"absolute","top":0,"left":"1px","zIndex":"10000","width":"45px","height":"45px"},"src":BDPMap.imgPrefix+"noPics.png"}));return this.hint;};BDPMap.prototype.SearchResults=function(){this.map=arguments[0].map;};BDPMap.prototype.SearchResults.prototype.buffer={};BDPMap.prototype.SearchResults.prototype.display=function(a){var c=renderer.createElement("div",{"id":a.origin.id,"className":"singleSearchResult"}),b,d;c.innerHTML=a.origin.searchResultsHTML;a.searchResult=renderer.assimilate(c.firstChild.cloneNode(true));b=a.searchResult.getElementsByTagName("a");for(var f=0;f<b.length;f++){d=b[f];eventHandler.addEvent(d,"click",function(h,g){h=eventHandler.getEvent(h);h.preventDefault();this.map.call("initCLoc",g.origin.id);}.bindTo(this,a));}this.buffer[a.origin.id]=a;if(this.map.companies.showOnMap==true){eventHandler.addEvent(a.searchResult,"mouseover",function(){if(a.mouseoutTimeout){window.clearTimeout(a.mouseoutTimeout);}a.showOnMap();});eventHandler.addEvent(a.searchResult,"mouseout",function(){a.mouseoutTimeout=window.setTimeout(function(){a.removeMarker();},300);});}this.map.searchResultsContainer.appendChild(a.searchResult);};BDPMap.prototype.SearchResults.prototype.removeAll=function(){for(var b in this.buffer){var a=this.buffer[b].searchResult.getElementsByTagName("a");for(var c=0;c<a.length;c++){eventHandler.flush(a[c]);}eventHandler.flush(this.buffer[b].searchResult);this.buffer[b].searchResult.remove();if(this.buffer[b].marker&&typeof this.buffer[b].marker.parentNode!="undefined"){this.buffer[b].marker.remove("fade");}}this.buffer={};};BDPMap.prototype.Coordinate=function(){if(arguments[0] instanceof Object){if(typeof arguments[0].Longitude!="undefined"&&!isNaN(arguments[0].Longitude)){this.Longitude=arguments[0].Longitude;}else{throw ('arguments[0].Longitude not of type "number"');return false;}if(typeof arguments[0].Latitude!="undefined"&&!isNaN(arguments[0].Latitude)){this.Latitude=arguments[0].Latitude;}else{throw ('arguments[0].Latitude not of type "number"');return false;}if(typeof arguments[0].MapPosition=="string"&&this.validPos.inArray(arguments[0].MapPosition)){this.MapPosition=arguments[0].MapPosition;}return this;}else{throw ("Invalid Arguments, Constructor BDPMap.Coordinate");return false;}};BDPMap.prototype.Coordinate.prototype.validPos=new ArrayA("Center","TopLeft","LowerRight");BDPMap.prototype.Coordinate.prototype.setMapPosition=function(){if(typeof arguments[0]=="string"&&this.validPos.inArray(arguments[0])){this.MapPosition=arguments[0];}else{throw ('Invalid Argument "'+typeof arguments[0]+'", BDPMap.Coordinate.setMapPosition');}return this;};var FormHandler=function(){};FormHandler.prototype.tagNames=new ArrayA("select","input","textarea");FormHandler.prototype.classNames=new ArrayA("varchar","int","numeric","notNull","bool");FormHandler.prototype.initForm=function(c){this.form=c;this.formElements=[];var b;for(var a=0;a<this.form.elements.length;a++){b=this.form.elements[a];if(b.tagName!="undefined"&&this.tagNames.inArray(b.tagName.toLowerCase())){b.valid=this.valid;b.getElementValue=this.getElementValue;this.formElements.push(b);b.validates=function(){var g=new ArrayA;if(typeof b.className!="undefined"&&b.className!=""){for(var d=0;d<this.classNames.length;d++){var f=new RegExp("(^| )"+this.classNames[d]+"( |$)");if(b.className.match(f)){g.push(this.classNames[d]);}}}return(g.length>0)?g:false;}.call(this);}}};FormHandler.prototype.getElementValue=function(){var a;switch(this.tagName.toLowerCase()){case"input":case"textarea":a=this.value;break;case"select":a=this.options[this.selectedIndex].value;}return a;};FormHandler.prototype.valid=function(){var d,b,c=true;if(typeof this.tagName!="undefined"&&BDPMap.Search.tagNames.inArray(this.tagName.toLowerCase())&&this.validates!=false){d=this.getElementValue();for(var a=0;a<this.validates.length;a++){b=this.validates[a];switch(b){case"varchar":case"notNull":if(d==""){c=false;}break;case"bool":if(typeof this.checked=="undefined"||this.checked==false){c=false;}break;case"int":if(!Number(d)){c=false;}else{d=parseInt(d);}break;case"numeric":if(isNaN(d)){c=false;}break;}}}else{c=false;}return c===false?false:true;};FormHandler.prototype.getFormValues=function(){var b,c={};for(var a=0;a<this.formElements.length;a++){b=this.formElements[a];if(b.valid()){c[b.name]=b.getElementValue();}}return c;};BDPMap.prototype.Search=function(){};BDPMap.prototype.Search.prototype=new FormHandler;BDPMap.prototype.Search.prototype.Business=function(){this.lim=0;this.maxResults=10;};BDPMap.prototype.Search.prototype.Business.prototype=new BDPMap.prototype.Search;BDPMap.prototype.Search.prototype.Business.prototype.request=null;BDPMap.prototype.Search.prototype.Business.prototype.zipareas=null;BDPMap.prototype.Search.prototype.Business.prototype.currentSearchMethod="fireSearch";BDPMap.prototype.Search.prototype.Business.prototype.searchValues=false;BDPMap.prototype.Search.prototype.Business.prototype.call=function(){var a=Array.prototype.slice.call(arguments);if(typeof this[a[0]]!="undefined"||typeof a[0]=="function"){this.callback=function(){var b=a.shift();typeof this[b]!="undefined"?this[b].apply(this,a):b.apply(this,a);};if(!this.form){contentLoader.load("getGewerbesuche.html",this.init.bindTo(this));}else{this.callback();}}else{throw ("BDPMap.Search.Business."+arguments[0]+" is undefined. BDPMap.Search.Business.call");}};BDPMap.prototype.Search.prototype.Business.prototype.init=function(){eventHandler.addEvent(contentLoader.loadedContent,"remove",function(){this.form=undefined;}.bindTo(this));this.initForm(document.getElementById("advancedSearch"));this.throbber=renderer.assimilate(renderer.getElement(".throbber",this.form));eventHandler.addEvent(this.form,"submit",function(b){b=eventHandler.getEvent(b);b.preventDefault();this.lim=0;this.fireSearch(b);}.bindTo(this));this.updateDefaultText();this.disableSelects();eventHandler.addEvent(this.form.elements.cat,"change",this.loadFormData.bindTo(this,this.form.elements.cat));eventHandler.addEvent(this.form.elements.subCat,"change",this.loadFormData.bindTo(this,this.form.elements.subCat));eventHandler.addEvent(this.form.elements.state,"change",this.loadFormData.bindTo(this,this.form.elements.state));eventHandler.addEvent(this.form.elements.district,"change",this.loadFormData.bindTo(this,this.form.elements.district));this.searchMap=renderer.assimilate(document.getElementById("searchMap"));this.thumbs=this.searchMap.getElementsByTagName("img");for(var a=0;a<this.thumbs.length;a++){eventHandler.addEvent(this.thumbs[a],"click",function(b){return function(c){c=eventHandler.getEvent(c);c.preventDefault();this.loadMap(b);}.bindTo(this);}.call(this,a));}if(typeof this.callback=="function"){this.callback();}};BDPMap.prototype.Search.prototype.Business.prototype.setRequest=function(a){this.request=new HttpRequest;this.request.init(a);};BDPMap.prototype.Search.prototype.Business.prototype.loadMap=function(b){this.setRequest(this.insertMap.bindTo(this));this.thumbs[b].src.match(/^.*\/thumb_([0-9]{1}|berlin|hamburg).jpg$/);this.appendix=RegExp.$1;var a=new Date;if(typeof this.map!="undefined"&&typeof this.map.parentNode!="undefined"){this.map.parentNode.removeChild(this.map);}this.request.load('getImageMap.html?q={"zip":"'+this.appendix+'"}');this.zipMap=renderer.createElement("div",{"id":"zipMap"});this.zipMap.map=renderer.createElement("img",{"src":"images/zipMaps/zipMap_"+this.appendix+".gif?"+a.getMilliseconds()});this.zipMap.map.setAttribute("usemap","#map_"+this.appendix,0);this.zipMap.map.renderIn(this.zipMap);eventHandler.addEvent(this.zipMap.map,"load",function(){this.zipMap.style.padding=Math.ceil((this.searchMap.offsetHeight-this.zipMap.map.height)/2)+"px "+Math.floor((this.searchMap.offsetWidth-this.zipMap.map.width)/2)+"px";this.zipMap.renderIn(this.searchMap,"fade");}.bindTo(this));var c=null;eventHandler.addEvent(this.zipMap,"fadeready",c=function(){var d=renderer.createElement("div",{"id":"zipMapOff","className":"aColor"});d.appendChild(document.createTextNode("zurück"));d.renderIn(this.zipMap);eventHandler.addEvent(d,"click",function(){eventHandler.removeEvent(this.zipMap,"fadeready",c);this.zipMap.remove("fade");}.bindTo(this));}.bindTo(this));};BDPMap.prototype.Search.prototype.Business.prototype.insertMap=function(b){var a=document.createElement("div");a.innerHTML=b;this.map=renderer.assimilate(a.getElementsByTagName("map")[0]);a=null;this.zipareas=this.map.getElementsByTagName("area");for(var c=0;c<this.zipareas.length;c++){eventHandler.addEvent(this.zipareas[c],"click",function(d){return function(f){f=eventHandler.getEvent(f);f.preventDefault();this.areaAction(d);}.bindTo(this);}.call(this,c));}this.map.renderIn(document.body);};BDPMap.prototype.Search.prototype.Business.prototype.areaAction=function(a){this.zipareas=this.map.getElementsByTagName("area");this.form.plz.value=this.zipareas[a].alt;};BDPMap.prototype.Search.prototype.Business.prototype.loadFormData=function(d,f){var b=new Array(),c=this.getFormValues(),a=null;b.push("changed="+encodeURIComponent(f.name));this.setRequest(this.updateSelects.bindTo(this));for(a in c){if(!this.form[a]||this.form[a].getElementValue()==""){continue;}b.push(encodeURIComponent(a)+"="+encodeURIComponent(c[a]));}this.throbber.addClassName("visible");this.disableSelects(true);this.request.load("getSearchFormData.html?"+b.join("&"));};BDPMap.prototype.Search.prototype.Business.prototype.updateSelects=function(b){var g,c=null,a=null,d;try{b=JSON.parse(b);throw b instanceof Object?true:false;}catch(f){if(!f){throw ("Response Error");return;}}for(a in b){this.form[a].selection=this.form[a].getElementValue();g=this.form[a].options.length-1;for(g;g>0;g--){this.form[a].removeChild(this.form[a].options[g]);}for(c in b[a]){d=new Option(b[a][c],c);if(c==this.form[a].selection){d.selected=true;}this.form[a].options[this.form[a].options.length]=d;}}this.updateDefaultText();this.disableSelects();this.throbber.removeClassName("visible");};BDPMap.prototype.Search.prototype.Business.prototype.updateDefaultText=function(){var c=this.form.getElementsByTagName("select"),b=0,a;a=c.length;for(b;b<a;b++){c[b].options[0].defaultText=c[b].options[0].defaultText||false;if(c[b].options.selectedIndex>0){if(!c[b].options[0].defaultText){c[b].options[0].defaultText=c[b].options[0].innerHTML;}c[b].options[0].innerHTML="Alle...";}else{if(c[b].options[0].defaultText){c[b].options[0].innerHTML=c[b].options[0].defaultText;}}}};BDPMap.prototype.Search.prototype.Business.prototype.disableSelects=function(d){var c=this.form.getElementsByTagName("select"),b=0,a;a=c.length;if(d){for(b;b<a;b++){c[b].disabled=true;c[b].style.backgroundColor="#e6e6e6";}}else{for(b;b<a;b++){c[b].disabled=false;c[b].style.backgroundColor="";}if(this.form.cat.getElementValue()==0){this.form.subCat.options.selectedIndex=0;this.form.subCat.disabled=true;this.form.subCat.style.backgroundColor="#e6e6e6";}else{this.form.subCat.disabled=false;this.form.subCat.style.backgroundColor="";}if(this.form.state.getElementValue()==0){this.form.district.options.selectedIndex=0;this.form.district.disabled=true;this.form.district.style.backgroundColor="#e6e6e6";}else{this.form.district.disabled=false;this.form.district.style.backgroundColor="";}}};BDPMap.prototype.Search.prototype.Business.prototype.quickSearch=function(){if(document.schnellsuche.query.value!=""){var b=null;var a=document.getElementsByName("queryType");for(var c=0;c<a.length;c++){if(a[c].checked==true){b=a[c].value;}this.form[a[c].value].value="";}this.form[b].value=document.schnellsuche.query.value;document.schnellsuche.query.value="";this.fireSearch(false,0);}};BDPMap.prototype.Search.prototype.Business.prototype.fireSearch=function(b,c){this.currentSearchMethod="fireSearch";if(b){b=eventHandler.getEvent(b);if(b.preventDefault){b.preventDefault();}}this.setRequest(this.showResults.bindTo(this));var a=this.getFormValues();this.lim=!isNaN(c)?c:this.lim;a.page=this.lim/10+1;this.request.load("performSearch.html?q="+encodeURIComponent(JSON.stringify(a)));};BDPMap.prototype.Search.prototype.Business.prototype.customSearch=function(b,c,a){this.currentSearchMethod="customSearch";if(b){b=eventHandler.getEvent(b);if(b.preventDefault){b.preventDefault();}}this.setRequest(this.showResults.bindTo(this));this.searchValues=a||this.searchValues;if(typeof this.searchValues=="undefined"){return;}this.lim=!isNaN(c)?c:this.lim;this.searchValues.page=this.lim/10+1;this.request.load("performSearch.html?q="+encodeURIComponent(JSON.stringify(this.searchValues)));};BDPMap.prototype.Search.prototype.Business.prototype.showResults=function(a){a=BDPMap.parseAjaxResponse(a);if(a===false){return;}var b=null;eventHandler.addEvent(BDPMap.searchResultsContainer,"fadeready",b=function(){var g="",f=new ResultBrowser(this[this.currentSearchMethod].bindTo(this),a.foundRows,this.maxResults,this.lim),c=new ResultBrowser(this[this.currentSearchMethod].bindTo(this),a.foundRows,this.maxResults,this.lim);for(var d=0;d<a.companies.length;d++){g+=a.companies[d].searchResultsHTML;}BDPMap.searchResultsContainer.empty();BDPMap.searchResultsContainer.innerHTML=g;BDPMap.searchResultsContainer.insertBefore(f,BDPMap.searchResultsContainer.firstChild);BDPMap.searchResultsContainer.appendChild(c);BDPMap.addCompaniesAction();eventHandler.removeEvent(BDPMap.searchResultsContainer,"fadeready",b);renderer.fade(BDPMap.searchResultsContainer,"in");}.bindTo(this));renderer.fade(BDPMap.searchResultsContainer,"out");};BDPMap.prototype.Search.prototype.Address=function(){this.lim=0;this.maxResults=10;};BDPMap.prototype.Search.prototype.Address.prototype=new BDPMap.prototype.Search;BDPMap.prototype.Search.prototype.Address.prototype.init=function(){contentLoader.unload();if(typeof this.adressInput=="undefined"){this.adressInput=new BDPMap.Element.AddressInput({"title":"Addresssuche","buttonLabel":"Suche starten","callback":this.submit.bindTo(this),"offCallback":function(){this.adressInput=undefined;}.bindTo(this)});}else{this.adressInput.input.value="";this.adressInput.input.focus();if(typeof this.alternatives!="undefined"){this.alternatives.remove();}}};BDPMap.prototype.Search.prototype.Address.prototype.submit=function(){BDPMap.map.throbber.show("BDPSearch.submit");BDPMap.map.call("search",this.adressInput.input.value,this.displayAlternatives.bindTo(this));if(typeof this.alternatives!="undefined"){this.alternatives.remove();}};BDPMap.prototype.Search.prototype.Address.prototype.displayAlternatives=function(f){this.alternatives=renderer.createElement("fieldset",{"className":"resultList"});var c=renderer.createElement("legend");c.appendChild(document.createTextNode("Suchergebnisse:"));c.renderIn(this.alternatives);this.altContainer=renderer.createElement("div",{"className":"resultListContainer"});this.altContainer.renderIn(this.alternatives);for(var b=0;b<f.length;b++){var d=renderer.createElement("div");d.className="resultListItem";d.className+=" "+(b%2==0?"even":"odd");d.innerHTML=f[b].description;d.appendChild(renderer.createElement("img",{"src":BDPMap.imgPrefix+"pictograms/locations/"+(b+1)+".png","className":"iepngfix"}));d.appendChild(renderer.createElement("br",{"clear":"all"}));var a=function(g){eventHandler.addEvent(d.getElementsByTagName("img")[0],"mouseover",function(){f[g].loc.showOnMap();});eventHandler.addEvent(d.getElementsByTagName("img")[0],"mouseout",function(){f[g].loc.removeMarker();});eventHandler.addEvent(d.getElementsByTagName("img")[0],"click",function(){BDPMap.map.center(f[g].loc.providerLoc);}.bindTo(this));}.call(this,b);this.altContainer.appendChild(d);BDPMap.map.addressSearchResults[b].resultlistBox=d;}if(f.length>0){if(typeof this.adressInput=="undefined"){this.adressInput=new BDPMap.Element.AddressInput({"title":"Addresssuche","buttonLabel":"Suche starten","callback":this.submit.bindTo(this),"offCallback":function(){this.adressInput=undefined;}.bindTo(this)});this.adressInput.input.value=BDPMap.map.addressSearchQuery;}this.alternatives.renderIn(this.adressInput.form);this.alternativesHeight=this.alternatives.clientHeight;this.altContainer.style.height=0;this.resizeWatchdog=new WatchDog({"AdressSearch":true,"UpdateView":true});this.resizeWatchdog.stroke("AdressSearch",this.resizeAlternatives.bindTo(this));}};BDPMap.prototype.Search.prototype.Address.prototype.resizeAlternatives=function(){this.resizeWatchdog=undefined;var b=5,c=0;var a=(this.alternativesHeight>200?200:this.alternativesHeight)/b;this.growInterval=window.setInterval(function(){if(c<b){this.altContainer.style.height=this.altContainer.clientHeight+a+"px";c++;}else{window.clearInterval(this.growInterval);this.altContainer.style.overflow="auto";}}.bindTo(this),40);};ResultBrowser=function(callback,found,numResults,currentLim){this.found=found;this.numResults=numResults;this.currentLim=currentLim;this.backForwardSteps=1;var that=this;var pages=Math.ceil(this.found/this.numResults);var currentPage=this.currentLim/this.numResults+1;var container=renderer.createElement("div");container.className="resultBrowser";with(container.style){color="black";textAlign="center";}var showLinks=7;if(pages>1){if(currentPage>1){var pageBack=container.appendChild(document.createElement("span"));pageBack.appendChild(document.createTextNode(String.fromCharCode(8630)));pageBack.lim=this.currentLim-this.numResults*this.backForwardSteps>=0?this.currentLim-this.numResults*this.backForwardSteps:0;pageBack.className="backLink";eventHandler.addEvent(pageBack,"mousewheel",function(e){if(e>0){that.backForwardSteps=Math.floor(that.backForwardSteps*2)<Math.floor(pages/2-1)?Math.floor(that.backForwardSteps*2):Math.floor(pages/2-1);}else{if(e<0){that.backForwardSteps=Math.floor(that.backForwardSteps/2)>1?Math.floor(that.backForwardSteps/2):1;}}if(typeof pageForward!="undefined"){pageForward.lim=that.currentLim+that.numResults*that.backForwardSteps<Math.floor((pages-1))*that.numResults?that.currentLim+that.numResults*that.backForwardSteps:Math.floor((pages-1)*that.numResults);}this.lim=Math.floor(that.currentLim-that.numResults*that.backForwardSteps)>=0?Math.floor(that.currentLim-that.numResults*that.backForwardSteps):0;var hint=that.backForwardSteps+(that.backForwardSteps>1?" Seiten":" Seite")+" zurück";this.info.firstChild.data=hint;});eventHandler.addEvent(pageBack,"mouseover",function(e){if(typeof this.info=="undefined"){this.createTooltip.call(pageBack,e,this,"back");}}.bindTo(this));eventHandler.addEvent(pageBack,"mouseout",function(){if(typeof this.info!="undefined"){this.info.remove("fade");this.info=undefined;}});}container.appendChild(document.createTextNode("["));var pageLink=container.appendChild(document.createElement("span"));pageLink.appendChild(document.createTextNode("1"));pageLink.lim=0;pageLink.wave=true;if((currentPage-Math.floor(showLinks/2))>1&&pages>showLinks){container.appendChild(document.createTextNode("..."));}else{container.appendChild(document.createTextNode("|"));}if(pages<=showLinks){var beginLoop=2;var endLoop=pages-1;}else{var beginLoop=currentPage-(Math.floor(showLinks/2)-1);var endLoop=currentPage+(Math.floor(showLinks/2)-1)<=pages?currentPage+(Math.floor(showLinks/2)-1):pages;}var n=0;for(var i=beginLoop;i<=endLoop;i++){if(i>1&&i<pages){var pageLink=container.appendChild(document.createElement("span"));pageLink.appendChild(document.createTextNode(i));if(i<endLoop||currentPage==pages-Math.floor(showLinks/2)||pages<=showLinks){container.appendChild(document.createTextNode("|"));}pageLink.lim=(i-1)*this.numResults;pageLink.wave=true;}}if(currentPage<(pages-Math.floor(showLinks/2))&&pages>showLinks){container.appendChild(document.createTextNode("..."));}var pageLink=container.appendChild(document.createElement("span"));pageLink.appendChild(document.createTextNode(pages));pageLink.lim=(pages-1)*this.numResults;pageLink.wave=true;container.appendChild(document.createTextNode("]"));if(currentPage<pages){var pageForward=container.appendChild(document.createElement("span"));pageForward.appendChild(document.createTextNode(String.fromCharCode(8631)));pageForward.lim=this.currentLim+this.numResults*this.backForwardSteps<(pages-1)*this.numResults?this.currentLim+this.numResults*this.backForwardSteps:(pages-1)*this.numResults;pageForward.className="forwardLink";eventHandler.addEvent(pageForward,"mousewheel",function(e){if(e>0){that.backForwardSteps=Math.floor(that.backForwardSteps*2)<Math.floor(pages/2-1)?Math.floor(that.backForwardSteps*2):Math.floor(pages/2-1);}else{if(e<0){that.backForwardSteps=Math.floor(that.backForwardSteps/2)>1?Math.floor(that.backForwardSteps/2):1;}}this.lim=that.currentLim+that.numResults*that.backForwardSteps<Math.floor((pages-1))*that.numResults?that.currentLim+that.numResults*that.backForwardSteps:Math.floor((pages-1)*that.numResults);if(typeof pageBack!="undefined"){pageBack.lim=that.currentLim-that.numResults*that.backForwardSteps>=0?that.currentLim-that.numResults*that.backForwardSteps:0;}var hint=that.backForwardSteps+(that.backForwardSteps>1?" Seiten":" Seite")+" vor";this.info.firstChild.data=hint;});eventHandler.addEvent(pageForward,"mouseover",function(e){if(typeof this.info=="undefined"){this.createTooltip.call(pageForward,e,this,"forward");}}.bindTo(this));eventHandler.addEvent(pageForward,"mouseout",function(){if(typeof this.info!="undefined"){this.info.remove("fade");this.info=undefined;}});}for(var i=0;i<container.childNodes.length;i++){if(typeof container.childNodes[i].tagName!="undefined"){if(this.currentLim-2*this.numResults==container.childNodes[i].lim&&typeof container.childNodes[i].wave!="undefined"){container.childNodes[i].className="twoBeforeCurrentPage";}else{if(this.currentLim-this.numResults==container.childNodes[i].lim&&typeof container.childNodes[i].wave!="undefined"){container.childNodes[i].className="oneBeforeCurrentPage";}else{if(this.currentLim==container.childNodes[i].lim&&typeof container.childNodes[i].wave!="undefined"){container.childNodes[i].className="currentPage";var availablePages=new Array;for(var n=currentPage;n<=pages;n++){availablePages.push(n);}for(var n=1;n<=currentPage;n++){availablePages.push(n);}eventHandler.addEvent(container.childNodes[i],"mousewheel",function(e){if(typeof this.timeout!="undefined"){window.clearTimeout(this.timeout);}if(e>0){var tmp=availablePages.shift();availablePages[availablePages.length]=tmp;}else{if(e<0){var tmp=availablePages.pop();availablePages.unshift(tmp);}}this.firstChild.data=availablePages[0];this.lim=(availablePages[0]-1)*that.numResults;this.timeout=window.setTimeout(function(){callback(e,this.lim);}.bindAsTimer(this),400);});}else{if(this.currentLim+this.numResults==container.childNodes[i].lim&&typeof container.childNodes[i].wave!="undefined"){container.childNodes[i].className="oneAfterCurrentPage";}else{if(this.currentLim+2*this.numResults==container.childNodes[i].lim&&typeof container.childNodes[i].wave!="undefined"){container.childNodes[i].className="twoAfterCurrentPage";}}}}}eventHandler.addEvent(container.childNodes[i],"click",function(e){if(typeof this.info!="undefined"){this.info.remove("fade");this.info=undefined;}callback(e,this.lim);});eventHandler.addEvent(container.childNodes[i],"mouseover",function(){this.style.color="red";});eventHandler.addEvent(container.childNodes[i],"mouseout",function(){this.style.color="";});}}}return container;};ResultBrowser.prototype.createTooltip=function(c,b,a){this.info=document.body.appendChild(renderer.createElement("div"));var d=b.backForwardSteps+(b.backForwardSteps>1?" Seiten":" Seite")+" "+(a=="back"?"zurück":"vor");this.info.appendChild(document.createTextNode(d));this.info.id="resultBrowserTooltip";this.info.style.position="absolute";this.info.style.left=c.clientX+24+"px";this.info.style.top=c.clientY+10+"px";this.info.onmouseover=function(){this.remove("fade");};};var EventCalendar=function(){};EventCalendar.prototype=new FormHandler;EventCalendar.prototype.init=function(){this.container=document.getElementById("contentThrobber");this.form=document.getElementById("eventSearchForm");var f={"map":this};this.throbber=new BDPMap.Throbber(f);this.throbber.renderIn(this.container);that=this;this.initForm(this.form);this.setRequest();eventHandler.addEvent(this.form,"submit",this.submit=function(g){g=eventHandler.getEvent(g);g.preventDefault();this.loadEvent();}.bindTo(this));var c=document.getElementById("eventSearchResults");var a=c.getElementsByTagName("a"),d;for(var b=0;b<a.length;b++){d=a[b];if(typeof d.className!="undefined"&&d.className=="eventLink"){eventHandler.addEvent(d,"click",function(g){g=eventHandler.getEvent(g);g.preventDefault();this.href.match(/.*\?(.*)$/);that.throbber.show();that.request.load("veranstaltungen.html?ajax=true&"+RegExp.$1);});}}};EventCalendar.prototype.loadEvent=function(){this.throbber.show();eventHandler.removeEvent(this.form,"submit",this.submit);eventHandler.addEvent(this.form,"submit",this.submit=function(d){d=eventHandler.getEvent(d);d.preventDefault();}.bindTo(this));var a=this.getFormValues(),c="";for(var b in a){c+="&"+b+"="+encodeURI(a[b]);}this.request.load("veranstaltungen.html?ajax=true"+c);};EventCalendar.prototype.handleResponse=function(response){this.throbber.hide();response=BDPMap.parseAjaxResponse(response,this.throbber);if(response===false){return;}var right=document.getElementById("right"),ev;right.removeChild(document.getElementById("contentarea"));var temp=renderer.createElement("DIV");temp.innerHTML=response.content.replace(/\\n/,"\n");this.loadedContent=contentLoader.loadedContent=renderer.assimilate(temp.getElementsByTagName("div")[0]);if(document.getElementById("maparea")){with(this.loadedContent.style){position="absolute";left=document.getElementById("maparea").offsetLeft+"px";top=document.getElementById("maparea").offsetTop+"px";width=document.getElementById("maparea").clientWidth+"px";height=document.getElementById("maparea").clientHeight+"px";overflow="auto";border="1px solid black";zIndex="600";}}else{while(right.hasChildNodes()){right.removeChild(content.firstChild);}}eventHandler.addEvent(this.loadedContent,"render",ev=function(){contentLoader.deactivateBreadCrumbs();contentLoader.processBreadCrumbs();new SortableTable(this.loadedContent.getElementsByTagName("table")[0]);var x=function(){eventHandler.removeEvent(this.loadedContent,"render",ev);}.apply(this);}.bindTo(this));this.loadedContent.renderIn(right);eventHandler.removeEvent(this.form,"submit",this.submit);this.init();};EventCalendar.prototype.setRequest=function(){this.request=new HttpRequest;this.request.init(this.handleResponse.bindTo(this));};var eventCalendar=new EventCalendar;eventHandler.addLoadEvent(function(){var a={activators:getElementsByClassName("headNavi"),opacityStepIn:0.15,opacityStepOut:0.05,zIndex:cssHandler.getCSSValue(getElementsByClassName("headNavi")[0],"zIndex"),activeMenus:0,init:function(){var f=this;for(var c in this.activators){if(typeof this.activators[c].getElementsByTagName!="undefined"){this.activators[c].subMenu=this.activators[c].getElementsByTagName("UL")[0];this.activators[c].subMenu.opacity=0;this.activators[c].subMenu.opacityStepIn=this.opacityStepIn;this.activators[c].subMenu.opacityStepOut=this.opacityStepOut;this.activators[c].subMenu.state="hidden";cssHandler.setOpacity(this.activators[c].subMenu,0);if(userAgent.app=="MSIE"&&userAgent.version<9){this.activators[c].subMenu.setOpacity=function(h){this.style.filter="Alpha(opacity:"+(h*100)+")";};}else{this.activators[c].subMenu.setOpacity=function(h){this.style.opacity=h;};}if(navigator.appVersion.indexOf("MSIE 6")>-1){this.activators[c].subMenu.listElements=this.activators[c].subMenu.getElementsByTagName("LI");this.activators[c].subMenu.listElementsBackgroundImage=cssHandler.getCSSValue(this.activators[c].subMenu.listElements[0],"backgroundImage");for(var g=0;g<this.activators[c].subMenu.listElements.length;g++){this.activators[c].subMenu.listElements[g].style.backgroundImage="none";}this.activators[c].subMenu.toggleBackground=function(h){if(h==1){for(var j=0;j<this.listElements.length;j++){this.listElements[j].style.backgroundImage=this.listElementsBackgroundImage;}}else{for(var j=0;j<this.listElements.length;j++){this.listElements[j].style.backgroundImage="none";}}};}eventHandler.addEvent(this.activators[c],"mouseover",function(){if(typeof this.interval!="undefined"){window.clearInterval(this.interval);f.activeMenus--;this.interval=undefined;}f.activeMenus++;this.subMenu.style.display="block";this.subMenu.state="fadeIn";this.style.zIndex=f.zIndex;f.zIndex++;this.interval=window.setInterval(function(){this.subMenu.opacity+=this.subMenu.opacityStepIn;if(this.subMenu.opacity>=1){this.subMenu.setOpacity(1);window.clearInterval(this.interval);if(typeof this.subMenu.toggleBackground=="function"){this.subMenu.toggleBackground(1);}this.subMenu.state="visible";this.interval=undefined;}else{this.subMenu.setOpacity(this.subMenu.opacity);}}.bindAsTimer(this),40);});eventHandler.addEvent(this.activators[c],"mouseout",function(){if(typeof this.interval!="undefined"){window.clearInterval(this.interval);this.interval=undefined;}if(typeof this.subMenu.toggleBackground=="function"){this.subMenu.toggleBackground(0);}this.interval=window.setInterval(function(){if(this.subMenu.state=="fadeIn"){if(this.subMenu.opacity>=1){this.subMenu.setOpacity(1);this.subMenu.state="fadeOut";}else{this.subMenu.opacity+=this.subMenu.opacityStepIn;}}else{this.subMenu.opacity-=this.subMenu.opacityStepOut;}if(this.subMenu.opacity<=0){this.subMenu.setOpacity(0);this.subMenu.style.display="none";window.clearInterval(this.interval);this.interval=undefined;this.subMenu.state="hidden";f.activeMenus--;if(f.activeMenus==0){}}else{this.subMenu.setOpacity(this.subMenu.opacity);}}.bindAsTimer(this),40);});}var d=this.activators[c].getElementsByTagName("A")[0];for(var b=0;b<d.childNodes.length;b++){d.parentNode.insertBefore(d.childNodes[b].cloneNode(true),d);d.parentNode.insertBefore(document.createTextNode(" "),d);}d.parentNode.removeChild(d);if(typeof contentLoader!="undefined"){contentLoader.init(this.activators[c]);}}}};a.init();if(typeof contentLoader!="undefined"){contentLoader.init(document.getElementById("internNavi"));}});ContentLoader=function(){this.getOffButton();eventHandler.addLoadEvent(function(){if(document.getElementById("contentarea")){this.loadedContent=renderer.assimilate(document.getElementById("contentarea"));this.contentOff.renderIn(document.getElementById("right"));this.getThrobber();}else{this.getThrobber();}}.bindTo(this));};ContentLoader.prototype.cache={};ContentLoader.prototype.rendering=false;ContentLoader.prototype.getOffButton=function(){this.contentOff={"src":BDPMap.imgPrefix+"actions/off_small.png","style":{"position":"absolute","zIndex":"1000","right":"35px","top":"40px","cursor":"pointer"}};this.contentOff=renderer.createElement("IMG",this.contentOff);eventHandler.addEvent(this.contentOff,"click",function(){this.unload();}.bindTo(this));};ContentLoader.prototype.getThrobber=function(){if(document.getElementById("contentThrobber")){this.container=document.getElementById("contentThrobber");var a={"map":this};this.throbber=new BDPMap.Throbber(a);this.throbber.renderIn(this.container);this.contentThrobber=true;}else{this.throbber=BDPMap.map.throbber;}};ContentLoader.prototype.unload=function(){if(document.getElementById("bookmarkLink")){document.getElementById("bookmarkLink").remove();}if(typeof this.loadedContent!="undefined"){var a=null;eventHandler.addEvent(this.contentOff,"remove",a=function(){document.getElementsByTagName("h1")[0].getElementsByTagName("span")[0].firstChild.data=BDPMap.commonHeader;BDPMap.socialBookmarksContainer.innerHTML=BDPMap.socialBookmarks;if(this.loadedContent){this.loadedContent.setOpacity(1);eventHandler.addEvent(this.loadedContent,"remove",function(){if(this.addedScript&&this.addedScript.parentNode){this.addedScript.parentNode.removeChild(this.addedScript);this.addedScript=undefined;}if(this.addedCss&&this.addedCss.parentNode){this.addedCss.parentNode.removeChild(this.addedCss);this.addedCss=undefined;}if(this.removeScript&&this.removeScript.parentNode){this.removeScript.parentNode.removeChild(this.removeScript);this.removeScript=undefined;}eventHandler.flush(this.loadedContent);this.loadedContent=undefined;}.bindTo(this));this.loadedContent.remove("fade");}eventHandler.removeEvent(this.contentOff,"remove",a);}.bindTo(this));this.contentOff.remove();document.title=BDPMap.defaultTitle;document.getElementById("footText").innerHTML=document.title;}};ContentLoader.prototype.init=function(b){var c=this;var a=this.fetchLinks(b);for(var d=0;d<a.length;d++){eventHandler.addEvent(a[d],"click",function(f){f=eventHandler.getEvent(f);f.preventDefault();c.getContent(this);});}};ContentLoader.prototype.fetchLinks=function(a){return a.getElementsByTagName("A");};ContentLoader.prototype.getContent=function(c){if(this.request){this.request.abort();}else{this.request=new HttpRequest;}this.request.init(this.insertContent.bindTo(this));var b=null;if(c.href.match(/firmenverzeichnis\/.*\.html/)||c.href.indexOf("firmenverzeichnis.html")>0){b=c.href+"?noWrap=true";}else{if(c.href.match(/suche-.*?([0-9]+)\.html/)){BDPMap.map.call("initCLoc",RegExp.$1);return;}else{c.href.match(/^(.*\/([^.]*).html)/);var a=RegExp.$1;b='getContent.html?q={"name":"'+RegExp.$2+'"}';}}if(this.cache[this.current]||1==2){this.insertContent(this.cache[this.current]);}else{if(this.rendering==true){this.throbber.hide();}this.getThrobber();this.throbber.show();if(typeof a!="undefined"&&typeof pageTracker!="undefined"&&typeof pageTracker._trackPageview=="function"){reg=new RegExp("http://"+document.location.host);pageTracker._trackPageview(a.replace(reg,""));}this.request.load(b);}};ContentLoader.prototype.load=function(a,b){if(b){this.callback=b;}if(this.request){this.request.abort();}else{this.request=new HttpRequest;}this.request.init(this.insertContent.bindTo(this));if(this.rendering==true){this.throbber.hide();}this.getThrobber();this.throbber.show();this.request.load(a);};ContentLoader.prototype.insertContent=function(d,b){d=BDPMap.parseAjaxResponse(d,this.throbber);if(d===false){return;}this.rendering=true;if(this.addedCss){this.removeCss=this.addedCss;this.addedCss=undefined;}if(this.addedScript){this.removeScript=this.addedScript;this.addedScript=undefined;}if(this.loadedContent){this.toRemove=this.loadedContent;this.loadedContent=undefined;}this.addedCss=renderer.createElement("LINK",{"rel":"stylesheet","type":"text/css","href":d.addCss});this.addedCss.renderIn(document.getElementsByTagName("HEAD")[0]);if(typeof d.addScript!="undefined"){this.addedScript=renderer.createElement("script",{"type":"text/javascript","src":d.addScript});this.addedScript.renderIn(document.getElementsByTagName("HEAD")[0]);}var c=ContentLoader.prototype.container=renderer.createElement("DIV");c.innerHTML=d.content.replace(/\\n/,"\n");this.loadedContent=renderer.assimilate(c.getElementsByTagName("div")[0]);this.loadedContent.addClassName("js");c=undefined;var f=document.getElementById("right");document.getElementsByTagName("h1")[0].getElementsByTagName("span")[0].firstChild.data=d.pageHeader;if(document.getElementById("maparea")){this.loadedContent.style.position="absolute";this.loadedContent.style.left=document.getElementById("maparea").offsetLeft+"px";this.loadedContent.style.top=document.getElementById("maparea").offsetTop+"px";this.loadedContent.style.width=document.getElementById("maparea").clientWidth+"px";this.loadedContent.style.height=document.getElementById("maparea").clientHeight+"px";this.loadedContent.style.overflow="auto";this.loadedContent.style.border="1px solid black";this.loadedContent.style.zIndex="600";}else{while(f.hasChildNodes()){f.removeChild(content.firstChild);}}var a;eventHandler.addEvent(this.loadedContent,"fadeready",a=function(){if(this.toRemove&&this.toRemove.parentNode){this.toRemove.parentNode.removeChild(this.toRemove);this.toRemove=undefined;}this.processBreadCrumbs();if(this.removeCss&&this.removeCss.parentNode){this.removeCss.parentNode.removeChild(this.removeCss);this.removeCss=undefined;}if(this.removeScript&&this.removeScript.parentNode){this.removeScript.parentNode.removeChild(this.removeScript);this.removeScript=undefined;}if(this.loadedContent){this.contentOff.renderIn(f);}if(typeof this.callback!="undefined"){this.callback();this.callback=undefined;}if(userAgent.app=="MSIE"){this.loadedContent.style.filter="";}if(typeof d.initScript!="undefined"){var p=10000,h=500,s,g,m=d.scriptArgs||[],j=d.initScript.split("."),o=d.scriptContext.split("."),k=null,n=null,r=null;r=window.setTimeout(function(){window.clearInterval(n);alert("Anwendung konnte nicht korrekt initialisiert werden.\nBitte versuchen Sie es erneut.");this.unload();}.bindTo(this),p);n=window.setInterval(function(){var u="",i=this;for(k=0;k<j.length;k++){u=u==""?window[j[k]]:u[j[k]];try{if(typeof u=="undefined"){throw false;}else{throw true;}}catch(t){if(t!==true){return;}}}for(k=0;k<o.length;k++){i=i==this?window[o[k]]:i[o[k]];try{if(typeof i=="undefined"){throw false;}else{throw true;}}catch(t){if(t!==true){return;}}}u.apply(i,m);window.clearInterval(n);window.clearTimeout(r);}.bindTo(this),h);}var q=function(){eventHandler.removeEvent(this.loadedContent,"fadeready",a);a=undefined;}.call(this);q=undefined;this.throbber.hide();this.rendering=false;}.bindTo(this));eventHandler.addEvent(this.loadedContent,"render",function(){var j=document.getElementsByTagName("table"),g;g=j.length;if(typeof d.pageTitle!="undefined"){document.title=d.pageTitle;}else{document.title=BDPMap.defaultTitle;}document.getElementById("footText").innerHTML=document.title;if(document.getElementById("bookmarkLink")){document.getElementById("bookmarkLink").remove();}this.deactivateBreadCrumbs();SubPageLinkProcessor.init();BDPMap.socialBookmarksContainer.innerHTML=d.socialBookmarks;if(typeof BDPMap.Search.Address.adressInput!="undefined"&&typeof BDPMap.Search.Address.adressInput.container!="undefined"){BDPMap.Search.Address.adressInput.container.destruct();}for(var h=0;h<g;h++){if(renderer.hasClassName("sortable",j[h])){new SortableTable(j[h]);}}}.bindTo(this));this.loadedContent.renderIn(f,"fade");};ContentLoader.prototype.deactivateBreadCrumbs=function(){var a=renderer.getElements(".breadCrumbs"),c;if(a.length>0){for(var b=0;b<a.length;b++){c=a[b].getElementsByTagName("a")[0];eventHandler.addEvent(c,"click",function(d){return function(f){f=eventHandler.getEvent(f);f.preventDefault();}.bindTo(this);}.call(this,b));}}};ContentLoader.prototype.processBreadCrumbs=function(){var a=renderer.getElements(".breadCrumbs"),d=undefined,c=undefined;if(a.length>0){for(var b=0;b<a.length;b++){d=a[b].getElementsByTagName("a")[0];eventHandler.addEvent(d,"click",function(f){return function(g){g=eventHandler.getEvent(g);g.preventDefault();this.getContent(a[f].getElementsByTagName("a")[0]);}.bindTo(this);}.call(this,b));}c=renderer.getElement("img",renderer.getElement("#breadCrumbs"));eventHandler.addEvent(c,"click",function(){BDPMap.Element.bookmarkBox(d.href);}.bindTo(this));}};Panoramio=function(){};Panoramio.prototype.initPicBubble=function(c){this.map=c;this.image=renderer.createElement("img");this.image.loadTimeout=window.setTimeout(function(){if(userAgent.app!="MSIE"||(userAgent.app=="MSIE"&&this.image.complete==false)){alert("Angefordertes Bild konnte in "+this.map.picBubbleTimeout+" Sekunden nicht geladen werden.");if(this.nextRequest){this.nextRequest.abort();}}}.bindTo(this),this.map.picBubbleTimeout*1000);this.image.onload=function(){if(typeof this.image.loadTimeout!="undefined"){window.clearTimeout(this.image.loadTimeout);}}.bindTo(this);var o={"src":this.origin.photo_file_url,"className":"pic","style":{"width":this.origin.width+"px","height":this.origin.height+"px"}};this.image.setProperties(o);this.image.setOpacity(1);var g=renderer.createElement("a",{"href":this.origin.photo_file_url,"target":"_blank"});this.image.renderIn(g);this.picBubble=renderer.createElement("div",{"className":"picBubble"});this.picBubble.renderIn(this.picBubbleContainer);this.off=renderer.createElement("img",{"src":BDPMap.imgPrefix+"actions/off_small.png","className":"picBubbleOff","className":"bubbleOff"});eventHandler.addEvent(this.off,"click",this.picBubble.destruct=function(){if(typeof this.next!="undefined"){eventHandler.removeEvent(this.next,"mouseover",this.nextOverListener);}if(typeof this.picBubbleContainer.parentNode!="undefined"){this.picBubbleContainer.remove((userAgent.app=="MSIE"?"":"fade"));}this.picBubble.onremove=function(){this.image=undefined;this.picBubble=undefined;this.origin=this.buffered;this.buffered=undefined;};}.bindTo(this));this.off.renderIn(this.titleBar);var r=this.picBubble.getCSSValue("paddingTop","int");var b=this.picBubble.getCSSValue("paddingRight","int");var h=this.picBubble.getCSSValue("paddingLeft","int");var i=this.picBubble.getCSSValue("borderRightWidth","int");var j=this.picBubble.getCSSValue("borderLeftWidth","int");this.picBubble.insertBefore(g,this.picBubble.firstChild);this.picBubbleContainer.style.width=this.picBubbleContainer.offsetWidth-b+"px";var n=document.createElement("h2");n.appendChild(document.createTextNode(this.origin.photo_title));var q=renderer.createElement("a",{"href":"http://www.panoramio.com","target":"_blank","style":{"position":"relative","zIndex":10000}});q.appendChild(renderer.createElement("img",{"src":"http://www.panoramio.com/img/logo-small.gif","className":"panoramioLogo"}));n.appendChild(q);this.picBubble.appendChild(n);this.picBubble.appendChild(document.createElement("br"));this.picBubble.appendChild(document.createTextNode(this.origin.upload_date));this.picBubble.appendChild(document.createElement("br"));q=renderer.createElement("a",{"href":this.origin.owner_url,"target":"_blank","className":"panoramioOwnerLink"});q.appendChild(document.createTextNode(this.origin.owner_name));this.picBubble.appendChild(document.createTextNode("Fotograf: "));q.renderIn(this.picBubble);this.picBubble.appendChild(document.createElement("br"));var d=document.createElement("em");d.appendChild(document.createTextNode("Photos provided by Panoramio are under the copyright of their owners"));this.picBubble.appendChild(d);this.picBubbleOverflow=renderer.createElement("div",{"className":"picBubbleOverflow"});this.titleBar.renderIn(this.picBubble);if(userAgent.app=="MSIE"&&userAgent.version<7){this.titleBar.style.left=-h+"px";this.titleBar.style.width=this.titleBar.parentNode.offsetWidth-this.titleBar.parentNode.getCSSValue("borderWidth","int")*2+"px";}var k=Math.round((this.map.container.offsetHeight-this.picBubbleContainer.offsetHeight)/2)+this.map.mapAreaOffset.y;k=k>0?k:0;this.picBubbleContainer.setProperties({"style":{"left":typeof this.posLeft=="undefined"?Math.round((this.map.container.offsetWidth-this.picBubbleContainer.offsetWidth)/2)+this.map.mapAreaOffset.x+"px":this.posLeft,"top":typeof this.posTop=="undefined"?k+"px":this.posTop}});if(this.has_more){this.next=renderer.createElement("img",{"src":"images/actions/picBubbleNext.png","className":"picBubbleNext iepngfix","title":"Weitere Bilder im Unkreis von ca. "+this.area.Distance.km.replace(/\./,",")+" Km.","width":80,"height":40});var p=Math.round((this.picBubble.offsetHeight/4-this.next.height)/2);p=p>=r?p:r;var f=this.picBubble.offsetWidth-this.next.width-i-j;if(userAgent.app=="MSIE"&&userAgent.version<7){f=f-h;}this.nextWrap=renderer.createElement("div",{"style":{"position":"absolute","overflow":"hidden","left":f+"px","top":p+"px","width":this.next.width+"px","height":this.next.height+"px"}});var m={"style":{"position":"absolute","left":"0","top":"0"}};this.next.setProperties(m);this.next.renderIn(this.nextWrap);this.nextWrap.renderIn(this.picBubble);this.next.idlePos={"x":this.nextWrap.offsetWidth-h,"y":0};this.next.activePos={"x":0,"y":0};if(userAgent.app!="MSIE"){eventHandler.addEvent(this.picBubbleContainer,"fadeready",function(){window.setTimeout(function(){if(!this.next.mouseover()){this.next.move({"stopPos":this.next.idlePos,"easing":true});}}.bindTo(this),500);}.bindTo(this));}else{window.setTimeout(function(){this.next.move({"stopPos":this.next.idlePos,"easing":true});}.bindTo(this),500);}eventHandler.addEvent(this.next,"mouseover",this.nextOverListener=function(){this.next.move({"stopPos":this.next.activePos,"easing":true});eventHandler.addEvent(this.next,"click",this.nextImageListener=function(){if(typeof this.getNextPicTimeout=="undefined"){this.getNextPicTimeout=window.setTimeout(function(){this.nextRequest.abort();var a={"stopPos":{"x":this.next.idlePos.x+h,"y":this.next.idlePos.y}};this.next.move(a);this.map.throbber.hide();this.getNextPicTimeout=undefined;}.bindTo(this),this.map.panoramioTimeout*1000);}this.next.clickEvent=true;eventHandler.removeEvent(this.next,"mouseout",this.nextOutListener);eventHandler.removeEvent(this.next,"click",this.nextImageListener);this.nextRequest=new HttpRequest;this.nextRequest.init(this.loader);this.map.throbber.show("Panoramio:nextImageListener");this.nextRequest.load('getNextAreaPic.html?q={"TopLeftLong":"'+this.area.TopLeft.coordinates.degrees.Longitude+'","LowerRightLat":"'+this.area.LowerRight.coordinates.degrees.Latitude+'","LowerRightLong":"'+this.area.LowerRight.coordinates.degrees.Longitude+'","TopLeftLat":"'+this.area.TopLeft.coordinates.degrees.Latitude+'","index":"'+(this.current++)+'"}');}.bindTo(this));}.bindTo(this));eventHandler.addEvent(this.next,"mouseout",this.nextOutListener=function(){eventHandler.removeEvent(this.next,"click",this.nextImageListener);this.next.clickEvent=false;this.next.move({"stopPos":this.next.idlePos,"easing":true});}.bindTo(this));}this.map.throbber.hide();};Shadow=function(){var i=undefined;if(userAgent.app!="MSIE"||userAgent.version>=7){i=renderer.createElement("div",{"className":"shadow"});var j=renderer.createElement("div",{"className":"shadowTopLeft"});j.renderIn(i);var g=renderer.createElement("div",{"className":"shadowTopCenter"});g.renderIn(i);var c=renderer.createElement("div",{"className":"shadowTopRight"});c.renderIn(i);var b=renderer.createElement("div",{"className":"shadowMiddleLeft"});b.renderIn(i);var a=renderer.createElement("div",{"className":"shadowMiddleCenter"});a.renderIn(i);var k=renderer.createElement("div",{"className":"shadowMiddleRight"});k.renderIn(i);var f=renderer.createElement("div",{"className":"shadowBottomLeft"});f.renderIn(i);var h=renderer.createElement("div",{"className":"shadowBottomCenter"});h.renderIn(i);var d=renderer.createElement("div",{"className":"shadowBottomRight"});d.renderIn(i);}return i;};var SubPageLinkProcessor=function(){};SubPageLinkProcessor.prototype.init=function(){var a;a=new ArrayA(renderer.getElements(".subPage"));a.foreach(this.parseElements.bindTo(this));this.links=new ArrayA(this.links);this.links.foreach(this.addEvents.bindTo(this));this.links=[];};SubPageLinkProcessor.prototype.links=[];SubPageLinkProcessor.prototype.parseElements=function(c){var a=renderer.getElements("a",c),b;for(b=0;b<a.length;b++){this.links.push(a[b]);}};SubPageLinkProcessor.prototype.addEvents=function(a){eventHandler.addEvent(a,"click",function(b){eventHandler.getEvent(b).preventDefault();contentLoader.getContent(a);}.bindTo(this));};var SubPageLinkProcessor=new SubPageLinkProcessor;var PicBox=function(b,a){a=a||"extraBilder";this.init(this.checkResponse.bindTo(this));this.load(a+"-"+b+".html");};PicBox.prototype=new HttpRequest();PicBox.prototype.showPics=function(){var ws=renderer.getWindowSize(),so=libScreen.getScrollOffset(),sheet=cssHandler.getSheet("contentCommon.css"),rule;maxZIndex=cssHandler.getMaxZIndex();rule=cssHandler.getRule(".lightBox",sheet);this.p=parseInt(rule.style.paddingLeft);this.pbw=parseInt(rule.style.borderWidth);rule=cssHandler.getRule(".lightBoxButton",sheet);this.bh=parseInt(rule.style.height);this.bw=parseInt(rule.style.width);this.current=0;this.buttonOffset=5;this.pic=renderer.createElement("img",{"src":this.response.pics[0].src,"className":"lightBox","style":{"width":this.response.pics[this.current].width+"px","height":this.response.pics[this.current].height+"px","top":so.y+Math.floor((ws.height-this.response.pics[this.current].height)/2)-this.p-this.pbw+"px","left":so.x+Math.floor((ws.width-this.response.pics[this.current].width)/2)-this.p-this.pbw+"px","zIndex":maxZIndex+10}});this.off=renderer.createElement("div",{"className":"lightBoxButton"});eventHandler.addEvent(this.off,"mousedown",function(e){e=eventHandler.getEvent(e);e.preventDefault();this.pic.remove();var x=function(){if(this.response.pics.length>1){this.ffwd.remove();this.rew.remove();}this.off.remove();libScreen.dim();}.call(this);}.bindTo(this));with(this.off.style){top=parseInt(this.pic.style.top)-this.bh+this.buttonOffset+"px";left=parseInt(this.pic.style.left)+this.response.pics[this.current].width+2*(this.p+this.pbw)-this.buttonOffset+"px";zIndex=maxZIndex+10;}if(this.response.pics.length>1){this.ffwd=renderer.createElement("div",{"className":"lightBoxButton lightBoxFFWD"});eventHandler.addEvent(this.ffwd,"mousedown",function(e){e=eventHandler.getEvent(e);e.preventDefault();this.getNext(true);}.bindTo(this));with(this.ffwd.style){top=so.y+Math.floor((ws.height-this.bh)/2)+"px";left=parseInt(this.pic.style.left)+this.response.pics[this.current].width+2*(this.p+this.pbw)+this.buttonOffset+"px";zIndex=maxZIndex+10;}this.rew=renderer.createElement("div",{"className":"lightBoxButton lightBoxREW"});eventHandler.addEvent(this.rew,"mousedown",function(e){e=eventHandler.getEvent(e);e.preventDefault();this.getNext(false);}.bindTo(this));with(this.rew.style){top=so.y+Math.floor((ws.height-this.bh)/2)+"px";left=parseInt(this.pic.style.left)-this.bw-this.buttonOffset+"px";zIndex=maxZIndex+10;}}libScreen.dim(false,maxZIndex+5,function(){this.off.renderIn(document.body);if(this.response.pics.length>1){this.ffwd.renderIn(document.body);this.rew.renderIn(document.body);}this.pic.renderIn(document.body);}.bindTo(this));};PicBox.prototype.getNext=function(a){if(a){if(this.current+1>=this.response.pics.length){this.current=0;}else{this.current++;}}else{if(this.current-1<0){this.current=this.response.pics.length-1;}else{this.current--;}}this.update();};PicBox.prototype.update=function(){var a=renderer.getWindowSize(),b=libScreen.getScrollOffset();this.pic.onload=function(){this.pic.style.width=this.response.pics[this.current].width+"px";this.pic.style.height=this.response.pics[this.current].height+"px";this.pic.style.top=b.y+Math.floor((a.height-this.response.pics[this.current].height)/2)-this.p-this.pbw+"px";this.pic.style.left=b.x+Math.floor((a.width-this.response.pics[this.current].width)/2)-this.p-this.pbw+"px";this.off.style.top=Math.floor(parseInt(this.pic.style.top)-this.bh)+this.buttonOffset+"px";this.off.style.left=parseInt(this.pic.style.left)+this.response.pics[this.current].width+2*(this.p+this.pbw)-this.buttonOffset+"px";if(this.response.pics.length>1){this.ffwd.style.top=b.y+Math.floor((a.height-this.bh)/2)+"px";this.ffwd.style.left=parseInt(this.pic.style.left)+this.response.pics[this.current].width+2*(this.p+this.pbw)+this.buttonOffset+"px";this.rew.style.top=b.y+Math.floor((a.height-this.bh)/2)+"px";this.rew.style.left=parseInt(this.pic.style.left)-this.bw-this.buttonOffset+"px";}}.bindTo(this);var c=new Date();this.pic.src=this.response.pics[this.current].src+"?"+c.getTime();};PicBox.prototype.checkResponse=function(a){try{this.response=JSON.parse(a);if(typeof this.response=="object"){throw true;}else{throw false;}}catch(b){if(b){this.showPics();}else{alert("Fehler beim laden der Daten!.");}}};
