  function isblank(s)
  {
      for(var i = 0; i < s.length; i++) {
          var c = s.charAt(i);
          if ((c != ' ') && (c != '\n') && (c != '\t')) return false;
      }
      return true;
  }

  function checkemail(str){
    var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
    if (filter.test(str)) {return true} else {return false}
  }
  
  function Validate_Form(f)
  {
      var msg="";
      var empty_fields = "";
      var errors = "";

      msg += "Form Incomplete\n";
      msg += "__________________\n\n"
  
      if (isblank(f.realname.value)) {
        msg += " - Your name is required\n";
        errors = "Y";
      }
      if (isblank(f.email.value)) {
        msg += " - Please enter a valid email address to leave us your comments\n";
        errors = "Y";
      }
      if (f.email.value != '')   {
        if (!checkemail(f.email.value))   {
          msg += " - Please enter a valid email address to leave us your comments\n";
          errors = "Y";
        }
      }

      if (!errors) return true;
  
      alert(msg);
  
      return false;
  }
  