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	
	}*/
	return false;
}
//this function was created for http://develop.spaseekers.com/xyz_remove_this.html mini search it works excellent - 6Dec2011
function selectHandler2(handler)
{
	//document.getElementById('county').disabled  = false;
	//document.getElementById('region').disabled  = false;

	if(handler == "region")
	{
		document.getElementById('county').selectedIndex = 0;
	}
	else if(handler == "county")
	{
		document.getElementById('region').selectedIndex = 0;
	}
	
}


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();
	
/* Commented to put real links 24-10-2011 */
/*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";
	} */
	
	/* Added for New links 24-10-2011 START*/
	if(sCounty == "---select-county---" && sRegion == "---select-region---"){
		
			if(f.dayspa.checked==1) 
			wLoc= loc + 'spa-days-in-uk';
				
			else if(f.overnight.checked==1)
			wLoc= loc + 'hotel-spas-in-uk/';	
		
			else
			wLoc= loc + 'spa-days-and-hotel-spas-in-uk/';
			}
	
	else if(sRegion != "---select-region---"){
	
		if(f.dayspa.checked==1)
		wLoc = loc + 'spa-days-in-' + 	sRegion + '-' + f.region.options[f.region.selectedIndex].value +'/';
		
		else if(f.overnight.checked==1)
		wLoc = loc + 'hotel-spas-in-' + 	sRegion + '-' + f.region.options[f.region.selectedIndex].value +'/';
		
		else
		wLoc = loc + 'spa-days-and-hotel-spas-in-' + 	sRegion + '-' + f.region.options[f.region.selectedIndex].value +'/';

		}
		
		else if(sCounty != "---select-county---"){
		
		if(f.dayspa.checked==1)
		wLoc = loc + 'spa-days/' + 	sCounty + '-' + f.county.options[f.county.selectedIndex].value +'/';
		
		else if(f.overnight.checked==1)
		wLoc = loc + 'hotel-spas/' + sCounty + '-' + f.county.options[f.county.selectedIndex].value +'/';
		
		else
		wLoc = loc + 'spa-days-and-hotel-spas/' +  sCounty  + '-' + f.county.options[f.county.selectedIndex].value +'/';
		}
	/* Added for New links 24-10-2011 END*/
	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;
	}
}

/* Ref:10 Copied from search/searchbox-new.php line#27-31 18-10-2011 START*/
                        $(document).ready(function() {
							$("#region:even").css("background-color", "#ffffff");
						
						})
						
/* Ref:10 Copied from search/searchbox-new.php line#27-31  18-10-2011 END*/
