/* (c) 2009 allesklar.com */
try{at_path=window.location.pathname.split('/');at_kvp3=(at_path.length>4?at_path[4].substr(0,48):'');at_kvp2=(at_path.length>3?at_path[3].substr(0,48):'');at_kvp1=(at_path.length>2?at_path[2].substr(0,48):'');if(at_path.length>1){at_path.shift();at_kvpath=at_path.join('/');at_kvpath=at_kvpath.substr(0,48);}else{at_kvpath=window.location.pathname.substr(0,48);}}catch(e){at_kvpath='';at_kvp1='';at_kvp2='';at_kvp3='';}
function getQueryStringVars(){var server_variables={};var query_string=window.location.search.split("?")[1];if(!query_string)return false;var get=query_string.split("&");for(var i=0;i<get.length;i++){var pair=get[i].split("=");server_variables[pair[0]]=unescape(pair[1]);}
return server_variables;}
function webVoicePop(){}
function getClick2CallFile(accountid,div_id){var fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript")
fileref.type="text/javascript";fileref.setAttribute("src","http://as00.estara.com/as/InitiateCall2.php?accountid="+accountid+"");var Ausrichtung=document.createAttribute("src");Ausrichtung.nodeValue="http://as00.estara.com/as/InitiateCall2.php?accountid="
+accountid+"";fileref.setAttributeNode(Ausrichtung);document.getElementById(div_id).appendChild(fileref);return true;}
function searchFocus(){}
function myopen(filename,windowname,properties){var mywindow=window.open(filename,windowname,properties);mywindow.focus();}
function openWin(url,title){top.name="main_window";var popup=window.open(url,title,"toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,width=370,height=610,scrollbars=yes");popup.focus();if(navigator.appName.substring(0,8)=="Netscape"){popup.location=url;popup.opener=self;}}
function openWindow(url,title){top.name="main_window";var popup=window.open(url,title,"toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,width=800,height=610,scrollbars=yes");popup.focus();if(navigator.appName.substring(0,8)=="Netscape"){popup.location=url;popup.opener=self;}}
function OpenMap(requestParam){window.open("http://routing.meinestadt.de/allesklarStadtplan/index.jsp?"
+requestParam,"MapWindow","width=441,height=615,resizable=yes,scrollbars=yes");return false;}
function popup(title){var popup=window.open("",title,"width=805,height=600,screenX=0,screenY=0,left=0,top=0,scrollbars=yes,resizable=yes");popup.focus();}
function popup2(url,title){var popup=window.open(url,title,"width=805,height=600,screenX=0,screenY=0,left=0,top=0,scrollbars=yes,resizable=yes");popup.focus();}
function mainOnLoad(){try{if(typeof wallpaper!='undefined'&&wallpaper){$('mt-bg').style.width='800px';}}catch(e){}
try{var r=document.referrer;MTC.phrase=MTC.getGoogleSearchphrase(r);if(typeof MTC.phrase!='undefined')$('searchphrase').value=MTC.filterPhrase(decodeURIComponent(escape(MTC.phrase)));}catch(e){}}
function mailme(user,contact,host){var sep='@';var email=user;var emailHost="allesklar.com";if(host)emailHost=host;if(contact){document.write("<a href="+"mail"+"to:"+email+sep+emailHost+">"
+contact+"</a>");}else{document.write("<a href="+"mail"+"to:"+email+sep+emailHost+">"
+email+sep+emailHost+"</a>");}}
function openjobdetail(filename,windowname,i){if(typeof i=='undefined')i=0;id=i;mywindow=window.open(filename,windowname,'width=805,height=600,screenX=0,screenY=0,left=0,top=0,scrollbars=yes,resizable=yes');mywindow.focus();}
var falkAdClaims=new Array();var falkAdClaims2Hide=new Array();function falkRegisterClaim(wp){trigger=falkAdClaims.length;falkAdClaims[trigger]=wp;}
function falkDisplayAdClaims(){while(wp=falkAdClaims.shift()){id1='falkWP_'+wp+'_claim';id2='falkWP_'+wp;id3='falkWP_'+wp+'_div';try{if($(id2).offsetHeight>45){$(id3).addClassName('ad-ri');$(id2).addClassName('ad-ri-inner');$(id1).setStyle({display:'none'});}else{$(id2).setStyle({display:'none'});$(id3).setStyle({display:'none'});}}catch(e){}}}
function falkShouldHideClaim(wp){for(i=0;i<falkAdClaims2Hide.length;i++){wp_to_hide=falkAdClaims2Hide[i];if(wp==wp_to_hide){return true;}}
return false;}
function mtUnHTMLspecialChar(string){string=string.replace(/&amp;/g,'&');string=string.replace(/&szlig;/g,'ß');string=string.replace(/&uuml;/g,'ü');string=string.replace(/&Uuml;/g,'Ü');string=string.replace(/&ouml;/g,'ö');string=string.replace(/&Ouml;/g,'Ö');string=string.replace(/&auml;/g,'ä');string=string.replace(/&Auml;/g,'Ä');string=string.replace(/&bdquo;/g,'"');string=string.replace(/&ldquo;/g,'"');string=string.replace(/&quot;/g,'\'');string=string.replace(/&#223;/g,'ß');string=string.replace(/&#252;/g,'ü');string=string.replace(/&#220;/g,'ü');string=string.replace(/&#246;/g,'ö');string=string.replace(/&#214;/g,'Ö');string=string.replace(/&#228;/g,'ä');string=string.replace(/&#196;/g,'Ä');string=string.replace(/&#224;/g,'à');string=string.replace(/&#8364;/g,'€');return string;}
function addEvent(obj,evType,fn){if(obj.addEventListener){obj.addEventListener(evType,fn,false);return true;}else if(obj.attachEvent){var r=obj.attachEvent("on"+evType,fn);return r;}else{return false;}}
function mtSwitchBannerDisplay(toDisplay){if(!toDisplay){document.getElementById('mt-banner').style.display='none';}else{document.getElementById('mt-banner').style.display='block';}
return true;}
function layoutRightCol(){if($('mt-content-ri')){var rCol=$('mt-content-ri');var rColHeadline=$('mt-content-ri').select('.adlinehead');for(i=0;i<rColHeadline.length;i++){var x=$(rColHeadline[i]);var text=$(rColHeadline[i]).innerHTML;x.replace('<div class="rlh-wrapper"><div class="adlinehead">'+text
+'</div></div>');}}}
function hideBoxedContent(){try{var el=document.getElementById("mt-popup-overlay");el.style.visibility=(el.style.visibility=="visible")?"hidden":"visible";var highlightWindow=document.getElementById("mt-popup");highlightWindow.style.visibility=(highlightWindow.style.visibility=="visible")?"hidden":"visible";var deactiveMainpage=document.getElementById("mt-background-deactivate");deactiveMainpage.style.visibility=(deactiveMainpage.style.visibility=="visible")?"hidden":"visible";if(getQueryStringVars().open_popup=="true"){var regExPattern=/[?&]open_popup=true/;var resultStr=regExPattern.exec(window.location.href);urlToReturn=window.location.href.replace(resultStr,"");window.location.href=urlToReturn;}}catch(e){}}
function showOverlayPopup(url,width,height){if(width==""){width="500px";}
if(height==""){height="600px";}
var OverlayPopup=document.getElementById("mt-popup-overlay");OverlayPopup.innerHTML='<input type="button" value="" onClick="hideBoxedContent();" class="mt-popup-close"/><a href="" onclick="hideBoxedContent();return false;" style="margin-right: 10px; margin-top: 10px; float: right;">schließen</a></div><div id="mt-popup"><iframe name="mt_iframe" src="" frameborder="0" scrolling="no" ></iframe></div><div>';var iframe=document.getElementById("mt-popup").getElementsByTagName("iframe");iframe[0].src=url;iframe[0].width=width;iframe[0].height=height;el=$("mt-popup-overlay");el.style.visibility=(el.style.visibility=="visible")?"hidden":"visible";highlightWindow=document.getElementById("mt-popup");highlightWindow.style.visibility=(highlightWindow.style.visibility=="visible")?"hidden":"visible";el.style.width=width;el.style.height=height;highlightWindow.style.width=width;highlightWindow.style.height=height;var windowposition=getPageScrollPosition();windowposition=parseInt(windowposition)+20;el.setStyle({top:windowposition+"px",width:width,height:height});var MainPage=document.getElementById("body");var DeactiveMainpage=document.getElementById("mt-background-deactivate");try{DeactiveMainpage.style.textAlign="center";DeactiveMainpage.style.visibility=(DeactiveMainpage.style.visibility=="visible")?"hidden":"visible";}catch(e){}}
function hexDecode(data){var b16_digits='0123456789abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRSTUVWXYZäüßÄÜ?,; -+=<> / \ ';var b16_map=new Array();for(var i=0;i<256;i++){b16_map[b16_digits.charAt(i>>4)+b16_digits.charAt(i&15)]=String.fromCharCode(i);}
if(data.length%2)data=""+data;var result=new Array();var j=0;for(var i=0;i<data.length;i+=1){result[j++]=b16_map[data.substr(i,2)];}
return result.join('');}
function cityLinkGen(linkURL){window.location.href=linkURL;}
function getPageScrollPosition(){var YScreenCoor=0;if(typeof(window.pageYOffset)=='number'){YScreenCoor=window.pageYOffset;}else if(document.body&&document.body.scrollTop){YScreenCoor=document.body.scrollTop;}else if(document.documentElement&&(document.documentElement.scrollTop)){YScreenCoor=document.documentElement.scrollTop;}
return[YScreenCoor];}
function fireEventFunction(element,event){if(document.createEventObject){var evt=document.createEventObject();return element.fireEvent('on'+event,evt)}
else{var evt=document.createEvent("HTMLEvents");evt.initEvent(event,true,true);return!element.dispatchEvent(evt);}}/* (c) 2009 allesklar.com */
var MTC={singelton:true,nextIvwCode:false,location_node_properties:{},toggleLocationChange:function(){if($('mt-ortswechsel-form').style.display=='none'){Effect.SlideDown('mt-ortswechsel-form');$('mt-ow-button').src='http://img.meinestadt.de/pix/layout/rl2008/buttons/dropup_mini.gif';}else{Effect.SlideUp('mt-ortswechsel-form');$('mt-ow-button').src='http://img.meinestadt.de/pix/layout/rl2008/buttons/dropdown_mini.gif';}},getGoogleSearchphrase:function(r){if(r.indexOf('?')==-1)return;var q=r.substr(r.indexOf('?')+1);var qa=q.split('&');for(var i=0;i<qa.length;i++){var qi=qa[i].split('=');if(qi.length==1)continue;if(qi[0]=='q'||qi[0]=='p'){var phrase=unescape(qi[1].replace(/\+/g,' '));}}
return phrase;},filterPhrase:function(p){var q=p.split(/ +/);for(var i=0;i<q.length;i++){if(q[i].toLowerCase()=='meinestadt'||q[i].toLowerCase()==node_name.toLowerCase()){q.splice(i--,1);}}
return q.join(' ');},toggleBigBanner:function(show){if(show){$('mt-banner').style.display='block';}else{$('mt-banner').style.display='none';}},setIvwCode:function(number){MTC.nextIvwCode=number;},getIvwCode:function(){var ivwImg=$('ivw-img');var res=ivwImg.src.match(/ivw\/CP\/([^\/?]+)/);return RegExp.$1;},reloadIvw:function(nextIvwCode){var ivwImg=$('ivw-img');var nextSrc=ivwImg.src;nextIvwCode=nextIvwCode||MTC.nextIvwCode;if(nextIvwCode){nextSrc=nextSrc.replace(/ivw\/CP\/[^\/?]+/,'ivw/CP/'+nextIvwCode);this.nextIvwCode=false;}
if(nextSrc.search(/d=/)!=-1){nextSrc=nextSrc.replace(/d=.*/,'d='+(Math.random()*100000));}else{nextSrc=nextSrc+'?d='+(Math.random()*100000);}
ivwImg.src=nextSrc;},reloadGivenIvw:function(number){this.reloadIvw(number);},track:function(options){options=options||{};if(!options.name)return;xt_med((options.ctrl=='PI')?'F':options.type||'C',options.level2||xtn2||0,options.name.replace(/\ /g,'_'),(options.ctrl=='PI')?undefined:options.ctrl||'N',options.url||options.duration,options.player,options.quality,options.stream);if(typeof(console)!='undefined'){console.log('MTC.track('+Object.toJSON(options)+')');}},reloadTracking:function(ivwCode,pageName){if(pageName){if(ivwCode)pageName+='&x4='+ivwCode+'_'+pageName.replace(/\ /g,'_');this.track({ctrl:'PI',name:pageName});}
if(ivwCode)this.reloadIvw(ivwCode);},trackInternalCampaign:function(options){options=options||{}
xt_ad(options.name);},switchTabbedContent:function(cont,tabNr,type){var tab_amount=$(cont).getElementsByTagName('li').length;for(i=1;i<=tab_amount;i++){$(cont+'-'+i).removeClassName('mt-tab-active');$(cont+'-content-'+i).style.display='none';}
$(cont+'-'+tabNr).addClassName('mt-tab-active');$(cont+'-content-'+tabNr).style.display='block';},importRss:function(url,parser){var headers={};app.getService('Ajax').request('/x/passthru.php?url='+encodeURIComponent(url),{method:'GET',requestHeaders:headers,onSuccess:function(transport){app.getService('Logging').debug('importRss',url+' onSuccess called');parser(transport);},onFailure:function(transport){app.getService('Logging').info('importRss','onFailure called');}})},changeLocationOnClick:function(url,old_location,new_location){var new_url=''
new_url=url.replace(old_location,new_location);return new_url;},executeAjaxCallViaProxy:function(url,options){options.onFailure=options.onFailure||function(transport){app.getService('Logging').info('executeAjaxCallViaProxy','onFailure called');}
app.getService('Ajax').request('/x/ajax/proxy/pass.php?url='+encodeURIComponent(url),options);}};/* (c) 2009 allesklar.com */
var SearchBar=Class.create();SearchBar.prototype={initialize:function(jsonSearchBarConfigs){this.searchBarConfigs=jsonSearchBarConfigs;this.activeSearchBarConfig={};this.activeChannel="";},refreshActiveConfig:function(){for(var channel_config in this.searchBarConfigs){if(this.searchBarConfigs[channel_config].active===true){this.activeSearchBarConfig=this.searchBarConfigs[channel_config];this.activeChannel=channel_config;}}},toggleActiveConfig:function(deactivated_config,activated_config){if(typeof this.searchBarConfigs[deactivated_config]!='undefined'){this.searchBarConfigs[deactivated_config].active=false;}
if(typeof this.searchBarConfigs[activated_config]!='undefined'){this.searchBarConfigs[activated_config].active=true;}
this.refreshActiveConfig();},toggleActive:function(tab_name,form){var element_old=$('stab_'+this.activeChannel);var element_new=$('stab_'+tab_name);if(element_old!==null){Element.removeClassName(element_old.parentNode,'on');}
Element.addClassName(element_new.parentNode,'on');element_new.href='#';var old_tpl=this.activeSearchBarConfig.search_template;var old_searchphrase=$('searchphrase').value;this.toggleActiveConfig(this.activeChannel,tab_name);var new_tpl=this.activeSearchBarConfig.search_template;if(old_tpl!=new_tpl){$('searchfields').innerHTML=this.activeSearchBarConfig.html_output;}
$(this.activeSearchBarConfig.button_id).value=this.activeSearchBarConfig.button_label;$('searchphrase').name=this.activeSearchBarConfig.search_param;$('searchphrase').value=old_searchphrase;$(form).action=this.activeSearchBarConfig.form_action;$(form).target=this.activeSearchBarConfig.form_target;$('search-link-ahref').href=this.activeSearchBarConfig.search_link;$('search-link-ahref').innerHTML=this.activeSearchBarConfig.search_link_label;if($('tc')!==null){$('tc').value=this.activeChannel;}
return false;},searchSubmit:function(form_id){$(form_id).submit(this);return false;},replaceSearchWithPlaceholder:function(){var url=window.location.toString();if(url.indexOf(this.activeSearchBarConfig.search_param)>-1&&typeof this.activeSearchBarConfig.placeholder!='undefined'){$('searchphrase').value=this.activeSearchBarConfig.placeholder;}},showMore:function(container_id,align_container){var absoluteValueLeft=0;var absoluteValueBottom=0;if($(align_container)!=null){absoluteValueLeft=$(align_container).offsetLeft;$(container_id).style.left=absoluteValueLeft+'px';if(Prototype.Browser.IE&&navigator.appVersion.include('MSIE 6')){absoluteValueBottom=$(align_container).offsetTop
+$(align_container).offsetHeight-6;}else{absoluteValueBottom=$(align_container).offsetTop
+$(align_container).offsetHeight+3;}
$(container_id).style.top=absoluteValueBottom+'px';}
Effect.toggle(container_id,'appear');return false;},hideMore:function(){if($('more-container')!=null&&$('more-container').visible()){$('more-container').hide();}},registerBodyListener:function(){Event.observe('body','click',this.hideMore.bindAsEventListener(this));}};/* (c) 2009 allesklar.com */
function setCookie(name,value,path,expires,domain,secure){var curCookie=name+"="+escape(value)+
((expires)?"; expires="+expires.toGMTString():"")+
((path)?"; path="+path:"")+
((domain)?"; domain="+domain:"")+
((secure)?"; secure":"");document.cookie=curCookie;}
function getCookie(name){var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!=0)return null;}else
begin+=2;var end=document.cookie.indexOf(";",begin);if(end==-1)
end=dc.length;return unescape(dc.substring(begin+prefix.length,end));}
function deleteCookie(name,path,domain){if(getCookie(name)){document.cookie=name+"="+
((path)?"; path="+path:"")+
((domain)?"; domain="+domain:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT";}}
function fixDate(date){var base=new Date(0);var skew=base.getTime();if(skew>0)
date.setTime(date.getTime()-skew);}/* (c) 2009 allesklar.com */
ak.namespace("ak.mt2002");ak.mt2002.zIndexResistantElements=[];ak.mt2002.NavMenu=Class.create(ak.maps2009.Logger,{initialize:function(options){options=options||{};this.setLoggerId('NavMenu');this.timerValue=100;this.container=$(options.container);if(!this.container){return this.error('Missing container!');}
this.activeMenu=$$('#'+options.container+' ul li.active')[0];if(!this.activeMenu){return this.error('No active menu entry!');}
this.selectedMenu=$$('#'+options.container+' ul li.selected')[0];if(!this.selectedMenu){return this.error('No selected menu entry!');}},changeActiveMenu:function(newMenu){if(newMenu==this.activeMenu)return;this.activeMenu.removeClassName('active');this.activeMenu.removeClassName('submenu-visible');ak.mt2002.zIndexResistantElements.each(function(e){e.setStyle('visibility:visible;')});this.activeMenu=newMenu;newMenu.addClassName('active');},showSubMenu:function(li){li=$(li);if(this.timeout){window.clearTimeout(this.timeout);delete this.timeout;}
this.changeActiveMenu(li);li.addClassName('submenu-visible');ak.mt2002.zIndexResistantElements.each(function(e){e.setStyle('visibility:hidden;')});},subMenuLeft:function(){if(this.timeout){window.clearTimeout(this.timeout);delete this.timeout;}
this.timeout=window.setTimeout(this.restoreDefault.bind(this),this.timerValue);},restoreDefault:function(){this.activeMenu.removeClassName('submenu-visible');ak.mt2002.zIndexResistantElements.each(function(e){e.setStyle('visibility:visible;')});if(this.activeMenu!=this.selectedMenu){this.changeActiveMenu(this.selectedMenu);}}});
