var immoSearchAgent={ajax:{rattail:'',pagetracker:'',eventtracker:'',setRattail:function(a){immoSearchAgent.ajax.rattail=a;},storeSearchagent:function(mailAdress,successDiv){immoSearchAgent.ajax.updateSearchagent(mailAdress,successDiv);},storeSearchagentByMail:function(idEmailField,successDiv){var mailAdress=document.getElementById(idEmailField).value;if(typeof(mailAdress)==='undefined'){mailAdress=document.getElementById(idEmailField).innerHTML;}
if(mailAdress.length<1){document.getElementById(idEmailField+'_error').style.display='block';}else{immoSearchAgent.ajax.updateSearchagent(mailAdress,successDiv);}},updateSearchagent:function(mail,successDiv){var forwardSeite='searchmap=searchmap',save='save=Y',email='email='
+encodeURI(mail),rattailTmp=immoSearchAgent.ajax.rattail.replace(/&amp;/g,'&'),uri='/searchAgentBooking.do?outputtype=ajaxSaveAgent&charset=utf8&'
+encodeURI(rattailTmp)
+'&'
+forwardSeite
+'&'
+save
+'&'+email;$j('#'+successDiv).load(uri);},storeSearchagentNewSearch:function(mailAdress,successDiv,action,tiny){if(tiny){TINY.box.show('/immonet/site/content/search/saveSearchOverlay.jsp?type=ajax&charset=utf8',1,579,535,0,null,20,1,null,1);}
immoSearchAgent.ajax.updateSearchagentNewSearch(mailAdress,successDiv,action);},storeSearchagentByMailNewSearch:function(idEmailField,successDiv,action){var e=document.getElementById(idEmailField),mailAdress=e.value;if(typeof(mailAdress)==='undefined'){mailAdress=e.innerHTML;}
immoSearchAgent.ajax.updateSearchagentNewSearch(mailAdress,successDiv,action);},updateSearchagentNewSearch:function(mail,successDiv,action){var email='mailaddress='+encodeURI(mail),rattailTmp=immoSearchAgent.ajax.rattail.replace(/&amp;/g,'&'),uri='/immobiliensuche/suchagent/'
+action
+'.do?outputtype=ajaxSaveAgent&charset=utf8&'
+encodeURI(rattailTmp)
+'&'
+email
+'&div='
+successDiv;$j('#'+successDiv).load(uri);},storeTracker:function(pageTrack,eventTrack){immoSearchAgent.ajax.pagetracker=(typeof(pageTrack)!=='undefined'||pageTrack!=null||pageTrack.length>0)?pageTrack:'';immoSearchAgent.ajax.eventtracker=(typeof(eventTrack)!=='undefined'||eventTrack!=null||eventTrack.length>0)?eventTrack:'';},setPagetracker:function(pageTrack){immoSearchAgent.ajax.pagetracker=pageTrack;},trackPage:function(add){add=(typeof(add)==='undefined')?'':add;_gaq.push(['secondTracker._trackPageview',immoSearchAgent.ajax.pagetracker+add]);},setEventtracker:function(eventTrack){immoSearchAgent.ajax.eventtracker=eventTrack;},getEventtracker:function(v){if(typeof(immoSearchAgent.ajax.eventtracker)!=='undefined'||immoSearchAgent.ajax.eventtracker!=null){eTracker=immoSearchAgent.ajax.eventtracker.split('/');if(v=='1'){return(eTracker[0]);}
if(v=='2'){return(eTracker[1]);}
if(v=='3'){return(immoSearchAgent.ajax.eventtracker);}}
return null;},trackEvent:function(add){var eventTracker1,eventTracker2,eventTracker3;add=(typeof(add)==='undefined')?'':add;eventTracker1=immoSearchAgent.ajax.getEventtracker('1');eventTracker2=immoSearchAgent.ajax.getEventtracker('2');eventTracker3=immoSearchAgent.ajax.getEventtracker('3')+add;if(eventTracker1!=null&&eventTracker2!=null&&eventTracker3!=null){_gaq.push(['secondTracker._trackEvent',eventTracker1,eventTracker2,eventTracker3]);}}},teaser:{saveState:function(isOpen){var state=isOpen?'closed':'open';$j.ajax({type:'GET',url:'/setSearchAgentTeaserState.do?state='+state});}}};var immoboxes={poll:{imagepos:0,firstload:true,infade:false,perform:function(form,pollType,questionId){var params;if(form!=null){params=immonet.formToQuery(form,null);if(form.id==="imgpollform"){immoboxes.poll.request('/immonet/poll/vote.do?showResult=true&pollType='+pollType+'&'+params+'&questionId='+questionId);}
else if(form.id==="tilepollform"){immoboxes.poll.request('/immonet/poll/vote.do?pollType='+pollType+'&'+params);}
else{immoboxes.poll.request('/immonet/poll/vote.do?'+params);}}},init:function(pollType,questionId){if(pollType==="imagepoll"){immoboxes.poll.request('/immonet/poll/show.do?questionId='+questionId+'&pollType='+pollType);}
else if(pollType==="tilepoll"){immoboxes.poll.request('/immonet/poll/show.do?pollType='+pollType);}
else{immoboxes.poll.request('/immonet/poll/show.do');}},request:function(url){if(typeof($j)!=="undefined"){$j('#pollcontainer').load(url);}
else if(typeof($)!=="undefined"){new Ajax.Updater('pollcontainer',url,{method:'get'});}},preloadImages:function(){var pollitems=document.getElementsByName('pollsource'),i,img;for(i=0;i<pollitems.length;i++){img=new Image();img.src=pollitems[i].value;}
immoboxes.poll.setCurrentImage(pollitems[immoboxes.poll.imagepos].value,pollitems.length);},nextItem:function(){if(!immoboxes.poll.infade){var pollitems=document.getElementsByName('pollsource');if(typeof(pollitems)!=="undefined"){if((immoboxes.poll.imagepos+1)<pollitems.length){immoboxes.poll.imagepos++;}
else{immoboxes.poll.imagepos=0;}
immoboxes.poll.setCurrentImage(pollitems[immoboxes.poll.imagepos].value,pollitems.length);}}},prevItem:function(){if(!immoboxes.poll.infade){var pollitems=document.getElementsByName('pollsource');if(typeof(pollitems)!=="undefined"){if((immoboxes.poll.imagepos-1)<0){immoboxes.poll.imagepos=pollitems.length-1;}
else{immoboxes.poll.imagepos--;}
immoboxes.poll.setCurrentImage(pollitems[immoboxes.poll.imagepos].value,pollitems.length);}}},setCurrentImage:function(sourceItem,itemLength){if(!immoboxes.poll.firstload){immoboxes.poll.infade=true;$j('#bigImageContent').fadeOut('fast',function(){$j('#currentImage').html('Bild '+(immoboxes.poll.imagepos+1)+' von '+itemLength);$j('#bigImageContent').html('<img src="'+sourceItem+'"/>');$j('#bigImageContent').fadeIn('fast',function(){immoboxes.poll.infade=false;});});}
else{$j('#currentImage').html('Bild '+(immoboxes.poll.imagepos+1)+' von '+itemLength);$j('#bigImageContent').html('<img src="'+sourceItem+'"/>');immoboxes.poll.firstload=false;}}}};var TINY={};function T$(i){return document.getElementById(i);}
TINY.box=function(){var p,m,b,fn,ic,iu,iw,ih,ia,f=0;var iframe=0;var intInterval=20;var isMSIE6=(new String(navigator.userAgent).indexOf('MSIE 6')>0)?true:false;return{bgcolor:'#083761',opacity:80,bgclose:1,bgimg:0,zindex:null,escclose:1,defaultDimension:"150px",onpopup:function(){},show:function(c,u,w,h,a,t,opacity,bgclose,bgcolor,bgimg,zindex,escclose){bgcolor=(typeof(bgcolor)!="undefined"&&bgcolor!==null)?bgcolor:this.bgcolor;bgclose=(typeof(bgclose)!="undefined"&&bgclose!==null)?bgclose:this.bgclose;escclose=(typeof(escclose)!="undefined"&&escclose!==null)?escclose:this.escclose;this.bgimg=(typeof(bgimg)!="undefined"&&bgimg!==null)?bgimg:this.bgimg;this.zindex=(typeof(zindex)!="undefined"&&zindex!==null)?zindex:this.zindex;if(!f){var tinyMaskId='tinymask';p=document.createElement('div');p.id='tinybox';m=document.createElement('div');m.id=tinyMaskId;b=document.createElement('div');b.id='tinycontent';document.body.appendChild(m);document.body.appendChild(p);p.appendChild(b);if(bgclose){m.onclick=TINY.box.remove;}
window.onresize=function(){TINY.box.resize(bgcolor);};if(escclose){listenAndCloseOnEscape=function(event){var KEYCODE_ESC=27;event=event||window.event;key=event.which||event.keyCode;if(document.getElementById(tinyMaskId)!==null){if(key==KEYCODE_ESC){TINY.box.removeTiny();}}};document.onkeyup=null;document.onkeyup=listenAndCloseOnEscape;}
f=1;}
if(a){p.style.width=p.style.height=TINY.box.defaultDimension;}
else{p.style.width=w?w+"px":"auto";p.style.height='auto';p.style.minWidth=w?w+"px":TINY.box.defaultDimension;p.style.minHeight=h?h+"px":TINY.box.defaultDimension;}
if(u){b.style.display='none';}
else{this.setBackgroundimage(p);b.innerHTML=c;}
this.mask(bgcolor);ic=c;iu=u;iw=w;ih=h;ia=a;opacity=(typeof(opacity)!="undefined"&&opacity!==null)?opacity:this.opacity;if(ia){this.alpha(m,1,opacity,3);}
else{this.popupTiny(opacity);}
if(t){setTimeout(function(){TINY.box.hide();},1000*t);}},fill:function(c,u,w,h,a){if(u){this.setBackgroundimage(p);var x=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject('Microsoft.XMLHTTP');x.onreadystatechange=function(){if(x.readyState==4&&x.status==200){TINY.box.psh(x.responseText,w,h,a);}};x.open('GET',c,1);x.send(null);}
else{this.psh(c,w,h,a);}},psh:function(c,w,h,a){if(a){if(!w||!h){var x=p.style.width,y=p.style.height;b.style.display='';p.style.width=w?w+'px':'';p.style.height=h?h+'px':'';w=parseInt(b.offsetWidth);h=parseInt(b.offsetHeight);b.style.display='none';p.style.width=x;p.style.height=y;}
this.size(p,w,h,4);}
else{this.setBackgroundimage(p);}
if(c.length>0){if(typeof jQuery==='function'){$j(b).html(c);}
else{b.innerHTML=c;}
TINY.box.onpopup();}},hide:function(){if(ia){TINY.box.alpha(p,-1,0,3);if(typeof(iframe)=='object'){TINY.box.alpha(iframe,-1,0,3);}}
else{TINY.box.closeTiny();}},remove:function(callback){if(callback!==null&&typeof callback==="function"){callback();}
if(ia){TINY.box.alpha(p,-1,0,3);if(typeof(iframe)=='object'){TINY.box.alpha(iframe,-1,0,3);}}
TINY.box.removeTiny();},resize:function(bgcolor){TINY.box.pos();TINY.box.mask(bgcolor);this.posIframe(false);},mask:function(bgcolor){m.style.height=TINY.page.theight()+'px';m.style.width='';m.style.width=TINY.page.twidth()+'px';m.style.background=(typeof(bgcolor)!="undefined"&&bgcolor!==null)?bgcolor:this.bgcolor;},pos:function(){var t=(TINY.page.height()/2)-(p.offsetHeight/2);t=t<10?10:t;p.style.top=(t+TINY.page.top())+'px';p.style.left=(TINY.page.width()/2)-(p.offsetWidth/2)+'px';},alpha:function(e,d,o,s){clearInterval(e.ai);if(d==1){e.style.opacity=0;e.style.filter='alpha(opacity=0)';e.style.display='block';this.pos();}
e.ai=setInterval(function(){TINY.box.twalpha(e,o,d,s);},intInterval);},twalpha:function(e,o,d,s){var oani=Math.round(e.style.opacity*100);if(oani==o){clearInterval(e.ai);if(d==-1){e.style.display='none';if(e==p){TINY.box.alpha(m,-1,0,2);}else{b.innerHTML=this.setBackgroundimage(p);}}
else{e==m?this.alpha(p,1,100,5):TINY.box.fill(ic,iu,iw,ih,ia);}}
else{var n=oani+Math.ceil(Math.abs(o-oani)/s)*d;this.setOpacity(e,n);}},size:function(e,w,h,s){e=typeof e=='object'?e:T$(e);clearInterval(e.si);var ow=e.offsetWidth,oh=e.offsetHeight,wo=ow-parseInt(e.style.width),ho=oh-parseInt(e.style.height);var wd=ow-wo>w?-1:1,hd=(oh-ho>h)?-1:1;e.si=setInterval(function(){TINY.box.twsize(e,w,wo,wd,h,ho,hd,s);},intInterval);},twsize:function(e,w,wo,wd,h,ho,hd,s){var ow=e.offsetWidth-wo,oh=e.offsetHeight-ho;if(ow==w&&oh==h){clearInterval(e.si);this.setBackgroundimage(p);b.style.display='block';if(isMSIE6){this.createIframe();}}
else{if(ow!=w){e.style.width=ow+(Math.ceil(Math.abs(w-ow)/s)*wd)+'px';}
if(oh!=h){e.style.height=oh+(Math.ceil(Math.abs(h-oh)/s)*hd)+'px';}
this.pos();}},setBackgroundimage:function(e){if(!this.bgimg){e.style.backgroundImage='none';}},setOpacity:function(e,o){e.style.opacity=o/100;e.style.filter='alpha(opacity='+o+')';},posShade:function(display){if(typeof(shade)=='object'){shade.style.top=((parseInt(p.style.top))-10)+'px';shade.style.left=((parseInt(p.style.left))-10)+'px';shade.style.display=(typeof(display)=='undefined'||shade.style.display=='block')?'block':'none';}},createIframe:function(){if(iframe===0){iframe=document.createElement('iframe');iframe.src='javascript: function a(){return false;} a();';iframe.frameBorder='0';iframe.id="tinyiframe";iframe.style.width=m.style.width;iframe.style.height=m.style.height;this.setOpacity(iframe,m.style.opacity);document.body.insertBefore(iframe,tinybox);}
this.posIframe();},posIframe:function(display){if(typeof(iframe)=='object'){iframe.style.display=(typeof(display)=='undefined'||iframe.style.display=='block')?'block':'none';}},popupTiny:function(o){this.setOpacity(m,o);TINY.box.fill(ic,iu,iw,ih,ia);if(this.zindex!==null){m.style.zIndex=this.zindex-1;p.style.zIndex=this.zindex;}
m.style.display='block';p.style.display='block';b.style.display='block';TINY.box.pos();if(isMSIE6){this.createIframe();}},closeTiny:function(){m.style.display='none';p.style.display='none';b.style.display='none';if(typeof(iframe)=='object'){iframe.style.display='none';}},removeTiny:function(){var body=document.getElementsByTagName('body');if(m){body[0].removeChild(m);}
if(p){body[0].removeChild(p);}
if(typeof(iframe)=='object'){iframe.style.display='none';}
f=0;}};}();TINY.page=function(){return{top:function(){return document.body.scrollTop||document.documentElement.scrollTop;},width:function(){if(self.innerWidth||document.documentElement.clientWidth>0){return self.innerWidth||document.documentElement.clientWidth;}
else{return document.body.clientWidth;}},height:function(){if(self.innerHeight||document.documentElement.clientHeight>0){return self.innerHeight||document.documentElement.clientHeight;}
else{return document.body.clientHeight;}},theight:function(){var d=document,b=d.body,e=d.documentElement;return Math.max(Math.max(b.scrollHeight,e.scrollHeight),Math.max(b.clientHeight,e.clientHeight));},twidth:function(){var d=document,b=d.body,e=d.documentElement;return Math.max(Math.max(b.scrollWidth,e.scrollWidth),Math.max(b.clientWidth,e.clientWidth));}};}();TINY.customs=function(){return{resizeOnXHR:function(height){var newHeight;if(!!height){newHeight=height;}
else{newHeight=$j("#tinycontent").height()-1;}
$j("#tinybox").height(newHeight).css('overflow','hidden');}};}();var searchform={DEBUG:false,acobj:null,colorClearInput:"#333",colorSetInput:"#999",inputLocation:"locationname",valueLocation:"Ort oder PLZ oder Stadtteil",urlPlace:"/immobiliensuche/ortsauswahl.do",urlPlaceSA:"/immobiliensuche/suchagent/ortsauswahl.do",withoutPlaceHolder:false,clearInput:function(e,v){e=document.getElementById(e);if((e!=null||e==='undefined')&&e.value==v&&e.defaultValue==v){e.defaultValue=e.value='';e.style.color=searchform.colorClearInput;}},setInputValue:function(e,v){e=document.getElementById(e);if(e!=null||e==='undefined'){if(e.value===''||e.value.length<0){if(e.title===''){e.defaultValue=e.value=v;if(e.id!=searchform.inputLocation){e.style.color=searchform.colorSetInput;}}else{$j('#lpObjekt').find('#locationname').val("Ort oder PLZ oder Stadtteil");}}}},setInputEvents:function(filterFlag){var elem=document.getElementById(searchform.inputLocation);if(elem!=null&&elem!=='undefined'){elem.onclick=function(){searchform.clearInput(searchform.inputLocation,searchform.valueLocation);};elem.onkeydown=function(){searchform.clearInput(searchform.inputLocation,searchform.valueLocation);};elem.onfocus=function(){elem.select();$j('#defTxtLocationName').hide();};elem.focus();elem.onblur=function(){if(!searchform.withoutPlaceHolder){searchform.setInputValue(searchform.inputLocation,searchform.valueLocation);}};}},init:function(containerId,pDivId,sUrl,withoutPlaceHolder){searchform.setInputEvents(true);var elem=document.getElementById(searchform.inputLocation),isExtSearchLink;if(elem!=null){var width=342;var maxHeight=200;if($j('#lpSeaBody').length){width=312;maxHeight=85;}
searchform.acobj=$j('#'+searchform.inputLocation).autocomplete({serviceUrl:sUrl,minChars:2,maxHeight:maxHeight,width:width,zIndex:9999,deferRequestBy:0,fnFormatResult:searchform.callbackACFormatResult,onSelect:function(value,data){isExtSearchLink=false;if(data.isExtSearchLink!=null){isExtSearchLink=true;}
searchform.setAC(data.id,data.type,isExtSearchLink);}});if(!!withoutPlaceHolder){searchform.withoutPlaceHolder=true;}
if(searchform.acobj!=null){searchform.acobj.onBlur=function(){};searchform.acobj.onEscape=function(){searchform.setAC('','');};searchform.integrateACCallbacks();}}},initSA:function(containerId,pDivId,sUrl){searchform.setInputEvents(false);var elem=document.getElementById(searchform.inputLocation);if(elem!=null){searchform.acobj=$j('#'+searchform.inputLocation).autocomplete({serviceUrl:sUrl,minChars:2,maxHeight:200,width:342,zIndex:9999,deferRequestBy:100,fnFormatResult:searchform.callbackACFormatResult,onSelect:function(value,data){searchform.setAC(data.id,data.type);searchform.callbackACBlur(true);}});if(searchform.acobj!=null){searchform.acobj.onBlur=function(){searchform.callbackACBlur(true);};searchform.acobj.onEscape=function(){searchform.setAC('','');};searchform.integrateACCallbacks();}}},initExtended:function(containerId,pDivId,sUrl){if(searchform.DEBUG){console.log('searchform.initExtende() ---------------------------');}
searchform.setInputEvents(false);var elem=document.getElementById(searchform.inputLocation);if(elem!=null){searchform.acobj=$j('#'+searchform.inputLocation).autocomplete({serviceUrl:sUrl,minChars:2,maxHeight:300,width:280,zIndex:9999,deferRequestBy:100,fnFormatResult:searchform.callbackACFormatResult,onSelect:function(value,data){if(immonet.sel.getVersion()==='2.0'){immonet.sel.setLocNameChangeFlag(true);}
searchform.setAC(data.id,data.type);searchform.callbackACBlur(false);}});if(searchform.acobj!=null){searchform.acobj.onBlur=function(){searchform.callbackACBlur(false);};searchform.acobj.onEscape=function(){searchform.setAC('','');};searchform.integrateACCallbacks();}}},integrateACCallbacks:function(){if(searchform.acobj!=null){var ac=document.getElementById(searchform.acobj.mainContainerId);var acContainer=null;acContainer=(acContainer==null)?document.getElementById('setAutocompleteLayer'):acContainer;acContainer=(acContainer==null)?document.getElementById('startsuche'):acContainer;acContainer=(acContainer==null)?document.getElementById('ort'):acContainer;acContainer=(acContainer==null)?document.getElementById('hausbauSuche'):acContainer;if(acContainer!=null){acContainer.appendChild(ac.parentNode.removeChild(ac));$j(ac).css({top:(32)+'px',left:1+'px'});if(!!$j('#lpBody').length){$j(ac).css({top:(65)+'px',left:19+'px'});}
if($j('#lpSeaBody').length){$j(ac).css({top:(105)+'px',left:19+'px'});}}
searchform.acobj.onKeyPressOrig=searchform.acobj.onKeyPress;searchform.acobj.onKeyPress=function(e){switch(e.keyCode){case Event.KEY_ESC:searchform.acobj.onEscape();break;case Event.KEY_TAB:case Event.KEY_RETURN:if(this.selectedIndex===-1){searchform.acobj.onBlur();}
if(e.keyCode===Event.KEY_TAB){searchform.acobj.onBlur();}
break;}
searchform.acobj.onKeyPressOrig(e);};searchform.acobj.onValueChangeOrig=searchform.acobj.onValueChange;searchform.acobj.onValueChange=function(){if(!searchform.acobj.ignoreValueChange){searchform.acobj.onEscape();}
searchform.acobj.onValueChangeOrig();};}},callbackACFormatResult:function(value,data,currentValue){var formatValue=value;if(data.top){if(data.type==='district'||data.isExtSearchLink!=null){formatValue='<span class="topDistrict jQSbox jQIsLay">'
+value+'</span>';}else{formatValue='<span class="importantcity jQSbox jQIsLay">'
+value+'</span>';}}
return formatValue;},callbackACBlur:function(saFlag){var actionDo=(saFlag)?searchform.urlPlaceSa:searchform.urlPlace;if(searchform.DEBUG){console.log('searchform.callbackACBlur() ---------------------------');}
if(immonet.sel.getVersion()==='2.0'){immonet.sel.updateSuche(false,'neuesuche',true);immonet.sel.openLocListDelay();}else{immosearchinfos.perform(actionDo,document.getElementById('neuesuche'),true);}},setAC:function(nacid,nactype,isExtSearchLink){var elem=null;elem=document.getElementById('acid');if(elem!=null){elem.value=nacid;}
elem=document.getElementById('actype');if(elem!=null){elem.value=nactype;}
if($j('#refinementLayer').length>0){immonet.sel.lnkRadiusSearchBehave();}
if(isExtSearchLink){_gaq.push(['secondTracker._trackEvent','home','suchbox','home/suchbox/autosuggest']);elem=document.getElementById(searchform.inputLocation);if(elem!=null){elem.value='';}
searchform.gotoExtendedSearch('/immobiliensuche/suche.do','startsuche');}},acOrt:function(){var elem=document.getElementById('suchart');if(elem!=null){elem.value='1';}
if(searchform.acobj!=null){searchform.acobj.clearCache();}},acUmkreis:function(){var elem=document.getElementById('suchart');if(elem!=null){elem.value='2';}
if(searchform.acobj!=null){searchform.acobj.clearCache();searchform.acobj.serviceUrl='/ajax/autocomplete/locationnameNC.do';}},gotoExtendedSearch:function(url,formName,adTag,trackingCode){var defaultTrackingCode='/suche/erweiterte-suche';if(adTag!=null){if(trackingCode!=null){_gaq.push(['secondTracker._trackEvent',adTag,'suche',adTag+trackingCode]);}else{_gaq.push(['secondTracker._trackEvent',adTag,'suche',adTag+defaultTrackingCode]);}}
var formElem=document.getElementById(formName);if(formElem!=null){var params=immonet.formToQuery(formElem,'',true);if(params!==''){var locationIsDefaultText=(params.indexOf(encodeURIComponent(this.valueLocation))!=-1);params+='&locdef='+locationIsDefaultText;window.location.href=url+'?gotoExtended=1&'+params;}}},handleStuff:function(optionValue){var e=null;e=document.getElementById('lnkErwSuche');if(e!=null){if(optionValue.value=='191_'){e.style.display="none";document.startsuche.showPopup.value="false";}else{e.style.display="inline";document.startsuche.showPopup.value="true";}}
e=document.getElementById('topriceLabel');if(e!=null){if(optionValue.value=='-1_6'){e.innerHTML="Verkehrswert (€)";}else{e.innerHTML="Preis (€)";}}}};var immonet=immonet||{};var immosearchinfos={DEBUG:false,cache:new Object(),requestIsActive:false,locFieldAj:"ajaxlocationname",locField:"locationname",cityField:"ortseingabe",queryStrAj:"ajaxquerystring",locCountAj:"ajaxlocationcount",locFedStateAj:"ajaxlocationfederalstate",totCountAj:"ajaxtotalcount",locTotCountAj:"ajaxlocationtotalcount",acTypeAj:"ajaxactype",acType:"actype",acidAj:"ajaxacid",acid:"acid",hintField:"auswahlhinweis",allCities:"ortealle",ridCont:"ridwcontainer",totalCount:"totalcount",selVersion:"0",entryCount:0,entryList:new Array(),helperInheritVal:function(ajaxE,e){fromElem=document.getElementById(ajaxE);if(fromElem!=null){toElem=document.getElementById(e);if(toElem!=null){toElem.value=fromElem.value;}}},helperLoopEntryList:function(arr,callback,countiesList,getEntryCount,reselectParams){var cbReturn=(typeof(countiesList)==='undefined'||countiesList==null)?new String():new Number(),i,elem;countiesList=(typeof(countiesList)==='undefined'||countiesList==null)?"":countiesList;getEntryCount=(typeof(getEntryCount)==='undefined'||getEntryCount==null)?false:getEntryCount;reselectParams=(typeof(reselectParams)==='undefined'||reselectParams==null)?null:reselectParams;for(i=0;i<arr.length;i++){elem=document.getElementById(arr[i][0]+String(arr[i][1]));if((elem!=null)&&(elem.type.substr(0,8)==='checkbox')){if(elem.checked==true){cbReturn+=callback(elem,arr[i],countiesList,getEntryCount,reselectParams);}}}
return cbReturn;},getMarkLK:function(e,arr){return(arr[2]=="county")?"-"+String(arr[1])+"-":"";},getMarkCount:function(e,arr,countiesList,getEntryCount){immosearchinfos.entryCount=(getEntryCount)?immosearchinfos.entryCount+1:immosearchinfos.entryCount;immosearchinfos.entryList.push(" "+arr[3]);var r=0;if((arr[2]!='city')||(countiesList.indexOf('-'+String(arr[5])+'-')==-1)){r=arr[4];}
return r;},setReselectPlaces:function(e,arr,y,z,reselectParams){var p=arr[2]+"=",j;for(j=0;j<reselectParams.length;j++){if(reselectParams[j].substr(0,p.length)==p){if(reselectParams[j]==p+arr[1]){e.checked=true;}}}},reselectPlaces:function(){var fromElem=document.getElementById(this.queryStrAj),celem;if(fromElem!=null){try{celem=document.getElementById(this.locCountAj);if(celem!=null){var counts=JSON.parse(celem.value);var params=fromElem.value.split("&");this.helperLoopEntryList(counts,immosearchinfos.setReselectPlaces,null,null,params);}}
catch(e){}}},setTotalCount:function(){var fromElem,html;fromElem=document.getElementById(this.totCountAj);if(fromElem!=null){html=String(fromElem.value)+((fromElem.value==1)?' Ergebnis':' Ergebnisse');$j("."+this.totalCount).empty().append('<em class="fsBig fwBold blue">'+html+'</em>');if(immonet.sel.getVersion()==='2.0'){$j('#totalCount').html(html);$j('#totalCount2').html(html);}}
this.helperInheritVal(this.locFieldAj,this.locField);this.helperInheritVal(this.acTypeAj,this.acType);this.helperInheritVal(this.acidAj,this.acid);},totalCountSet:function(){var newCount=0,elem,celem,toElem,listElem,locCntElem;this.entryCount=new Number();this.entryList=new Array();celem=document.getElementById(this.locCountAj);if(celem!=null){try{var countiesList="";var counts=JSON.parse(celem.value);countiesList=this.helperLoopEntryList(counts,immosearchinfos.getMarkLK);newCount=this.helperLoopEntryList(counts,immosearchinfos.getMarkCount,countiesList,true);}
catch(e){}}
toElem=document.getElementById(this.totCountAj);listElem=document.getElementById(this.hintField);if(this.entryCount==0){locCntElem=document.getElementById(this.locTotCountAj);if((toElem!=null)&&(locCntElem!=null)){toElem.value=String(locCntElem.value);}
if(listElem!=null){listElem.innerHTML='oder einzelne Orte w&auml;hlen';}
elem=document.getElementById(this.allCities);if(elem!=null){elem.checked=true;}}
else{if(toElem!=null){toElem.value=String(newCount);}
if(listElem!=null){entryList=this.entryList.toString();entryList=(entryList.length>32)?entryList.substr(0,32)+"...":entryList;listElem.innerHTML=String(this.entryCount)+((this.entryCount==1)?' Ort':' Orte')+' gew&auml;hlt: '+'<span class="jQSbox jQIsLay fwNormal">'+entryList+'</span>';}}
this.setTotalCount();},updateFields:function(data){var fromElem,geoElem,requestWasActive;if(immosearchinfos.DEBUG){console.log('immonsearchinfo.updateFields() -----------------------------');}
requestWasActive=immosearchinfos.requestIsActive;immosearchinfos.requestIsActive=false;try{geoElem=document.getElementById(immosearchinfos.cityField);if(geoElem!=null){if(data!=null){geoElem.innerHTML=data;if(immonet.sel.getVersion()==='2.0'&&requestWasActive){immonet.sel.refreshAjaxLayer();}
fromElem=document.getElementById(immosearchinfos.queryStrAj);if(fromElem!=null){immosearchinfos.cache[encodeURIComponent(fromElem.value)]=data;immosearchinfos.reselectPlaces();}}
immosearchinfos.setTotalCount();fromElem=document.getElementById(immosearchinfos.locFedStateAj);if(fromElem!=null){$j("#"+immosearchinfos.ridCont).load("/immobiliensuche/idw.do?idwFederalstate="+String(fromElem.value));}}}
catch(e){}},startRequest:function(url,params){if(immosearchinfos.DEBUG){console.log('immonsearchinfo.startRequest() --------');}
if((params!=null)&&(params!=="")&&!immosearchinfos.requestIsActive){immosearchinfos.requestIsActive=true;$j.ajax({url:url+'?'+params,dataType:'html',type:'GET',success:immosearchinfos.updateFields});}},perform:function(url,form,clrFlag){var ret=false,oldname,newname,geoElem,params,data;if(immosearchinfos.DEBUG){console.log('immonsearchinfo.perform(), url',url);}
if(url!=null&&typeof(url)!=="undefined"&&url!==""){if(form!=null&&typeof(form)!=="undefined"){if((clrFlag!=null)&&clrFlag){oldname=document.getElementById(this.locFieldAj);newname=document.getElementById(this.locField);if((oldname!=null)&&(newname!=null)&&(oldname.value!=newname.value)){geoElem=document.getElementById(this.cityField);if(geoElem!=null){geoElem.innerHTML='';}}}
params=immonet.formToQuery(form,null);data=this.cache[encodeURIComponent(params)];if(data==null||immonet.sel.getVersion()==='2.0'){this.startRequest(url,params);}
else{this.updateFields(data);}
suche.clearErrors();ret=true;}}
return(ret);},showAutocomplete:function(){$j('.autocomplete-w1').show();},hideAutocomplete:function(){$j('.autocomplete-w1').hide();},showDistrictChoice:function(){$j('#ortseingabe').show();},hideDistrictChoiceOnKeUp:function(){$j('#ortseingabe').hide();},hideDistrictChoice:function(e){if($j('#ortseingabe').is(':visible')){var myIndex=$j(e.target).parents('#ortseingabe').length;if(myIndex===0&&e.target.id!=='locationname'){$j('#ortseingabe').hide();}}}};var maxmediaAdList=maxmediaAdList||[],phpadsbanner='';var maxmedia={tryLoad:location.protocol.indexOf('https')>-1?false:true,dw:null,timeoutT:4000,intervalT:250,ajaxUrl:'//ad.boreus.de/MaxMediaManager/adjs.php',ajaxData:{n:'',zoneid:'',target:'',source:'',exclude:(!document.phpAds_used)?',':document.phpAds_used,r:Math.floor(Math.random()*99999999999),ct0:(!document.phpAds_ct0)?'':document.phpAds_ct0,loc:window.location.toString(),referer:document.referrer,block:'',ajax:'1'},ajaxRequest:'complete',ajaxInterv:null,resetAjaxRequest:function(){this.ajaxRequest='complete';if(maxmediaAdList.length==0){maxmedia.clearInterval();maxmedia.resetDW(false);}},blockAjaxRequest:function(){this.ajaxRequest='pending';},setInterval:function(fn){this.ajaxInterv=window.setInterval(fn,this.intervalT);},clearInterval:function(){window.clearInterval(this.ajaxInterv);},timeout:function(){maxmedia.clearInterval();maxmedia.resetDW(true);},overwriteDW:function(){this.dw=document.write;document.write=function(){return false;};},resetDW:function(timeout){if(timeout){if(this.ajaxRequest==='complete'){document.write=this.dw;if(this.dwInterv!==null){window.clearInterval(this.dwInterv);}}
else{if(this.dwInterv===null){this.dwInterv=window.setInterval('maxmedia.resetDW('+true+')',100);}}}
else{document.write=this.dw;}},getAds:function(){if(this.tryLoad){this.pushMaxmediaAdList();this.overwriteDW();this.setInterval('maxmedia.getAd()');window.setTimeout('maxmedia.timeout()',this.timeoutT);}},getAd:function(){var ad=null;if(this.ajaxRequest==='complete'){if(maxmediaAdList.length>0){this.blockAjaxRequest();ad=maxmediaAdList.shift();this.ajaxData.n=ad.keyvalue;this.ajaxData.zoneid=ad.zoneid;this.ajaxData.target=(typeof ad.target!=='undefined')?ad.target:'';this.ajaxData.source=(typeof ad.channel!=='undefined')?ad.channel:'';this.ajaxData.block=(typeof ad.block!=='undefined')?ad.block:'';this.loadAd(ad.parentNode);}}},loadAd:function(parentNode){if(this.ajaxData.zoneid>-1){$j.ajax({url:this.ajaxUrl,data:this.ajaxData,dataType:'script',timeout:2000,complete:function(xhr,status){if(status==='timeout'){xhr.abort();return null;}
else{$j('#'+parentNode).html(phpadsbanner).fadeIn(600).removeClass('hidden');}
phpadsbanner='';maxmedia.resetAjaxRequest();}});}},pushMaxmediaAdList:function(){var mmAdContainer=$j('div.jqMaxmedia'),i,j,elId,mmParams,kvSet,k,v,o;for(i=0;i<mmAdContainer.length;i++){elId=mmAdContainer[i].id;mmParams=elId.split('_');o={};o.parentNode=elId;for(j=0;j<mmParams.length;j++){kvSet=mmParams[j].split('-');k=kvSet[0];v=kvSet[1];switch(k){case'keyvalue':o.keyvalue=v;break;case'zoneid':o.zoneid=v;break;case'target':o.target='_'+v;break;case'channel':o.channel=v;break;case'block':o.block=v;break;default:break;}}
maxmediaAdList.push(o);}}};var immonet=immonet||{};immonet.browserLanguage=(navigator.language)?navigator.language:navigator.userLanguage;immonet.googleTranslate=function(){if(immonet.browserLanguage!="de"&&immonet.browserLanguage!="de-DE"&&immonet.browserLanguage!="de-AT"&&immonet.browserLanguage!="de-CH"&&immonet.browserLanguage!="de-LI"&&immonet.browserLanguage!="de-LU"){window.googleTranslateElementInit=function(){new google.translate.TranslateElement({pageLanguage:'de',autoDisplay:'true',layout:google.translate.TranslateElement.FloatPosition.TOP_LEFT,gaTrack:true,gaId:'UA-10265563-1'},'google_translate_element');};immonet.reloadJavascript('//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit');}};