function isEmailAddr(sEmail)
{
  var result = false
  var theStr = new String(sEmail)
  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.email.value == "")
  {
    alert("Please enter your email address.");
    theForm.email.focus();
    return (false);
  }

  if (!isEmailAddr(theForm.email.value))
  {
    alert("Please enter a valid email address.");
    theForm.email.focus();
    return (false);
  }  
  if (theForm.email.value.length < 3)
  {
    alert("Please enter a valid email address.");
    theForm.email.focus();
    return (false);
  }
  if (theForm.password.value == "")
  {
    alert("Please type your password");
    theForm.password.focus();
    return (false);
  }
  return (true);
}