// email

function checkEmail (strng) {
var error="";
if (strng == "") {
	error = "Please enter an email address.\n";
}

	var emailFilter=/^.+@.+\..{2,4}$/;
	if (!(emailFilter.test(strng))) { 
		error = "Please enter a valid email address.\n";
	}
	else {
//test email for illegal characters
		var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
			if (strng.match(illegalChars)) {
			error = "The email address contains illegal characters.\n";
		}
	}
return error;	
}


function checkWholeForm(cheese) {
	var what = "";
	what += checkEmail(cheese.email.value);
	if (what != "") {
	   alert(what);
	   return false;
	}
return true;
}
