function checkForm(theForm){
	if (theForm.firstfield.value == ""){
		alert("You must enter a first name")
		theForm.firstfield.focus()
		theForm.firstfield.select()
		return false
	}
	if (theForm.last_name.value == ""){
		alert("You must enter a surname")
		theForm.last_name.focus()
		theForm.last_name.select()
		return false
	}
	var enq = theForm.enquiry.value
	if (enq == ""){
		alert("You must enter an enquiry")
		theForm.enquiry.focus()
		theForm.enquiry.select()
		return false
	}
	var em = theForm.email.value
	if (em == ""){
		alert("You must enter an email address")
		theForm.email.focus()
		theForm.email.select()
		return false
	} else {
		re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
		if ( re.test(theForm.email.value)) {
			return true
		} else {
			alert("Invalid email address")
			theForm.email.focus()
			theForm.email.select()
			return false
		}
	}
	return true		
	
}
function consentGiven() {	
	// if we have been given consent to contact the user
	if (document.getElementById('consent').checked == '1') {
		document.getElementById('consentText').value = "Yes";
	}
	// otherwise we don't have consent
	else {
		document.getElementById('consentText').value = "No";
	}
}