<!-- Begin
function drop_vacancy(abc){
	document.forms[fname].elements[abc+'D'].selectedIndex=0;
	document.forms[fname].elements[abc+'M'].selectedIndex=0;
}

function radio_smoking(abc){
	if(abc == 'Yes' && document.getElementById('SmokingYes').checked == true){
		document.getElementById('SmokingNo').checked = false;
	}
	if(abc == 'No'  && document.getElementById('SmokingNo').checked == true){
		document.getElementById('SmokingYes').checked = false;
	}
	showResult();
}

function region_new(obj){
	var name = obj.form.name;
	var countryid = obj.options[obj.selectedIndex].value;

	//if not allready got, getit
	if(!countryregions[countryid] && countryid > 0){
		xmlhttp = GetXmlHttpObject();
	
		if(xmlhttp==null){
			alert ("Your browser does not support XMLHTTP!");
			return;
		}
		var url = "/search/ext_search.php";
		var fele = '?SelectCountry='+countryid;
		url = url+fele;//alle felder anhängen

		xmlhttp.open("GET",encodeURI(url),true);
		xmlhttp.onreadystatechange = function(){
			if(xmlhttp.readyState == 4){
				var jscript = xmlhttp.responseText;
				eval(jscript);
				reread(name, countryid);
			}
		}
		xmlhttp.send(null);		
	}else{
		reread(name, countryid);
	}
	
}

function reread(name, countryid){
	while(document.forms[name].StateID.length > 1){ 
		document.forms[name].StateID.options[document.forms[name].StateID.length-1] = null;
	}
	if(countrystates[countryid]){
		for(i=0; i<countrystates[countryid].length-1; i=i+2){ 
			x = new Option(countrystates[countryid][i],countrystates[countryid][i+1]) ;
			document.forms[name].StateID.options[document.forms[name].StateID.length] = x;
		}
		if(stateid > 0){
			document.forms[name]['StateID'].value = stateid;
		}else{
			document.forms[name].StateID.selectedIndex = 0;
		}
	}
	
	while(document.forms[name].RegionID.length > 1){ 
		document.forms[name].RegionID.options[document.forms[name].RegionID.length-1] = null;
	}	
	if(countryregions[countryid]){	
 		for(i=0; i<countryregions[countryid].length-1; i=i+2){ 
			x = new Option(countryregions[countryid][i],countryregions[countryid][i+1]) ;
			document.forms[name].RegionID.options[document.forms[name].RegionID.length] = x;
		}
		if(regionid != 0){
			document.forms[name].RegionID.value = regionid;
		}else{ 
			document.forms[name].RegionID.selectedIndex = 0;
		}
	}
	showResult();
}

var xmlhttp;
function showResult(){
	document.getElementById("instantResult").innerHTML='Zutreffend:&nbsp;<img src="/img/search/reload-anim.gif" width="10" heifth="10">';
  //auswahl=window.document.Setup.auswaehlen.selectedIndex;
  //inhalt=window.document.Setup.auswaehlen.options[auswahl].value;
	var fele = '?Instant=Y&';
	for(var i = 0; i < document[fname].length; i=i+1) {
		if(document.forms[fname].elements[i].type == 'checkbox' && document.forms[fname].elements[i].checked){
			fele = fele+document.forms[fname].elements[i].name+'='+document.forms[fname].elements[i].value+'&'
		}	
		if(document.forms[fname].elements[i].type != 'checkbox' && document.forms[fname].elements[i].value){
			fele = fele+document.forms[fname].elements[i].name+'='+document.forms[fname].elements[i].value+'&'
		}
    } 

	//if(str.length==0){
	//	document.getElementById("instantResult").innerHTML="";
	//	return;
	//}
	xmlhttp = GetXmlHttpObject();
	if(xmlhttp==null){
		alert ("Your browser does not support XMLHTTP!");
		return;
	}
	var url="/search/ext_search.php";
	url = url+fele;//alle felder anhängen
	//alert('url='+url);
	//var poststr = 
		//"mytextarea1=" + encodeURI( document.getElementById("mytextarea1").value ) +
        //"&mytextarea2=" + encodeURI( document.getElementById("mytextarea2").value );

	url = url+"&sid="+Math.random();
	xmlhttp.onreadystatechange = stateChanged;
	xmlhttp.open("GET",encodeURI(url),true);
	xmlhttp.send(null);
}


function GetXmlHttpObject(){
	if(window.XMLHttpRequest){
		// code for IE7+, Firefox, Chrome, Opera, Safari
		return new XMLHttpRequest();
	}
	if(window.ActiveXObject){
		// code for IE6, IE5
		return new ActiveXObject("Microsoft.XMLHTTP");
	}
	return null;
}

function stateChanged(){
	if(xmlhttp.readyState == 4){
		if(xmlhttp.responseText.length > 5){
			var response = 'Error';
		}else{
			var response = xmlhttp.responseText;
		}
		
		document.getElementById("instantResult").innerHTML = '&nbsp;Zutreffend:&nbsp;'+response+'&nbsp;';
		if(xmlhttp.responseText < 1){
			document.forms[fname].Submit.value = 'Keine zutreffenden Unterkünfte zum Anzeigen';
			document.forms[fname].Submit.disabled = true;
		}else{
			document.forms[fname].Submit.value = 'Zutreffende Feriendomizile ('+response+') anzeigen';
			document.forms[fname].Submit.disabled = false;		
		}
	}
}
// End -->
