
<!-- Begin
// name 
function checkSendername (strng) {
var error = "";
if (strng == "" || strng == "Your name") {
   error = "Please enter your name.\n";
}
return error;
}       

function checkRecipientEmail (strng) {
var error="";
if (strng == "") {
   error = "Please enter the recipient's email address.\n";
}

    var emailFilter=/^.+@.+\..{2,3}$/;
    if (!(emailFilter.test(strng))) { 
       error = "The recipient's email is incomplete.\n";
    }
    else {
//test email for illegal characters
       var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
         if (strng.match(illegalChars)) {
          error = "The recipient's email address contains illegal characters.\n";
       }
    }
return error;    
}

function checkEmail (strng) {
var error="";
if (strng == "") {
   error = "You didn't enter your email address.\n";
}
    var emailFilter=/^.+@.+\..{2,3}$/;
    if (!(emailFilter.test(strng))) { 
       error = "Your email address is incomplete.\n";
    }
    else {
//test email for illegal characters
       var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
         if (strng.match(illegalChars)) {
          error = "Your email address contains illegal characters.\n";
       }
    }
return error;    
}

function checkRegForm(theForm) {
    var why = "";
    why += checkRecipientEmail(theForm.to.value);
    why += checkEmail(theForm.from.value);
    why += checkSendername(theForm.name.value);    
   if(why){
          alert(why);
      return false;
   } else {
   return true; 
   }
   
}
//  End -->

