<!-- Begin
function validator()
{
  var theForm = document.feedback
  var strName = theForm.name.value
  var strEmail = theForm.email.value
  var strSubject = theForm.subject.value
  var strComments = theForm.comments.value

  if (empty_check(strName)==false)
  {
    alert ("Please fill in your name.")
	  theForm.name.focus();
	  return false
  }
  
  if (email_check(strEmail)==false)
  {
	  theForm.email.focus();
	  return false
  }  

  if (empty_check(strSubject)==false)
  {
	  alert ("Please fill in a subject for your mail.")
	  theForm.subject.focus();
	  return false
  } 

  if (empty_check(strComments)==false)
  {
    alert ("Please send us your comments.")
	  theForm.comments.focus();
	  return false
  }

}

//----------Other Functions----------

//Name
function empty_check(sTemp)
{
  if (sTemp=="")
  {
	  return false
  }
}

//Email
function email_check (sTemp) {
  var checkTLD=1;
  var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
  var emailPat=/^(.+)@(.+)$/;
  var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
  var validChars="\[^\\s" + specialChars + "\]";
  var quotedUser="(\"[^\"]*\")";
  var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
  var atom=validChars + '+';
  var word="(" + atom + "|" + quotedUser + ")";
  var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
  var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
  var matchArray=sTemp.match(emailPat);

  if (matchArray==null) 
  {
  alert("Please check your email address.");
  return false;
  }

  var user=matchArray[1];
  var domain=matchArray[2];
  
  for (i=0; i<user.length; i++) 
  {
    if (user.charCodeAt(i)>127) 
    {
      alert("Please check your email address. The username contains invalid characters.");
      return false;
    }
  }
  
  for (i=0; i<domain.length; i++) 
  {
    if (domain.charCodeAt(i)>127) 
    {
      alert("Please check your email address. The domain name contains invalid characters.");
      return false;
    }
  }

  if (user.match(userPat)==null) 
  {
    alert("Please check your email address. The username doesn't seem to be valid.");
    return false;
  }

  var IPArray=domain.match(ipDomainPat);
  
  if (IPArray!=null) 
  {
    for (var i=1;i<=4;i++) 
    {
      if (IPArray[i]>255) 
      {
        alert("Please check your email address. Destination IP address is invalid!");
        return false;
      }
    }
    return true;
  }
 
  var atomPat=new RegExp("^" + atom + "$");
  var domArr=domain.split(".");
  var len=domArr.length;
  
  for (i=0;i<len;i++) 
  {
    if (domArr[i].search(atomPat)==-1) 
    {
      alert("Please check your email address. The domain name does not seem to be valid.");
      return false;
    }
  }

  if (checkTLD && domArr[domArr.length-1].length!=2 && 
  domArr[domArr.length-1].search(knownDomsPat)==-1) 
  {
    alert("Please check your email address. The address must end in a well-known domain or two letter " + "country.");
  return false;
  }

  if (len<2) 
  {
    alert("Please check your email address. This address is missing a hostname!");
    return false;
  }
return true;
}

//  End -->