function selectHandler() {
	
	if (document.spasearchform.county.value=="general") {
		document.spasearchform.region.disabled=0	
	} else {
		document.spasearchform.region.disabled=1	
	}
	if (document.spasearchform.region.value=="general") {
		document.spasearchform.county.disabled=0	
	} else {
		document.spasearchform.county.disabled=1	
	}
}

function valForm(loc){
	
	f = document.getElementById('spasearchform');
	var sRegion = f.region.options[f.region.selectedIndex].innerHTML.replace(/ /g,"-");
	var sCounty = f.county.options[f.county.selectedIndex].innerHTML.replace(/ /g,"-");
	sRegion = sRegion.toLowerCase();
	sCounty = sCounty.toLowerCase();
	
	if(sCounty == "find-a-spa-by-county"){
		if(sRegion == "find-a-spa-by-region"){
			sRegion = "all-region";	
		}
		wLoc = loc + "spa-by-region/" + sRegion + "/" + f.region.value;
	}else{
		wLoc = loc + "spa-by-county/" + sCounty + "/" + f.county.value;
	}
	
	if(f.overnight.checked==1) {
		wLoc = wLoc + "/" + "only-overnight";
	} else {
		wLoc = wLoc + "/" + "not-only-overnight";
	}
	
	if(f.dayspa.checked==1) {
		wLoc = wLoc + "/" + "only-dayspas";
	} else {
		wLoc = wLoc + "/" + "not-only-dayspas";
	}
	
	window.location.href=wLoc;
}

function valKeywordForm(loc){
	if(z.getSelectedValue() != null){
		var sStr = z.getSelectedValue().replace(/ /g,"_");
	}else{
		var sStr = z.getComboText();
	}
	wLoc = loc + "keyword-search/" + sStr;
	window.location=""+wLoc;
}

var mSearchType = "locale";

function showFreeTextSearch(){
	document.getElementById("divLocaleSearchType").style.display = "none";
	document.getElementById("divKeywordSearch").style.display = "block";
	mSearchType = "freetext";
}

function showLocaleSearch(){
	document.getElementById("divLocaleSearchType").style.display = "block";
	document.getElementById("divKeywordSearch").style.display = "none";
	mSearchType = "locale";
}

function executeSearch(loc){
	switch(mSearchType){
		case "locale":
			valForm(loc);
			break;
		
		case "freetext":
			valKeywordForm(loc + '/keyword-search/');
			break;
	}
}