function ValidateEmailField(field)
{
  // usage, ex:
  // if(ValidateEmailField(document.login.email) == false) return false;

  if(field.value=="")
  {
    alert("You must enter an e-mail address.");
    return false;
  }

  // test that e-mail value has format "<user>@<domain>.<ext>"
  at_idx = field.value.indexOf("@");
  dot_idx = field.value.indexOf(".",at_idx);

  if(at_idx < 1 || dot_idx < at_idx)
  {
	alert("You must enter a valid e-mail address.");
	return false;
  }

  return true;
}
