function validEmail(email) {
	
	invalidChars = "/:,;"; // Not allowed in email address
	
	if (email == "") {
		return false
		// Unlikely to happen here, but might as well check again
	}
	
	for (i=0; i<invalidChars.length; i++) {
		badChar = invalidChars.charAt(i);
		if (email.indexOf(badChar,0) > -1) {
			return false
		}
	}
	
	atPos = email.indexOf("@",1);
	
	if (atPos == -1) { // No @ in the address
		return false
	}
	
	if (email.indexOf("@",atPos+1) > 1) { // Check for only 1 @
		return false
	}
	
	periodPos = email.indexOf(".",atPos);
	
	if (periodPos == -1) { // Is there a "." after the @?
		return false
	}
	
	if (periodPos+3 > email.length) { // Have at least 2 characters after the "."
		return false
	}
	
	return true
}







function validateContact(thisForm) {
	
	if (thisForm.name.value == "") {	// Blank name?
		alert("Please enter your name");
		thisForm.name.focus();
		return false
	}
	
	if (thisForm.email.value == "") {	// Blank email?
		alert("Please enter your email address");
		thisForm.email.focus();
		return false
	}

	if (!validEmail(thisForm.email.value)) {		// Email Valid?
		alert("The email address you entered is not valid");
		thisForm.email.focus();
		return false
	}

	if (thisForm.enquiry.value == "") {	// Blank message?
		alert("Please enter your enquiry");
		thisForm.enquiry.focus();
		return false
	}
	
	return true

}

