function CheckForm(theForm, theTextField) {
numOfChecks = 0
var sTextField = eval("document." + theForm.name + "." + theTextField)
 
 if (sTextField.value == "") {
    alert("Please enter your email address.")
    return false
 }

var HasAtSym = false;
var HasDot = false;
var CurrChar = ""
EmailString = sTextField.value;

for (i = 0; i < EmailString.length; i++) {
    CurrChar = EmailString.charAt(i);
	
             if (CurrChar == " ") {
                         alert("Spaces are not allowed in Email addresses")
						 return false
			 } else if ( CurrChar == "," || CurrChar == "!" || CurrChar == "£" || CurrChar == "$") {
                         alert("There are invalid characters in the email address") 
						 return false
			 } else if ( CurrChar == "@") {
                         HasAtSym = true
             } else if ( CurrChar == "." && EmailString.charAt(i+1) != "" ) {
                         HasDot = true
             }
}
if (HasAtSym == false) { 
   alert("There is no '@' symbol in the email address you specified")
   return false
}

if (HasDot == false) {
   alert("That is an invalid email address")
   return false
}
return true
}
