  // Function to validate form information
  function CheckForm()
  {
    var f = window.document.forms[0];			// shortcut names for form
    var fn = f.fullname.value;			        //   and names on form
    var fe = f.email.value; 
    var ftxt = f.message.value;			

    if (IsBlank(fn))
    {
      alert("You must enter your name.");
      return false;
    }

    if (IsBlank(fe))
    {
      alert("You must enter your email address.");
      return false;
    }

    // check for @ sign in email address
    if(fe.search("@") == -1)
    {
      alert("Your email address is invalid.");
      return false;
    }

    if (IsBlank(ftxt))  
    {
      alert("No prayer request is given.");
      return false;
    }

    return true;		// submit form
 }


  // Function to check for whether string is blank or not
  function IsBlank(txt)
  {
    var ch="";
    
    // check for null or empty string
    if ((txt==null) || (txt==""))
      return true;
    
    // check for white space
    for (i = 0; i < txt.length; i++)
    {
      ch = txt.charAt(i);
      if((ch != ' ') && (ch != '\n') && (ch != '\t'))
        return false;					// found white space character
     }

     return true;					// all tests passed
  }