  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 Validate_Form(f)
  {
      var msg="";
      var empty_fields = "";
      var errors = "";

      msg += "Form Incomplete\n";
      msg += "__________________\n\n";
  
      if (isblank(f.elements['00Title'].value)) {
        msg += " - Your title is required\n";
        errors = "Y";
        
      }
      if (isblank(f.elements['01realname'].value)) {
        msg += " - Your name is required\n";
        errors = "Y";
      }
      if (isblank(f.elements['02Position'].value)) {
        msg += " - Your position is required\n";
        errors = "Y";
      }
      if (isblank(f.elements['03Organisation'].value)) {
        msg += " - Your organisation is required\n";
        errors = "Y";
      }
      if (isblank(f.elements['04worktel'].value)) {
        msg += " - Your work telephone number is required\n";
        errors = "Y";
      }
      if (isblank(f.elements['06email'].value)) {
        msg += " - Your email address is required\n";
        errors = "Y";
      }
      // this is an array of checkboxes - need to check them all for an entry
      var entries = 0;
      for(var i = 0; i < f.elements['10nature[]'].length; i++) {
          if (f.elements['10nature[]'][i].checked) entries += 1;
      }
      if (entries == 0) {
        msg += " - Please tell us the nature of your enquiry\n";
        errors = "Y";
      }
      if (isblank(f.elements['20jobposition'].value)) {
        msg += " - Please tell us about the candidate you need\n";
        errors = "Y";
      }
  
      if (!errors) return true;
  
      alert(msg);
  
      return false;
  }
  