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 sub(theForm)
{
  if (theForm.email.value == "")
  	{alert("Sorry, you must enter an email address before unsubscribing!");
    theForm.email.focus();
    return (false);}

  if (!isEmailAddr(theForm.email.value))
  { alert("Sorry, the email address you entered is invalid!\n\ne.g.:     yourname@yourdomain.com");
    theForm.email.focus();
    return (false);}

  return (true);
}
