function custom_reloadSearch2() {
	type = document.advancedsearch.listingtype.value.split("|");
	if(type[1]=='Holiday') {
        go_to = "holiday_accommodation_search.php";
        if (type[0] == '2010') {
            go_to += "?accom=2010";
        }
		window.location = go_to;
	} else if(type[0]=='To Let' && type[1]=='Residential')
		window.location = "residential_long_term_letting.php";
	else if (type[1] == "Commercial"){ 
		window.location = "search.php?listingstatus=" + type[0] + "&listingtype=" + type[1] + '&user_selection=true';
    }
}



function quickSearch() {
	
	type = document.quicksearch.listingstatus.value.split("|");
	price = document.quicksearch.pricerange.value.split("|");
	
	if (type[1]=='Holiday') {
		
		url = "holiday_accommodation_results.php?";
		if (type[0] == '2010') {
			url += "accom=2010&";
		}
		if (price[0]>0) url += "pricefrom=" + price[0]; else url += "pricefrom=" + 0;
		if (price[1]>0) url += "&priceto=" + price[1]; else url += "&priceto=" + 99990000000;
		window.location = url;
	} else {
		document.quicksearch.submit();
	}
}

function validate_accommodation_enq() {
	
	var sendto = document.contact.sendto.value;
	
	if (document.contact.name.value=='') {
		alert("Please fill in your name.");
	} else if (document.contact.number.value=='') {
		alert("Please fill in a Contact Number.");
	} else if (document.contact.email.value=='') {
		alert("Please fill in your email address.");
	} else if ((document.contact.email.value.search("@")==-1) || (document.contact.email.value.search("[.*]")==-1)) {
        alert("Please make sure that you fill in the email field correctly.");
	} else if (document.contact.id.value=='') {	
		alert("Please fill in your ID / Passport Number. Ths is required to complete all bookings.");
	} else {
		document.contact.action = "holiday_accommodation_send-contact-me.php?sendto=" + sendto;
		document.contact.submit();
	}
}