/*
	the below function was written by brent knop, 03.03.04
	to replace the original [ commented out ] email validator
	the original allowed multiple '@' signs, which were breaking 
	server-side validation in the CGI processor -- 
	the new function uses a regular expression to check the string, and allows
	multiple '.'s, but only a single '@'

	Also, only allows one submission of the form
*/

var clicks = 0;
function validate_email(f) {
	var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
	if(!re.test(f.email.value)) {
		alert("Please enter a valid email address.\n");
		f.email.focus();
		clicks = 0;
		return false;
	} 
	if(clicks != 0) {
		alert("Form has been submitted.\n");
		return false;
	}
	clicks++;
	return true;
}
