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

//check email
function checkEmail (strng) {
	var error = "";
	var emailFilter=/^[^@]+@[^@.]+\.[^@]*\w\w$/;
	if (!(emailFilter.test(strng))) {
		   error = "Please enter a valid email address.\n";
	}
	var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]]/
	if (strng.match(illegalChars)) {
	   error = "Invalid characters in the email address.\n";
	}
	return error;
}