function isEmailAddr(email)
{
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0)
  {

    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}

function FormValidator(theForm)
{

if (theForm.fName.value == "")
  {
    alert("Please enter your Name.");
    theForm.fName.focus();
    return (false);
  }
  
  if (theForm.fCompany.value == "")
  {
    alert("Please enter your Company.");
    theForm.fCompany.focus();
    return (false);
  }
  
  if (theForm.fPhone.value == "")
  {
    alert("Please enter your Phone.");
    theForm.fPhone.focus();
    return (false);
  }

  if (theForm.fEmail.value == "")
  {
    alert("Please enter your complete email address in the form: yourname@yourdomain.com.");
    theForm.fEmail.focus();
    return (false);
  }

  if (!isEmailAddr(theForm.fEmail.value))
  {
    alert("Please enter your complete email address in the form: yourname@yourdomain.com.");
    theForm.fEmail.focus();
    return (false);
  }

  if (theForm.fEmail.value.length < 3)
  {
    alert("Please enter your complete email address in the form: yourname@yourdomain.com.");
    theForm.fEmail.focus();
    return (false);
  }
  return (true);
}

function FormValidator2(theForm)
{

  if (theForm.fEmail.value == "")
  {
    alert("Please enter your complete email address in the form: yourname@yourdomain.com.");
    theForm.fEmail.focus();
    return (false);
  }

  if (!isEmailAddr(theForm.fEmail.value))
  {
    alert("Please enter your complete email address in the form: yourname@yourdomain.com.");
    theForm.fEmail.focus();
    return (false);
  }

  if (theForm.fEmail.value.length < 3)
  {
    alert("Please enter your complete email address in the form: yourname@yourdomain.com.");
    theForm.fEmail.focus();
    return (false);
  }
  return (true);
}