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 contact(theForm)
{
  if (theForm.name.value == "")
  	{
	document.getElementById("flagarea").innerHTML="<p class=warning>Please type your name.</p>";
    theForm.name.focus();
    return (false);
    }
    
  if (theForm.email.value == "")
  	{
	document.getElementById("flagarea").innerHTML="<p class=warning>Please type your email address.</p>";
    theForm.email.focus();
    return (false);
    }

  if (!isEmailAddr(theForm.email.value))
  	{
	document.getElementById("flagarea").innerHTML="<p class=warning>Sorry, the email address you entered is invalid.</p>";
    theForm.email.focus();
    return (false);
    }

  if (theForm.comments.value == "")
  	{
	document.getElementById("flagarea").innerHTML="<p class=warning>Please type your message.</p>";
    theForm.comments.focus();
    return (false);
    }
    
  if (theForm.axs.value == "")
  	{
	document.getElementById("flagarea").innerHTML="<p class=warning>Please type the access code.</p>";
    theForm.axs.focus();
    return (false);
    }

return (true);
}