//This function verifys the various inputs of the form
function verifyForm(myform)
{
//Check for Name
 if (myform.full_name.value == "")
 {
  window.alert("Please enter your Name! ");
  myform.name.focus();
  myform.name.select();
  return false;
 }
 //Check for email
 if (!validateEmail(myform.email.value))
 {
  myform.email.focus();
  myform.email.select();
  return false;
 }
 //Check for Company
 if (!validateEmail(myform.email.value))
 {
  myform.company.focus();
  myform.company.select();
  return false;
 }
 //Check for Area Code
 if (!validateEmail(myform.email.value))
 {
  myform.area_code.focus();
  myform.area_code.select();
  return false;
 }
 //Check for Prefix
 if (!validateEmail(myform.email.value))
 {
  myform.prefix.focus();
  myform.prefix.select();
  return false;
 }
 //Check for Suffix
 if (!validateEmail(myform.email.value))
 {
  myform.suffix.focus();
  myform.suffix.select();
  return false;
 }

 else
 return true;
} 
/* End of Function */

/* Validate e-mail address */
function validateEmail(emailstr)
{
// Characters that don't belong in email
invalidChars = " /:,; ";

// Check for email string
 if (emailstr == "" )
 {
  window.alert("Please enter your E-mail Address");
  return false;
 } 
 //Check for something before the @ sign
 if (emailstr.indexOf("@", 0) == 0)
 {
  window.alert ("No username in E-mail Address!");
  return false;
 }
 //Check for the @ sign
 if (emailstr.indexOf("@", 1) == -1)
 {
  window.alert("No @ sign in Email Address1");
  return false;
 } 
 //Check for period in email
 if (emailstr.indexOf(".", 0) == -1)
 {
  window.alert ("No period in E-mail Address!");
  return false;
 }
 //Check for invalid charecters
 for (i=0; i<invalidChars.length; i++)
 {
  if (emailstr.indexOf(invalidChars.charAt(i), 0) > -1)
  {
   window.alert ("Bad character(s) in Email Address!", invalidChars.charAt(i), i);
   return false;
  }
 }
 //Email looks good!
 return true;
//End of Function
}
    

