function checkBeds () {

	//get selected value
	numBeds = document.form.minBeds.value;

	//if any then set numBeds to 1 to show all
	if (numBeds == 0) {
		numBeds = 1;
	} 

	//clear current beds checkboxes
	document.form.bed1.checked = false;
	document.form.bed2.checked = false;
	document.form.bed3.checked = false;
	document.form.bed4.checked = false;
	document.form.bed5.checked = false;
	//}

	//set new beds checkboxes
	for (var i = 6; i > numBeds ; i--) {
		eval("document.form.bed" + (i-1) + ".checked = true;");
	}
}

function checkForm() {
	//Check price correct
	minPrice = document.form.min.value;
	maxPrice = document.form.max.value;

	minPrice = (minPrice/10000);
	maxPrice =(maxPrice/10000);
	if (minPrice > maxPrice) {
		alert ("You minimum price cannot be greater than the maximum");
		document.form.min.focus();
		return false;
	} 
}

function submitForm () {
	checkForm();
	document.form.submit();
}

function submitValuation () {
	document.form.submit();
}
