// JavaScript Document

function isEmailAddr(t2)
{
  var result = false
  var theStr = new String(t2)
  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.t2.value == "")
  {
    alert("Please enter your e-mail address in the \"email\" field.");
    theForm.t2.focus();
    return (false);
  }

  if (!isEmailAddr(theForm.t2.value))
  {
    alert("Please enter a complete email address in the form: yourname@yourdomain.com");
    theForm.t2.focus();
    return (false);
  }
   
  if (theForm.t2.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"email\" field.");
    theForm.t2.focus();
    return (false);
  }
  return (true);
}