
function addWindowOnloadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){oldonload();func();}}}
function searchParamsToObject(params,additional){var spo={};jQuery.each(params,function(i,param){if(spo[param.name]===undefined){spo[param.name]=param.value;}});jQuery.each(additional,function(name,value){spo[name]=value;});if(spo['q_without_place']!==undefined){spo['q']=spo['q_without_place'];}
return spo;}
function ExposePrint(link)
{window.open(link,'Exposeprint','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=750,height=700');return false;}
function toggle(element,id,status,speed)
{element=element+id;if(speed){$(element).slideToggle(speed);}
if(status){$('#close').css('display','block');$('#open').css('display','none');}else{$('#close').css('display','none');$('#open').css('display','block');}}
function getMemberPart($part)
{if($part=='notices'){var notices=$('div[id^="notice_"]');if(notices.length>0){var estateId='';var estates='';notices.each(function(){estateId=$(this).attr('id').split('_');estates+=estateId[1]+';';});$.ajax({url:'ajax/memberinfo?part=notices&estates='+estates,success:function(data){$.each(data,function(key,value){$('#'+key).replaceWith('<div style="display:none" class="'+key+'_helperDiv">'+value+'</div>');$('.'+key+'_helperDiv').fadeIn(600,function(){$('.'+key+'_helperDiv').replaceWith(value);});});},dataType:'json'});}
return;}
if($part=='notice'){var notice=$('#notice');if(notice.length>0){$.get('ajax/memberinfo?part=notice&estateId='+notice.html(),function(data){if(data.length>0){$(notice).replaceWith('<div style="display:none" class="noticeHelperDiv">'+data+'</div>');$('.noticeHelperDiv').fadeIn(600,function(){$('.noticeHelperDiv').replaceWith(data);});}});}
return;}
if($('#'+$part).length>0){$.get('ajax/memberinfo?part='+$part,function(data){if(data.length>0){$('#'+$part).replaceWith('<div style="display:none" class="'+$part+'_helperDiv">'+data+'</div>');$('.'+$part+'_helperDiv').fadeIn(600,function(){$('.'+$part+'_helperDiv').replaceWith(data);});}});}}
var timeout;var loginHasFocus=false;var mouseTracker=false;var thumbnailTimer;var thumbnailTimerStatus=false;var thumbCount=0;$(document).ready(function(){getMemberPart('loginWrapBox');getMemberPart('searchAgentBox');getMemberPart('notice');getMemberPart('notices');$('.afs a').click(function(){gwoAdsenseConversion();})
$('.dropDown #cartItems').addClass('hidden');$('.dropDown input').live('focus',function(){loginHasFocus=true;}).live('blur',function(){loginHasFocus=false;});$('.drop li, .rightNavi li, .dropDown').live('mouseover',function(){if(timeout)
window.clearInterval(timeout);mouseTracker=false;$(this).addClass('hover');$(this).parent().next('ul').children('li').removeClass('hover');$(this).parent().next('ul').find('.dropDown').addClass('hidden');$(this).parent().prev('ul').children('li').removeClass('hover');$(this).parent().prev('ul').find('.dropDown').addClass('hidden');if($(this).hasClass('hover')){$(this).siblings().removeClass('hover')
$(this).children('.dropDown').removeClass('hidden');$(this).siblings().find('.dropDown').addClass('hidden');}});$('.drop li, .rightNavi li, .dropDown').live('mouseout',function(){if(timeout)
window.clearInterval(timeout);if(!loginHasFocus){var element=$(this);timeout=window.setTimeout(function(){$('.dropDown').addClass('hidden');$('.drop li, .rightNavi li').removeClass('hover');element.is(':hidden')?$(this).removeClass('hidden'):$(this).addClass('hidden');element.hasClass('hover')?$(this).removeClass('hover'):$(this).addClass('hover');},500);}
mouseTracker=true;});$('body').click(function(){if(mouseTracker){$('.dropDown').addClass('hidden');$('.drop li, .rightNavi li').removeClass('hover');}})
$('input.trim').bind('blur',function(){this.value=this.value.replace(/^[\s]+|[\s]+$/g,'').replace(/[\s]+/g,' ');})
$('form').has('input.trim').bind('submit',function(){$(this).children('input.trim').each(function(){$(this).val($(this).val().replace(/^[\s]+|[\s]+$/g,'').replace(/[\s]+/g,' '));});});$('input.clear').addClass("idleField").live('focus',function(){$(this).removeClass("idleField").addClass("focusField");if(this.value===this.defaultValue){this.value='';}}).live('blur',function(){$(this).removeClass("focusField").addClass("idleField");if(this.value===''){this.value=this.defaultValue;}});$('form').has('input.clear').bind('submit',function(){$(this).children('input.clear').each(function(){if($(this).val()===''){$(this).val(this.defaultValue);}});});$('.objImageThumbs img, .objImage img').hover(function(e){var imageParent=$(this).parent();var image=imageParent.find('.hoverImg');if(image.length==0){imageParent.append('<span class="hoverImgBox"><img class="hoverImg" src="'
+replaceImageParams($(this).attr('src'),'330x250','001000')
+'"></span>');image=imageParent.find('.hoverImg');}
var width=(image.width()==0)?330:image.width();var height=(image.height()==0)?250:image.height();var position=$(this).position();if(imageParent.hasClass('objImage')){image.parent().css({'left':(position.left+($(this).width()+10))+'px'});if((e.clientY-$(this).height())>=250){image.parent().css({'top':(position.top-172)+'px'});}else{image.parent().css({'top':(position.top-2)+'px'});}}else{if((e.clientY-$(this).height())>=250){image.parent().css({'left':(position.left-145)+'px','top':(position.top-260)+'px'});}else{image.parent().css({'left':(position.left-145)+'px','top':(position.top+50)+'px'});}}
$(this).parent().css({'z-index':'100'});image.parent().show();if($.browser.msie&&$.browser.version==6){$(".sort select").hide();}},function(){$('.thumbGalleryExpose, .thumbGallery').find('.hoverImg');$(this).parent().css({'z-index':'1'});$('.hoverImgBox').hide();if($.browser.msie&&$.browser.version==6){$(".sort select").show();}});$('.thumbGalleryExpose .hoverThumb').mouseleave(function(){thumbnailTimer=setTimeout('thumbSlideshow()',5000);thumbnailTimerStatus=true;thumbCount=$(this).attr('id').substring(4);});$('.thumbGalleryExpose .hoverThumb').mouseenter(function(){clearTimeout(thumbnailTimer);thumbnailTimerStatus=false;swapExposeImage(this);});$("a[rel='imageGallery']").click(function(){imageGallery();});$('.thumbGalleryExpose img').click(function(){$('#pic_0').attr('rel','');});$('.thumbGalleryExpose img, #pic_0').mouseover(function(){$('#pic_0').attr('rel','imageGallery');});$('#changePlaceLink, #changePlaceLink2').click(function(){$(this).colorbox({opacity:'0.7',close:'x',inline:true,href:'.changePlaceLayer'});$('.federalState fieldset li:nth-child(3n)').addClass('rightStateLi');if($('#cityForm .placeList').children().length<=6){$('#cityForm').css('border-right','1px solid #ddd');}});$('span.info').live('mouseover',function(){$(this).parent().parent().find('.infoPopup').removeClass('hidden');}).live('mouseout',function(){$(this).parent().parent().find('.infoPopup').addClass('hidden');});$('.infoPopup').live('mouseover',function(){$(this).removeClass('hidden');}).live('mouseout',function(){$(this).addClass('hidden');});if($('.slideShowStart ul').children().length<=3){$('.slideShowStart .control').addClass('disabled');}
if($('.slideShowError ul').children().length<=7){$('.slideShowError .control').addClass('disabled');}
if($('.slideShowExpose .slideList ul').children().length<=7){$('.slideShowExpose .control').addClass('disabled');}
if($('.slideShowBroker .slideList ul').children().length<=5){$('.slideShowBroker .control').addClass('disabled');}});function slideShow(view){$('.slideShow .slideList').jCarouselLite({circular:false,btnNext:'.slideRight',btnPrev:'.slideLeft',visible:5,speed:400});$('.slideShowEstates .slideList').jCarouselLite({circular:false,btnNext:'.slideRight',btnPrev:'.slideLeft',visible:view,speed:400});$('.slideShowInfo .slideList').jCarouselLite({circular:false,btnNext:'.slideRight',btnPrev:'.slideLeft',visible:view,speed:400});}
function thumbSlideshow(){if(thumbCount>=$('.thumbGalleryExpose li').size()-1){thumbCount=0;}
thumbCount++;swapExposeImage('#pic_'+thumbCount+' img');thumbnailTimer=setTimeout('thumbSlideshow()',5000);}
function replaceImageParams(imageSrc,size,params){var imageSrcSplit=imageSrc.split('_');imageSrcSplit[imageSrcSplit.length-2]=size;var imageParamSplit=imageSrcSplit[imageSrcSplit.length-1].split('.');imageParamSplit[0]=params;imageSrcSplit[imageSrcSplit.length-1]=imageParamSplit.join('.');return imageSrcSplit.join('_');}
function swapExposeImage(imageThumb){$('#pic_0 img').attr('title',$(imageThumb).attr('title'));$('#pic_0').attr('title',$(imageThumb).attr('title')
+' - Bild '
+($(imageThumb).attr('id')).substring(4)
+'/'
+($('.thumbGalleryExpose li:last').find('a').attr('id')).substring(4));$('.title').text($(imageThumb).attr('title'));$('.counter span').text(($(imageThumb).attr('id')).substring(4));$('.image_view').css('background-image','url('+$('#preview').attr('src')+')');$('#preview').hide();$('#preview').attr('src',replaceImageParams($(imageThumb).attr('src'),'320x230','111001'));$('#pic_0').attr('href',replaceImageParams($('#preview').attr('src'),'x','111001'));$('#preview').fadeIn(800);}
function imageGallery(){$("a[rel='imageGallery']").colorbox({opacity:'0.7',close:'x',previous:'',next:''});}
try{document.execCommand("BackgroundImageCache",false,true);}catch(err){}
$(document).ready(function(){$('a[rel="external"]').each(function(i){$(this).click(function(event){event.preventDefault();var re=new RegExp(/^\w*:\/\//);var href=$(this).attr('href');if(!$(this).attr('href').match(re)){href=$('base').attr('href')+href;}
window.open(href);});});});function hideall(){$('.hideable').css('display','none');$('.AlphaButton').removeClass('AlphaButtonActive');}
$(document).ready(function(){hideall();$('.showBtn, .immobilo .hideable').show();$('.hideBtn, .showBtn').click(function(){$('.hideBtn, .showBtn').toggle();$(this).parent().parent().find('.hideable').toggle();return false;});$('.detailsToggleBtn').click(function(){moreText=$(this).parent().parent().parent().children().filter('.hideable');isHidden=moreText.is(':hidden');hideall();isHidden?moreText.show():moreText.hide();return false;});$($('.changePlaceLayer .tabNavi a').parent().filter('li').children('a').attr('name')).show();$('.showHideDetails').click(function(){$('.moreText p').toggle();if($('.moreText').is(':hidden')){$('.moreText .clickBtn').addClass('btnShowHide');$('.showHideDetails').html('Details anzeigen');}
else{$('.moreText .clickBtn').removeClass('btnShowHide');$('.showHideDetails').html('Details ausblenden');}});if($('body').hasClass('landing')){var width=$(window).width();var flexWidth=($('#FlexSky').has('#cpcad')&&$('#FlexSky').width()==0)?160:$('#FlexSky').width();$(window).scroll(function(e){($(this).scrollTop()>130)?$('#FlexSky').css('top',($(this).scrollTop()+10)+'px'):$('#FlexSky').css('top',130);return false;});var heightAfs=$('.resultList ').height();if(heightAfs>200){$('#searchkeys').css('height',heightAfs-40);}}
$('.recommend #emailFrom, .recommend #emailFromName').keyup(function(){$(this).keyup(function(){addText($(this).attr('id'),$(this).attr('value'));});});$('#Address-Choice-0').click(function(){$('#billAdress').show();});$('#Address-Choice-1').click(function(){$('#billAdress').hide();});$('#RegOrLog-Choice-existing').click(function(){$('#regFormPassword').css('display','block');$('#regFormPrivacy').css('display','none');});$('#RegOrLog-Choice-new').click(function(){$('#regFormPassword').css('display','none');$('#regFormPrivacy').css('display','block');});$('.registration .close_me').click(function(){$('#bgOverlay, #ajax_registry_shadow, #ajax_registry_outer').hide();});$('.registration #fastReg').click(function(){$('#bgOverlay, #ajax_registry_shadow, #ajax_registry_outer').show();});});function showTabContent(){if(!$(this).parent().parent().filter('li').hasClass('active')){$($('li.active').children('a').attr('name')).hide().siblings('.tabContent').show();$($('.tabContent').parent().find('li.active')).removeClass('active').siblings('li').addClass('active');}}
function closeNoCookies(){$('#noCookies').css('display','none');}
function closeMapMessage(){$('.mapMessage').css('display','none');}
function shareExpose(){window.twttr=window.twttr||{};var D=550,A=450,C=screen.height,B=screen.width,H=Math.round((B/2)-(D/2)),G=0,F=document,E;if(C>A){G=Math.round((C/2)-(A/2));}
window.twttr.shareWin=window.open('http://twitter.com/share','','left='+H+',top='+G+',width='+D+',height='+A+',personalbar=0,toolbar=0,scrollbars=1,resizable=1');E=F.createElement('script');E.src='http://platform.twitter.com/bookmarklets/share.js?v=1';F.getElementsByTagName('head')[0].appendChild(E)}
function addText(t_id,t_value){$('.'+t_id+'Input').html(t_value);}
$(document).ready(function(){$('#recall').click(function(){if($(this).is(':checked')){if($('#phone').attr('value').length<3||$('#phone').attr('value').match(/^([-\s\d.\/()+])*$/)==null){call_err('phone',"Bitte geben Sie eine gültige Telefonnummer ein.");}}else{$('#phone').removeClass('error').addClass('positive').parent().find('span').remove();}});$('#phone').focus(function(){if($(this).hasClass('error')){$(this).addClass('active');if($('#recall').is(':checked')){$(this).bind('keyup change',function(){if($(this).attr('value').length<3||$(this).attr('value').match(/^([-\s\d.\/()+])*$/)==null){call_err('phone',"Bitte geben Sie eine gültige Telefonnummer ein.");}else{$('#phone').removeClass('error').addClass('positive').parent().find('span').remove();}});}}}).blur(function(){if($('#recall').is(':checked')){$(this).removeClass('active').unbind('keyup change');if($(this).attr('value').length<3||$(this).attr('value').match(/^([-\s\d.\/()+])*$/)==null){call_err('phone',"Bitte geben Sie eine gültige Telefonnummer ein.");}else{$('#phone').removeClass('error').addClass('positive').parent().find('span').remove();}}});});jQuery(window).bind('load',function(){$('#Upgrade-Private-0').after('<a id="privateQuestion0" href="#"><strong> (?)</strong><\/a>');$('#Upgrade-Private-1').after('<a id="privateQuestion1" href="#"><strong> (?)</strong><\/a>');$('#privateQuestion0, #privateQuestion1').click(function(event){event.preventDefault();}).bind('mouseover',function(){if($(this).attr("id")=="privateQuestion0"){$('div.center').html("Sie sind ein gewerblicher Anbieter, wenn Sie als Immobilienmakler fremde Immobilien bzw. gewerblich genutzte Immobilien anbieten.");}else if($(this).attr("id")=="privateQuestion1"){$('div.center').html("Sie sind ein privater Anbieter, wenn Sie die angebotene Immobilie, in den meisten F&auml;llen Zimmer, Wohnungen und H&auml;user als Privatperson besitzen.");};$('.popUp').css({left:($(this).position().left+290)+'px',top:($(this).position().top-20)+'px'}).fadeIn(200);}).bind('mouseout',function(){$('.popUp').fadeOut(200);});$('#Upgrade-upload-0').after('<a id="uploadQuestion0" href="#"><strong> (?)</strong><\/a>');$('#Upgrade-upload-1').after('<a id="uploadQuestion1" href="#"><strong> (?)</strong><\/a>');$('#uploadQuestion0, #uploadQuestion1').click(function(event){event.preventDefault();return false;}).bind('mouseover',function(){if($(this).attr("id")=="uploadQuestion0"){$('div.center').html("Sie stellen Ihre Immobilien ganz einfach und direkt über ein Online-Formular auf myimmo.de ein.");}else if($(this).attr("id")=="uploadQuestion1"){$('div.center').html("Sie nutzen eine externe Immobiliensoftware und übertragen Ihre Immobilien via FTP-Schnittstelle. Die Zugangsdaten werden Ihnen nach erfolgreichem Upgrade zugeschickt.");};$('.popUp').css({left:($(this).position().left+290)+'px',top:($(this).position().top-20)+'px'}).fadeIn(200);}).bind('mouseout',function(){$('.popUp').fadeOut(200);});toggleUploadType();$('#Upgrade-Private-1').click(function(){$('.private_switch').parent().fadeOut('fast');$('#Upgrade-upload-0').parent().fadeOut('fast');$('#Upgrade-upload-1').parent().fadeOut('fast');$('#pricesCommercial').addClass('hidden');;$('#pricesPrivate').removeClass('hidden');toggleUploadType();});$('#Upgrade-Private-0').click(function(){$('.private_switch').parent().fadeIn('fast');$('#Upgrade-upload-0').parent().fadeIn('fast');$('#Upgrade-upload-1').parent().fadeIn('fast');$('#pricesPrivate').addClass('hidden');$('#pricesCommercial').removeClass('hidden');toggleUploadType();});if($("input[name='Private']:checked").val()=='0'){$('#Upgrade-Private-0').click();}else{$('#Upgrade-Private-1').click();}
$("input[name='upload']").live('change',function(){toggleUploadType();});});function toggleUploadType()
{if($("input[name='upload']:checked").val()=='0'){$('#Upgrade-ImportSoftwareId').parent().fadeOut('fast');}else{$('#Upgrade-ImportSoftwareId').parent().fadeIn('fast');}}
var submit=true;var zaehler=0;$(document).ready(function(){$('.userFormHandler input,.userFormHandler select,.userFormHandler textarea').focus(function(){$(this).addClass('active');if($(this).hasClass('error')){$(this).bind('keyup change',function(){checkform($(this).attr('id'),$(this).attr('value'));});};}).blur(function(){$(this).removeClass('active').unbind('keyup change');checkform($(this).attr('id'),$(this).attr('value'));});$('.userFormHandler').submit(function(e){$event=e;$(this).find('input').each(function(){if($(this).is(':visible')){if(!checkform($(this).attr('id'),$(this).attr("value"))){$event.preventDefault();}}});$(this).find('select').each(function(){if($(this).is(':visible')){if(!checkform($(this).attr('id'),$(this).attr("value"))){$event.preventDefault();}}});$(this).find('textarea').each(function(){if($(this).is(':visible')){if(!checkform($(this).attr('id'),$(this).attr("value"))){$event.preventDefault();}}});if($('#recall').is(':checked')){if($('#phone').attr('value').length<3||$('#phone').attr('value').match(/^([-\s\d.\/()+])*$/)==null){call_err('phone',"Bitte geben Sie eine gültige Telefonnummer ein.");$event.preventDefault();}}else{$('#phone').removeClass('error').addClass('positive').parent().find('span').remove();}});});function checkform(t_id,t_value){switch(t_id){case"emailFromName":case"toTitle":t_value=jQuery.trim(t_value);if(t_value.length<40){if(t_value.match(/^((?!www|::|@|\/\/).)*$/)==null||t_value.length<2){if(t_id=="toTitle"&&t_value.length==0){call_success(t_id);return true;}else{call_err(t_id,"Bitte geben Sie einen gültigen Namen ein.");return false;}}else{call_success(t_id);return true;};}else{call_err(t_id,"Bitte geben nicht mehr als 40 Zeichen ein.");return false;}
break;case"lastname":case"last_name":case"ContactPersonDatas-LastName":case"OffererDatas-LastName":case"InvoiceAddress-LastName":case"Upgrade-LastName":if(t_value.length<2){call_err(t_id,"Bitte geben Sie einen gültigen Nachnamen ein.");return false;}else{call_success(t_id);return true;};break;case"name":if(t_value.length<2){call_err(t_id,"Bitte geben Sie einen Namen an.");return false;}else{call_success(t_id);return true;};break;case"company_name":if(t_value.length<2){call_err(t_id,"Bitte geben Sie den Namen Ihrer Firma ein.");return false;}else{call_success(t_id);return true;};break;case"Upgrade-CompanyName":if(t_value.length<2){call_err(t_id,"Bitte geben Sie den Namen Ihrer Firma ein.");return false;}else{call_success(t_id);return true;};break;case"regstreet":case"ContactPersonDatas-Street":case"OffererDatas-Street":case"InvoiceAddress-Street":case"Upgrade-Street":if(t_value.length<2){call_err(t_id,"Bitte geben Sie eine gültige Straße ein.");return false;}else{call_success(t_id);return true;};break;case"email_subject":if(t_value==0){call_err(t_id,"Bitte wählen Sie einen Betreff.");}else{call_success(t_id);return true;}
break;case"regnumber":if(t_value.length==0){call_err(t_id,"Bitte geben Sie eine Hausnummer an.");return false;}else{call_success(t_id);return true;};break;case"zip":case"ContactPersonDatas-Zip":case"OffererDatas-Zip":case"InvoiceAddress-Zip":case"Upgrade-Zip":if(t_value.length<4||t_value.length>5){call_err(t_id,"Bitte geben Sie eine gültige Postleitzahl ein.");return false;}else{call_success(t_id);return true;};break;case"town":case"ContactPersonDatas-Town":case"OffererDatas-Town":case"InvoiceAddress-Town":case"Upgrade-Town":if(t_value.length<2){call_err(t_id,"Bitte geben Sie einen gültigen Ort ein.");}else{call_success(t_id);return true;};break;case"phone1":case"OffererDatas-Phone":case"Upgrade-Phone":if(t_value.length<3||t_value.match(/^([-\s\d.\/()+])*$/)==null){call_err(t_id,"Bitte geben Sie eine gültige Telefonnummer ein.");return false;}else{call_success(t_id);return true;};break;case"import_sw":if(t_value==0){call_err(t_id,"Bitte wählen Sie eine Immobiliensoftware aus.");return false;}else{call_success(t_id);return true;}
break;case"forms":case"form_id":case"ContactPersonDatas-FormId":case"OffererDatas-FormId":case"InvoiceAddress-FormId":case"Upgrade-FormId":if(t_value==0){call_err(t_id,"Bitte wählen Sie eine Anrede aus.");}else{call_success(t_id);return true;}
break;case"email":case"email_from":case"emailFrom":case"emailTo":case"ContactPersonDatas-Email":case"OffererDatas-Email":case"Upgrade-Email":t_value=t_value.replace(/^\s+|\s+$/g,"");if(t_value.match(/^(([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+([;.](([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5}){1,25})+)*$/)==null){call_err(t_id,"Bitte geben Sie eine gültige E-Mail-Adresse an.");return false;}else{call_success(t_id);return true;};break;case"message":case"email_body":case"emailBody":if(t_value.length<10){call_err(t_id,"Bitte geben Sie einen aussagekräftigen Text ein.");return false;}else{call_success(t_id);return true;};break;case"Upgrade-oldpassword":case"ChangePassword-oldpassword":if(t_value.length<6){call_err(t_id,"Bitte geben Sie mindestens 6 Zeichen an.");return false;}else{call_success(t_id);return true;return true;}
case"ChangePassword-regpassword":if(t_value.length<6){call_err(t_id,"Bitte geben Sie mindestens 6 Zeichen an.");return false;}
else if(t_value!=$('#ChangePassword-regpassword2').attr('value')&&$('#ChangePassword-regpassword2').attr('value').length>0){call_err(t_id,"Die beiden Passwörter stimmen nicht überein");return false;}else{call_success(t_id);call_success('ChangePassword-regpassword2');return true;};break;case"ChangePassword-regpassword2":if(t_value.length<6){call_err(t_id,"Bitte geben Sie mindestens 6 Zeichen an.");return false;}
else if(t_value!=$('#ChangePassword-regpassword').attr('value')){call_err(t_id,"Die beiden Passwörter stimmen nicht überein");return false;}else{call_success(t_id);call_success('ChangePassword-regpassword');return true;};break;case"regpassword":if(t_value.length<6){call_err(t_id,"Bitte geben Sie mindestens 6 Zeichen an.");return false;}
else if(t_value!=$('#regpassword2').attr('value')&&$('#regpassword2').attr('value').length>0){call_err(t_id,"Die beiden Passwörter stimmen nicht überein");return false;}else{call_success(t_id);call_success('regpassword2');return true;};break;case"regpassword2":if(t_value.length<6){call_err(t_id,"Bitte geben Sie mindestens 6 Zeichen an.");return false;}
else if(t_value!=$('#regpassword').attr('value')){call_err(t_id,"Die beiden Passwörter stimmen nicht überein");return false;}else{call_success(t_id);call_success('regpassword');return true;};break;case"OffererDatas-ImportSoftwareId":case"Upgrade-ImportSoftwareId":if(t_value==0){call_err(t_id,"Bitte wählen Sie eine Importsoftware.");}else{call_success(t_id);return true;}
break;case"agb":case"Upgrade-Agb":if(!$('#agb, #Upgrade-Agb').attr("checked")){call_err(t_id,"Bitte bestätigen Sie, dass Sie die myimmo.de - AGB & Datenschutzerklärung gelesen haben und anerkennen.");return false;return false;}else{call_success(t_id);return true;};break;default:return true;}}
function call_err(t_id,err_text){$('#'+t_id).addClass('error');if($('#'+t_id).parent().find('span').length==0){$('#'+t_id).parent().find('input:last-child').after('<span class="err"><\/span>');$('#'+t_id).parent().find('select:last-child').after('<span class="err"><\/span>');}
$('#'+t_id).parent().find('span').html(err_text);}
function call_success(t_id){$('#'+t_id).removeClass('error').addClass('positive').parent().find('span').remove();}
function dialogBox(properties,okFunction,isConfirmBox){var dialogClass='',title='Bestätigung erforderlich',content='Bestätigung erforderlich',okButtonLabel='OK',cancelButtonLabel='Abbrechen',dialogProperties={};if(!isConfirmBox){title='Information';content='Information';}
$.each(properties.split("|"),function(i,property){var delimPos=property.indexOf(":");switch(property.substring(0,delimPos)){case'dialogClass':dialogClass=property.substring(delimPos+1);break;case'content':content=property.substring(delimPos+1);break;case'title':title=property.substring(delimPos+1);break;case'icon':content='<span class="ui-icon ui-icon-'+property.substring(delimPos+1)+'" style="float:left; margin:0 7px 20px 0;"></span>'+content;break;case'okButtonLabel':okButtonLabel=property.substring(delimPos+1);break;case'cancelButtonLabel':cancelButtonLabel=property.substring(delimPos+1);break;default:break;}});dialogProperties.autoOpen=true;dialogProperties.modal=true;dialogProperties.draggable=false;dialogProperties.resizable=false;dialogProperties.dialogClass=dialogClass;dialogProperties.title=title;dialogProperties.buttons={};dialogProperties.buttons[okButtonLabel]=function(){okFunction();$(this).dialog("close");$(this).dialog("destroy");$(this).remove();};if(isConfirmBox){dialogProperties.buttons[cancelButtonLabel]=function(){$(this).dialog("close");$(this).dialog("destroy");$(this).remove();};}
$('<div></div>').html('<p>'+content+'</p>').dialog(dialogProperties);}
function alertBox(properties,okFunction){if(okFunction==undefined){okFunction=function(){};}
dialogBox(properties,okFunction,false);}
function confirmBox(properties,okFunction){dialogBox(properties,okFunction,true);}
$(document).ready(function(){$('a.confirmBox, form.confirmBox').css('visibility','visible');$('a.confirmBox').live('click',function(event){var a=$(this);event.preventDefault();confirmBox(a.attr('rel'),function(){window.location.href=a.attr('href');});});$('form.confirmBox').live('submit',function(event){var form=$(this);event.preventDefault();confirmBox(form.find('input[name="confirmBox"]:hidden').val(),function(){form.removeClass('confirmBox')
form.unbind(event);form.submit();});});});$(document).ready(function(){$('a.encyclopediaLetter').live('click',function(e){e.preventDefault();$('a.encyclopediaLetter').each(function(index){$(this).css("font-weight","lighter");});$(this).css("font-weight","bolder");var letter=$(this).attr('id').split('_');$('div.encyclopediaPages').each(function(index){$(this).addClass('hidden');});$('#letterPages_'+letter[1]).removeClass('hidden');});$('a.encyclopediaLetter').each(function(index){var letter=$(this).attr('id').split('_');if(!$('#letterPages_'+letter[1]).length){$(this).replaceWith('<span class="encyclopediaLetter">'+letter[1]+'</span>');}});if($('.seoPost p').length!=0){if($('.seoPost p').html().length>800){$('.seoPost').css('height','209px');$('.showSeoPost').show();}}
$('.tab_content').hide();if($('div.objects').length>0){$('div.objects').show();}else{$('.seoTab .tab_content:eq(0)').show();}
$('.seoTabEntry a').click(function(){liTab=$(this).parent().filter('li');if(!liTab.hasClass('active')){$('.tab_content').hide();liTab.parent().find('li.active').removeClass('active');liTab.addClass('active');$(liTab.children('a').attr('name')).show().siblings('.tab_content').hide();return false;}});$('form[id="CmsContact"], form[id="CmsRecommend"], form[id="CmsUnisterMedia"]').live('submit',function(e){e.preventDefault();var form=$(this);var formId=form.attr('id');var formData=form.serialize();form.find('button').attr('disabled','disabled');form.css('opacity','0.5');form.siblings('span.message').remove();form.before('<span class="message"><img src="../images/icons/spinner.gif" height="12px"/> Bitte Warten, Ihre Daten werden verarbeitet.</span>');$.ajax({type:'POST',url:"ajax/cmsform",data:formData,success:function(returnData){if(returnData){form.parent().fadeOut(200,function(){$(this).replaceWith(returnData);$('#'+formId).parent().fadeIn(200);$('input.star').rating();});}else{form.siblings('span.message').remove();form.before('<span class="message error">Es ist ein Fehler aufgetreten. Bitte versuchen Sie es später erneut.</span>');}},error:function(){form.siblings('span.message').remove();form.before('<span class="message error">Es ist ein Fehler aufgetreten. Bitte versuchen Sie es später erneut.</span>');}});});if($('.contactFields').length!=0){if($('.contactFields').height()<80){$('.contactFields').css('padding-top','35px');$('.expMailTxt').css('top','-1px');$('.expMailTxt .feld').css('height',$('.contactFields').height()-17+'px');}else{$('.expMailTxt .feld').css('height',$('.contactFields').height()-55+'px');}}
if($('#___plusone_0').length==0){$('.socialGoogleplus').css('background','none');}
$('.hasTooltip').hover(function(){$(this).children('.toolTip, .ttShadow').toggle();});$('form[name="Demo"]').live('submit',function(e){$(this).parent().siblings('.spinner').css('display','block');});});function blinkInput(inputField){inputField.animate({color:"#ffffff"},300).animate({color:"#F78181"},300).animate({color:"#ffffff"},300).animate({color:"#747267"},300)}
$(document).ready(function(){var inputPlz=$('input[name="q"]');$('#searchform').submit(function(){var valueQchanged=$.trim(inputPlz.val());if(valueQchanged=='Ort oder PLZ'){blinkInput(inputPlz);return false;}else if(valueQchanged==''){inputPlz.val('Ort oder PLZ');return false;}});var inputId=$('input[name="myimmoId"]');$('#searchId').submit(function(){var valueIdchanged=$.trim(inputId.val());if(valueIdchanged=='Nummer'){blinkInput(inputId);return false;}else if(valueIdchanged==''){inputId.val('Nummer');return false;}});var inputs=new Array('#searchEstate','#searchEstateRoom');for(var i=0;i<inputs.length;i++){$(inputs[i]+'Button').val($(inputs[i]+'List li[rel='+$(inputs[i]).val()+']').html());$(inputs[i]+'List li').click(function(){$('#'+$(this).parent().attr('id').replace('List','')).val($(this).attr('rel'));$('#'+$(this).parent().attr('id').replace('List','Button')).children('span:last').text(($(this).html()));});$(inputs[i]+'Button').click(function(e){e.stopPropagation();var inputList='#'+$(this).attr('id').replace('Button','List');if(!$(inputList).is(':hidden')){$(inputList).hide();return;}
$(inputList).show();for(var i=0;i<inputs.length;i++){if(inputs[i]!=inputList.replace('List','')){$(inputs[i]+'List').hide();};};$('body').click(function(){$(inputList).hide();});});};});
