function checkForm(theForm) {

	tmpSel = theForm.elements['title'];
	if (tmpSel.options[tmpSel.selectedIndex].value == 'Select...') {
		alert('Please select your title');
       		theForm.elements['title'].focus();
		return false;
	}

	if (theForm.elements['firstname'].value == '') {
		alert('Please enter your First name.');
		theForm.elements['firstname'].focus();
		return false;
	}
	if (theForm.elements['surname'].value == '') {
		alert('Please enter your Surname.');
		theForm.elements['surname'].focus();
		return false;
	}

	if (theForm.elements['email'].value == '') {
		alert('You must enter an Email address.');
		theForm.elements['email'].focus();
		return false;
	}
	if (theForm.elements['email'].value != '') {
		if (theForm.elements['email'].value.indexOf("@")==-1 || theForm.elements['email'].value.indexOf(".")==-1 || theForm.elements['email'].value.indexOf(" ")!=-1 || theForm.elements['email'].value.length<6) {
		alert("Please enter a valid email address.");
		theForm.elements['email'].focus();
		return false
		}
	}
	
	if (theForm.elements['contactnumber'].value == '') {
		alert('Please enter your contact number.');
		theForm.elements['contactnumber'].focus();
		return false;
	}

	tmpSel = theForm.elements['timetocall'];
	if (tmpSel.options[tmpSel.selectedIndex].value == 'Select...') {
		alert('Please select your preferred time we can call you');
       		theForm.elements['timetocall'].focus();
		return false;
	}

	if (theForm.elements['address'].value == '') {
		alert('Please enter your current address.');
		theForm.elements['address'].focus();
		return false;
	}

	tmpSel = theForm.elements['sellorlet'];
	if (tmpSel.options[tmpSel.selectedIndex].value == 'Select...') {
		alert('Please select whether you are selling or letting');
       		theForm.elements['sellorlet'].focus();
		return false;
	}
	tmpSel = theForm.elements['status'];
	if (tmpSel.options[tmpSel.selectedIndex].value == 'Select...') {
		alert('Please select your your current status');
       		theForm.elements['status'].focus();
		return false;
	}
	tmpSel = theForm.elements['movingtimescale'];
	if (tmpSel.options[tmpSel.selectedIndex].value == 'Select...') {
		alert('Please select when you wish to move');
       		theForm.elements['movingtimescale'].focus();
		return false;
	}
	tmpSel = theForm.elements['reasonforvaluation'];
	if (tmpSel.options[tmpSel.selectedIndex].value == 'Select...') {
		alert('Please select your reason for a valuation');
       		theForm.elements['reasonforvaluation'].focus();
		return false;
	}

	if (theForm.elements['appraisaladdress'].value == '') {
		alert('Please enter your appraisal address.');
		theForm.elements['appraisaladdress'].focus();
		return false;
	}

	tmpSel = theForm.elements['bedrooms'];
	if (tmpSel.options[tmpSel.selectedIndex].value == 'Select...') {
		alert('Please select number of bedrooms');
       		theForm.elements['bedrooms'].focus();
		return false;
	}
	tmpSel = theForm.elements['bathrooms'];
	if (tmpSel.options[tmpSel.selectedIndex].value == 'Select...') {
		alert('Please select number of bathrooms');
       		theForm.elements['bathrooms'].focus();
		return false;
	}
	tmpSel = theForm.elements['receptionrooms'];
	if (tmpSel.options[tmpSel.selectedIndex].value == 'Select...') {
		alert('Please select number of reception rooms');
       		theForm.elements['receptionrooms'].focus();
		return false;
	}


	if ((theForm.elements['proptypedetached'].checked == false) && (theForm.elements['proptypesemidetached'].checked == false) && (theForm.elements['proptypeterraced'].checked == false) && (theForm.elements['proptypebungalow'].checked == false) && (theForm.elements['proptypeflat'].checked == false) && (theForm.elements['proptypeother'].checked == false)) {
		alert('Please tick at least one property type');
		theForm.elements['proptypedetached'].focus();
		return false;
	}

theForm.submit();
}

