


function checkContactForm() {
	
	var errors = "";
	var form1 = document.getElementById("contact_form");
	
	var name1 = document.getElementById("first_name");
	var name2 = document.getElementById("second_name");
	var email = document.getElementById("email");
	var telephone = document.getElementById("telephone");
	var contact = document.contact_form.contact;
	
	if (name1 != null){
		if (name1.value == "") {
			errors += "\tYou have not supplied your First Name.\n"
		}
	}
	
	if (name2 != null){
		if (name2.value == "") {
			errors += "\tYou have not supplied your Second Name.\n"
		}
	}
	
	if (contact != null) {
	if (contact[0].checked) {
			if (email != null){
			if (email.value == "") {
				errors += "\tYou requested to be contacted by email but haven't supplied an email address.\n"
			}
	}
	} else if (contact[1].checked) {
	
		if (telephone != null){
			if (telephone.value == "") {
				errors += "\tYou requested to be contacted by telephone but haven't supplied a telephone number.\n"
			}
	}
	}
	}
	
	if (errors == "") {
			return true;
	} else {
		alert("This form can not be submitted due to the following errors:\n\n" + errors + "\nPlease rectify the above errors before re-submitting");
	return false;
	}

}