function VF(f, msg){
        if (f.value == ""){
                alert(msg);
                f.focus();
                return (false);
        }
        return(true);
}

function validEmail(mail) {
	invalidChars = " /:,;~`!#$%^&*()-+={}[]|><?"
	
	if (mail == "") {
	return (false);
	}
	
	for (i=0; i<invalidChars.length; i++) {
		badChar = invalidChars.charAt(i)
		if (mail.indexOf(badChar,0) > -1) {
			return false;
		}
	}
	atPos = mail.indexOf("@",1)
	if (atPos == -1) {
	return (false);
	}
	if (mail.indexOf("@",atPos+1) != -1) {
	return (false);
	}
	periodPos = mail.indexOf(".",atPos+2)
	if (periodPos == -1) {
	return (false);
	}
	if (periodPos+3 > mail.length)	{
	return (false);
	}
	return (true);
}

function FormValidator(theForm2){
		if (!VF(theForm2.Name, "Please enter your name.")) {return(false);}
		if (!VF(theForm2.Organization, "Please enter your organization.")) {return(false);}
		if (!VF(theForm2.Address, "Please enter your street address.")) {return(false);}
		if (!VF(theForm2.Town, "Please enter your town.")) {return(false);}
		if (!VF(theForm2.Zip, "Please enter your zip code.")) {return(false);}
		if (!VF(theForm2.Phone, "Please enter your phone number.")) {return(false);}
		if (!VF(theForm2.Email, "Please enter your \"Email\".")) {return (false);}
		if (!validEmail(theForm2.Email.value)) {
			alert("Invalid email Address");
			theForm2.Email.focus();
			theForm2.Email.select();
			return (false);
		}
		if (!VF(theForm2.Comments, "Please enter your comments.")) {return(false);}		
		
}
