var wnn_lang = ''; 

var wnn_suche = {
	
	land_values: [], //elemente in erster selectbox f. regionalauswahl
	checked_plz: '',
	mplz:[], 	// checked 

	load_region: function(katid,typ) {
		new IREDS_URL("/wn05iframe/a_immosuche.php?LANG="+wnn_lang+"&katid="+katid+"&type="+typ+"&cmd=region",{method: 'GET', vars:[], standard_action:true,onSuccess: function() {wnn_immosuche.update_katcnt();}}).call();

		wnn_immosuche.show_loading();
	},
	set_mplz: function(o) {
		if(o.checked) {
			this.mplz[this.mplz.length] = o.value; 
		} else {
			var d = -1; 
			for(var i = 0; i<this.mplz.length;i++) {
				if(this.mplz[i] == o.value) {
					d = i; 
				} 
			}
			if(d != -1) {
				this.mplz.splice(d,1); 
				// alert("remove "+d); 
			}

		}
		wnn_immosuche.update_katcnt(); 
		// this.load_bezirk(4);
		// alert("da"); 
	},

	add_option: function(sel,opt_show,opt_value) {
		euro=String.fromCharCode(8364);
		sel=$(sel);
		selected=arguments[3] || "";
		s_idx=sel.selectedIndex;
		if(s_idx < 0) s_idx=0;
		opt_show=opt_show.replace(/\&euro;/,euro);
		if(selected!="") {
			s_option = Builder.node('option',{'value':opt_value,selected:selected},opt_show);	
		}
		else {
			s_option = Builder.node('option',{'value':opt_value},opt_show);	
		}
		sel.appendChild(s_option);
		sel.selectedIndex=s_idx;
	},

	set_index:function(sel,val) {
		opts=$(sel);
		idx=0;
		for(i=0;i<opts.length && idx==0;i++) {
			if(opts[i].value==val) idx=i;
		}

		if(idx!=0) {
			opts.selectedIndex=idx;
		}
	},

	clear_select: function(sel) {
		sel=$(sel);
		sel.innerHTML="";
	},

	show_select:function(sel) {
		sel=$(sel);
		sel.show();
	},


	load_countries: function() {
		wnn_suche.load_region(3,"country");
	},

	load_land: function(val) {
		wnn_suche.unload_land();
		wnn_suche.unload_orte();
		wnn_suche.unload_bezirk();
		wnn_suche.load_region(val,"land");
		wnn_suche.show_plzort(val);

		if(val!=15281) {
			wnn_immosuche.hide_verf();
		}
		else {
			wnn_immosuche.show_verf();
		}
	},

	unload_land: function() {
		wnn_suche.unload('S_Land');
	},

	load_bezirk: function(val) {
		wnn_suche.unload_orte();
		wnn_suche.unload_bezirk();
		wnn_suche.load_region(val,"bezirk");
		wnn_suche.show_plzort(val);
	},

	unload_bezirk: function() {
		wnn_suche.unload('S_bezirk');
	},

	load_orte: function(val) {
		wnn_suche.load_region(val,"ort");
		wnn_suche.show_plzort(val);
		//wird auf jeden fall per ajax dann wieder angezeigt wenn noetig
		wnn_suche.unload_orte();
	},

	unload_orte: function() {
		wnn_suche.unload('S_ort');
	},

	unload: function(sel) {
		if($(sel)) {
			$(sel).innerHTML='';
			$(sel).hide();
		}
	},

	show_plzort: function(val) {
		show_plz=false;
		try {
			if($F('S_land') == -2) {
				wnn_suche.unload_orte();
				wnn_suche.unload_bezirk();
				show_plz=true;
			}
			else if($F('S_bezirk') == -2) {
				wnn_suche.unload_orte();
				wnn_suche.unload_bezirk();
				show_plz=true;
			}
		}
		catch(e) {
		}

		if(show_plz) {
			$('S_land').selectedIndex=$('S_land').length-1;
			$('d_plzinput').style.display="inline";
			$('d_plztxt').style.display="inline";
			$('S_bezirk').style.display="none";
			wnn_suche.unload_orte();
		}
		else {
			$('d_plzinput').style.display="none";
			$('i_plz').value="";
			$('i_plzinput').value="";
			$('d_plztxt').style.display="none";
			wnn_suche.hide_plzlayer();
		}
	},

	checkplz: function(plz) {
		wnn_suche.checked_plz=plz;
		plz=$F(plz);
		new IREDS_URL('/wn05iframe/a_immosuche.php?LANG='+wnn_lang+'&cmd=plz&plz='+plz,{method: 'GET', vars:[], standard_action:true}).call();
	},

	show_plzlayer: function() {
		shift=arguments[0] || "no";
		shift_width=arguments[1] || "";
		if(shift!="no") {
			Position.clone(wnn_suche.checked_plz,plz_layer,{setWidth:false,setHeight:false});
			$('plz_layer').style.top=parseInt($('plz_layer').style.top.replace(/px/,""))+shift_width.y+"px";
			$('plz_layer').style.left=parseInt($('plz_layer').style.left.replace(/px/,""))+shift_width.x+"px";
		}
		else {
			Position.clone(wnn_suche.checked_plz,plz_layer);
		}
		$('plz_layer').style.display="inline";
	},

	hide_plzlayer: function() {
		$('plz_layer').style.display="none";
		$('plz_layer').innerHTML='';
	},

	setplz_opt: function(plz) {
		ort=$(plz)[$(plz).selectedIndex].innerHTML;
		katid=$F(plz);
		if(katid>0) {
			wnn_suche.hide_plzlayer();
			wnn_suche.setplz_value(katid,ort);
		}
		if(katid==-2) {
			wnn_suche.hide_plzlayer();
			$('i_plz').value="";
			$('i_plzinput').value="";
		}
	},

	setplz_value: function(katid,ort) {
		$('i_plz').value=katid;
		$('i_plzinput').value=ort;
		wnn_immosuche.update_katcnt();
	},

	get_region: function() {
		region=0;

		check_all=arguments[0] || true;

		try {
			if($F('S_country')>0) region=$F('S_country');
		}
		catch(e) {
			;
		}

		try {
			if($F('S_land')>0) region=$F('S_land');
			if($F('S_bezirk')>0) region=$F('S_bezirk');
			if($F('S_ort')>0 && check_all) region=$F('S_ort');
			if($F('i_plz')>0 && check_all) region=$F('i_plz');
		}
		catch (e){
		}

		region=parseInt(region);

		return region;
	}
}

var wnn_immosuche = {
	erw_suche: false,
	gewerb: 0, 
	lang: '', 
	mietkauf_direct_click: false,
	erwsuche_open:false,
	mietkauf_open:false,

	init: function(l) {
		if(l == 'en') {
			 wnn_immosuche.lang = 'en'; 
			wnn_lang = 'en';
		}
		new IREDS_URL('/wn05iframe/a_immosuche.php?GEW='+wnn_immosuche.gewerb+'&LANG='+wnn_lang+'&cmd=init&LANG='+wnn_immosuche.lang,{method: 'GET', vars:[], standard_action:true}).call();
		form_name='WIZARD';
		document.forms.WIZARD.id=form_name;
		document.forms.WIZARD.onsubmit=wnn_immosuche.check;
	},

	init_small: function(l) {
		if(l == 'en') {
			 wnn_immosuche.lang = 'en'; 
			wnn_lang = 'en';
		}
		new IREDS_URL('/wn05iframe/a_immosuche.php?GEW='+wnn_immosuche.gewerb+'&LANG='+wnn_lang+'&cmd=init_small&LANG='+wnn_immosuche.lang,{method: 'GET', vars:[], standard_action:true}).call();
		form_name='WIZARD';
	},

	reset: function() {
		wnn_suche.unload_land();
		wnn_suche.unload_orte();
		wnn_suche.unload_bezirk();
		wnn_immosuche.reset_ext_options();
		$('eingabefelder').innerHTML='';
		$('S_land').style.display="none";
		$('suche_kat_1').selectedIndex=0;
		$('suche_kat_2').innerHTML="";
		$('suche_kat_2').style.display="none";
		$('suche_mix_1').innerHTML="";
		$('suche_mix_1').style.display="none";
	},

	check: function() {
		ok=true;

/*		res_cnt=$('suche_kat_1').options[$('suche_kat_1').selectedIndex].getAttribute('res_cnt');
		if($('suche_kat_2').visible() && $F('suche_kat_2')>0) {
			res_cnt=$('suche_kat_2').options[$('suche_kat_2').selectedIndex].getAttribute('res_cnt');
		}
*/
		region=wnn_suche.get_region(true);

		res_cnt=wnn_immosuche.get_res_cnt();

		if(region==15281) {
			if(wnn_lang == 'en') {
				updateError(2,"Please choose a region");

			} else {
				updateError(2,"Bitte w&auml;hlen Sie zumindest ein Bundesland");
			}
			ok=false;
		}
		else if(region==0) {
			if(wnn_lang == 'en') {
				updateError(2,"Please select a region");
			} else {
				updateError(2,"Bitte schr&auml;nken Sie Ihre Suche auf eine Region ein");
			}
			ok=false;
		}
		else {
			updateError(2,"");
		}


		if($F('S_land')==-2) {
			//suche nach plz!
			if($F('i_plz')=="") {
				 if(wnn_lang == 'en') {
					updateError(2,"Please enter a ZIP code or a city");
				 } else {
				   updateError(2,"Bitte geben Sie eine PLZ oder einen Ort ein und best&auml;tigen Sie die Auswahl!");
			    } 
				 ok=false;
			}
		}

		if($F('suche_kat_1')<0 || $F('suche_kat_1')=="") {
			 if(wnn_lang == 'en') {
				updateError(3,"Please choose a kind of object!");
			} else {
				updateError(3,"Bitte w&auml;hlen Sie eine Objektart aus!");
			} 
			ok=false;
		}
		if(res_cnt>300 && $F('S_ort')<=0 && $F('i_plz')=="" && !$F('suche_mix_1').match(/KATATT/) && !wnn_immosuche.get_checkboxes()) {
			if(wnn_lang == 'en') {
				updateError(1,"There are too many results <br/>Please narrow your selection!");
			} else {
				updateError(1,"Ihre Suche liefert zu viele Ergebnisse.<br/>Bitte schr&auml;nken Sie diese weiter ein oder w&auml;hlen Sie eine Vertragsform aus!");
		
			} 
			ok=false;
		}
		else {
			updateError(1,"");
		}


		if(res_cnt>300 && !wnn_immosuche.get_checkboxes()) {
			mietkauf_ok=wnn_immosuche.check_mietkauf();
			if(mietkauf_ok!="") {
				ok=false;
				window.setTimeout("updateError(4,'');",2500);
			}
			updateError(4,mietkauf_ok);
		}
		else {
			mietkauf_ok="";
		}

//		if(res_cnt>300 && !wnn_immosuche.get_checkboxes()) {
		if(res_cnt>300 && wnn_immosuche.get_mietkauf_art()=="none" && !wnn_immosuche.get_checkboxes()) {
			if(wnn_lang == 'en') { 
				updateError(1,"There are too many results <br/>Please narrow your selection!");
			} else {
				updateError(1,"Ihre Anfrage liefert zu viele Ergebnisse (>300). Bitte w&auml;hlen Sie eine Vertragsform oder schr&auml;nken Sie Ihre Suche weiter ein!");
			}
			window.setTimeout("updateError(1,'')",2500);
			ok=false;
		}
		return ok;
	},

	hide_verf: function() {
		$('s_verf').style.display="none";
	},
	
	show_verf: function() {
		if(!wnn_immosuche.erw_suche) {
			$('s_verf').style.display="inline";
		}
	},

	get_type: function() {
		type=0;
		try {
			if($F('suche_kat_2')>0) type= $F('suche_kat_2');
			else if($F('suche_kat_1')>0) type= $F('suche_kat_1');
			else type= 0;
		}
		catch(e) {
			type=0;
		}

		return type;
	},

	get_checkboxes: function() {
		ok_check=false;
		count=false;
		counter=0;
	
		if(arguments[0]=="count") {
			count=true;
		}

		elem=document.forms.WIZARD[0].elements;
		if(!elem) {
			elem=document.forms.WIZARD.elements;
		}

		for(i=0;i<elem.length;i++) {
			if(elem[i].checked==true) {
				ok_check=true;
				counter++;
			}
		}

		if(count) return counter;
		else return ok_check;
	},

	check_checkboxes: function(box) {
		if(wnn_immosuche.get_checkboxes("count")>0 && (wnn_immosuche.get_res_cnt()<=50 || !wnn_immosuche.mietkauf_isempty())) {
			updateError(5,'Beachten Sie, dass diese Einschr&auml;nkung wesentlichen Einfluss auf die Anzahl der Treffer hat und vielleicht 0 ergibt!');
			window.setTimeout("updateError(5,'');",2500);
		}	
	},

	load_typen: function(art) {
		art=$F(art);

		mietkauf=wnn_immosuche.get_mietkauf_for_ajax();
		new IREDS_URL('/wn05iframe/a_immosuche.php?GEW='+wnn_immosuche.gewerb+'&LANG='+wnn_lang+'&cmd=obj&type=art&art='+art+'&region='+wnn_suche.get_region()+mietkauf,{method: 'GET', vars:[], standard_action:true,onSuccess:wnn_immosuche.check_mietkauf_input_show()}).call();
		wnn_immosuche.show_loading();
		wnn_immosuche.show_ext_options();
	},

	show_kat2: function() {
		$('suche_kat_2').style.display="inline";
	},

	show_mix1: function() {
		$('suche_mix_1').style.display="inline";
	},

	unload_mix1: function() {
		$('suche_mix_1').hide();
		$('suche_mix_1').innerHTML='';
		$('eingabefelder').innerHTML='';
	},

	get_mietkauf_art: function() {
		//pw hack wohnungen spzeial ohne kat, aber mit wert -2021 und -2022 
		wohnung_spezial=$F('suche_kat_2');	

		if(wohnung_spezial==-2021) {
			return "kauf";
		}
		else if(wohnung_spezial==-2022) {
			return "miete";
		}

		sel=$('suche_mix_1');
		if(sel.selectedIndex >=0 && sel.options[sel.selectedIndex].text.match(/all/)) {
			art=sel.options[sel.selectedIndex].text.replace(/alle/,"");
			art=art.replace(/all/,"");
			art=art.toLowerCase();
			art=art.replace(/ \([0-9 ]*\)/,"");
			art=art.replace(/ /,"");
		}
		else if(sel.selectedIndex >=0 && (sel.options[sel.selectedIndex].text.match(/--/) || sel.options[sel.selectedIndex].text.match(/Vertrag/))) {
			art="none";
		}
		else {
			art="specific";
		}
		return art;
	},

	mietkauf_isempty: function() {
		art=wnn_immosuche.get_mietkauf_art();
		inputs=new Array();

		inputs.push('457');
		inputs.push('479');
		inputs.push('478');

		is_empty=true;

		if(art!="specific" && art!="none") {
			for(i=0;i<inputs.length;i++) {
				if($('suche_katatt_'+inputs[i]) && $F('suche_katatt_'+inputs[i]) != "") {
					is_empty=false;
				}
				if($('suche_katatt_-'+inputs[i]) && $F('suche_katatt_-'+inputs[i]) != "") {
					is_empty=false;
				}
			}
		}

		return is_empty;
	},

	check_mietkauf:function() {
		art=wnn_immosuche.get_mietkauf_art();

		error_msg="";
		if(art!="specific" && art!="none") {
			if($F('suche_katatt_457')!="" || $F('suche_katatt_-457')!="" 
			|| $F('suche_katatt_443')!="" || $F('suche_katatt_-443')!="") {
				if($F('suche_katatt_457')!="" || $F('suche_katatt_-457')!="") {
					error_msg=wnn_immosuche.check_mietkauf_input('457',10);
				}
				if($F('suche_katatt_443')!="" || $F('suche_katatt_-443')!="") {
					error_msg=wnn_immosuche.check_mietkauf_input('443',10);
				}	
			}
			else if(art=="miete" && $F('suche_mix_1')=="KATATT_474:1") {
				error_msg=wnn_immosuche.check_mietkauf_input('235',100);	
			}
			else if(art=="kauf" && $F('suche_mix_1')=="KATATT_473:1") {
				error_msg=wnn_immosuche.check_mietkauf_input('478',10000);
			}
		}

		return error_msg;
	},

	check_mietkauf_input: function(id_suffix,min) {
		von=parseInt($F('suche_katatt_'+id_suffix));
		bis=parseInt($F('suche_katatt_-'+id_suffix));


		if(isNaN(von)) von="empty";
		if(isNaN(bis)) bis="empty";

		error_msg="";

		if(von=="empty" && bis=="empty") {
			error_msg+="Bitte schr&auml;nken Sie Ihre Suche weiter ein!<br/>";
		}
		else if(von=="empty") {
			if(bis<min) {
				error_msg+="Der minimale Suchwert betr&auml;gt "+min+"!<br/>";
			}	
		}
		else if(bis=="empty") {
			if(von<min) {
				error_msg+="Der minimale Suchwert betr&auml;gt "+min+"!<br/>";
			}
		}
		else {
			if((von>0 && von <min) || (bis>0 && bis<min)) {
				error_msg+="Der minimale Suchwert betr&auml;gt "+min+"!<br/>";
			}
			if(von>=bis) {
				error_msg+="Von muss kleiner als bis sein!<br/>";
			}
		}
		return error_msg;
	},

	mietkauf_input_blur: function() {
		if(wnn_immosuche.get_res_cnt()>300) {
			msg=wnn_immosuche.check_mietkauf();
		}
		else {
			msg="";
		}
		updateError(4,msg);
	},

	get_mietkauf_input: function() {
		try {
			art=wnn_immosuche.get_mietkauf_art();
			//Effect.BlindUp('eingabefelder',{duration:0.5});
		}
		catch(e) {
			art="";
		}

		region=wnn_suche.get_region();
		if(art!="specific") {
			new IREDS_URL('/wn05iframe/a_immosuche.php?GEW='+wnn_immosuche.gewerb+'&LANG='+wnn_lang+'&cmd=mietkauf&art='+art+'&region='+region+'&type='+wnn_immosuche.get_type(),{method:'GET',vars:[],standard_action:true}).call();
		}
		else {
			window.setTimeout("$('eingabefelder').innerHTML='';",1000);
		}
		wnn_immosuche.hide_loading();
	},

	check_mietkauf_input_show: function() {
		//mit timeout, damit vorher noch schnell selected richtig gesetzt wird ... evil hack :(
		window.setTimeout("wnn_immosuche.get_mietkauf_input();",500);
	},

	get_mietkauf_for_ajax: function() {
		if($('suche_mix_1')) {
			mietkauf="&mietkauf="+encodeURI($F('suche_mix_1'));
		}
		else {
			mietkauf="";
		}

		return mietkauf;
	},

	effect_mietkauf:function() {
		if($('eingabefelder').innerHTML!="" && wnn_immosuche.mietkauf_open==false) {
			window.setTimeout("Effect.BlindDown('eingabefelder',{duration:1})",500);
			wnn_immosuche.mietkauf_open=true;
		}
		else {
//			Effect.BlindDown('eingabefelder',{duration:0.5});
		}
	},

	mietkauf_directClick:function() {
		wnn_immosuche.mietkauf_direct_click=true;
	},

	get_rooms_input: function(value) {
		Effect.BlindUp('rooms',{duration:0.5});
		new IREDS_URL('/wn05iframe/a_immosuche.php?GET='+wnn_immosuche.gewerb+'&LANG='+wnn_lang+'&cmd=get_rooms&value='+value,{method:'GET',vars:[],standard_action:true}).call();
	},

	effect_rooms:function() {
		if($('rooms')) {
			if($('rooms').innerHTML!="") {
				window.setTimeout("Effect.BlindDown('rooms',{duration:1})",500);
			}
			else {
				Effect.BlindDown('rooms',{duration:0.5});
			}
		}
	},

	check_genossenschaft: function(sel) {
		if(sel.value=="429") {
			wnn_immosuche.unload_mix1();
		}
		else {
			wnn_immosuche.show_loading();
			art=$('suche_kat_1').value;
			new IREDS_URL('/wn05iframe/a_immosuche.php?GEW='+wnn_immosuche.gewerb+'&LANG='+wnn_lang+'&cmd=mietkauf_sel&art='+art,{method:'GET',vars:[],standard_action:true,onSuccess:wnn_immosuche.hide_loading()}).call();
		}
	},

	get_res_cnt:function() {
		cnt=-1;

		if($F('suche_kat_1')>0) {
			if($F('suche_kat_2')>0) {
				val=$('suche_kat_2').options[$('suche_kat_2').selectedIndex].text;
			}
			else {
				val=$('suche_kat_1').options[$('suche_kat_1').selectedIndex].text;
			}
			if($('suche_mix_1').selectedIndex >=0 && $('suche_mix_1').options[$('suche_mix_1').selectedIndex].text.match(/\([0-9]+\)/)) {
				val=$('suche_mix_1').options[$('suche_mix_1').selectedIndex].text;
			}

			tmp=val.split("(");
			if(tmp.length>1) {
				cnt=parseInt(tmp[1]);
			}
		}

		return cnt;
	},

	ext_options: function() {
		art=parseInt($F('suche_kat_1'));
		wnn_immosuche.erw_suche=true;
		if(art<=0) {
			updateError('1',"W&auml;hlen Sie bitte eine Objektart, bevor Sie die Suche weiter eingrenzen!");
			window.setTimeout("updateError('1','')",2000);
		}
		wnn_immosuche.show_ext_options();
	},

	show_ext_options_deferred: function() {
		art=parseInt($F('suche_kat_1'));
		if(art=="202") {
			//bei wohnung muss auf 2. input gewartet werden, ziemlich mieser hack ...
			//aber was sich die leute immer alles einfallen lassen	
			window.setTimeout("wnn_immosuche.show_ext_options();",700);
		}
		else {
			wnn_immosuche.show_ext_options();
		}
	},

	show_ext_options: function() {
		art=parseInt($F('suche_kat_1'));
		if(art>0 && wnn_immosuche.erw_suche) {
			if($('suche_kat_2')) {
				if($('suche_mix_1') && art=="202") {
					tmpart=$F('suche_mix_1');
					if(tmpart=='KATATT_473:1') {
						subart="-2021";
					}
					else if(tmpart=='KATATT_474:1') {
						subart="-2022";
					}
					else {
						subart=$F('suche_kat_2');
					}
				}
				else {
					subart=$F('suche_kat_2');
				}
			}
			else {
				subart=0;
			}
			region=wnn_suche.get_region();
			//Effect.BlindUp('moreoptions',{duration:0.2});
			mietkauf=wnn_immosuche.get_mietkauf_for_ajax();
			direct_click="";
//			if(wnn_immosuche.mietkauf_direct_click) {
				direct_click="&direct_click=1";
				wnn_immosuche.mietkauf_direct_click=false;
//			}
			new IREDS_URL('/wn05iframe/a_immosuche.php?GEW='+wnn_immosuche.gewerb+'&region='+region+'&LANG='+wnn_lang+'&cmd=obj&type=ext_options&art='+art+"&subart="+subart+mietkauf+direct_click,{method: 'GET', vars:[], standard_action:true}).call();
		}
	},

	reset_ext_options: function() {
		art=parseInt($F('suche_kat_1'));
		if(art>0 && wnn_immosuche.erw_suche) {
			mietkauf=wnn_immosuche.get_mietkauf_for_ajax();
			region=$('S_country').value;
			if(region!=15281) {
				//Effect.BlindUp('moreoptions',{duration:0.2});
				$('moreoptions').innerHTML='';
			}
		}
	},

	effect_ext_options:function() {
		if($('moreoptions').innerHTML!="" && wnn_immosuche.erwsuche_open==false) {
			wnn_immosuche.erwsuche_open=true;
			window.setTimeout("Effect.BlindDown('moreoptions',{duration:1})",500);
			$('s_verf').style.display="none";
		}
		else {
			//Effect.BlindDown('moreoptions',{duration:0.5});
		}
	},

	update_katcnt: function() {
		if(arguments[0]=="miete") {
			cmd="katcnt_miete";
		}
		else {
			cmd="katcnt";
		}

		art=parseInt($F('suche_kat_1'));
		if($('suche_kat_2')) {
			subart=parseInt($F('suche_kat_2'));
		}
		else {
			subart=0;
		}
		region=wnn_suche.get_region();

		mietkauf=wnn_immosuche.get_mietkauf_for_ajax();
		var pmyplz = ""; 
		if(wnn_suche.mplz.length > 0 &&  region == 4) {
			pmyplz = "&mplzs="+wnn_suche.mplz.join(',')+"&"; 
		}
		if(region>0) {
			new IREDS_URL('/wn05iframe/a_immosuche.php?GEW='+wnn_immosuche.gewerb+'&LANG='+wnn_lang+'&cmd='+
				cmd+'&art='+art+'&subart='+subart+"&region="+region+pmyplz+mietkauf,{method:'GET',vars:[],standard_action:true,onSuccess:wnn_immosuche.check_mietkauf_input_show()}).call();
		}
		else {
			wnn_immosuche.hide_loading();
		}
	},


	show_loading: function() {
		loading=$('loading_div');	
		varsuche=$('suche');
		Position.clone(varsuche,loading);
		loading.setOpacity(0.0);
		loading.show();
		Effect.Fade('loading_div',{duration:0.3,from:0.0,to:0.5});
	},

	hide_loading: function() {
		Effect.Fade('loading_div',{duration:0.3,from:0.5,to:0.0});
		window.setTimeout("$('loading_div').hide();",350);
	}
}
