<!--

	function checkEmail(s, required)
  {
    var i = 1;
    var sLength = s.length;
    //if it's not required and it's blank, then it's ok
    if(!required && sLength == 0)
      return true;
    else
    {
      //look for @
      while((i < sLength) && (s.charAt(i) != "@"))
        i++;
      if((i >= sLength) || (s.charAt(i) != "@"))
        return false;
      else
        i += 2;
      //look for .
      while((i < sLength) && (s.charAt(i) != "."))
        i++
      //there must be at least one character after the .
      if((i >= sLength - 1) || (s.charAt(i) != "."))
        return false;
      else
        return true;
    }
  }


//-->