<!--
  function validateForm(f,fields)
  {
    var no_errors = true;
    var error_msg = "---------------------------------------------------\n";
       error_msg += "               FORM SUBMISSION ERROR                \n";
       error_msg += "---------------------------------------------------\n\n";
       error_msg += "Please correct the following fields and resubmit\n";
       error_msg += "the form:\n\n";
    
    for (i=0; i<f.length; i++)
    {
      var cur = f[i];
      var valid = true;

      if (fields[cur.name])
      {
        if (cur.type.indexOf("select") >= 0) valid = validateSelect(f,cur);
        else if (cur.type.indexOf("check") >= 0) valid = validateCheckbox(cur)
        else if (cur.type.indexOf("text") >= 0 || cur.type.indexOf("hidden") >= 0) valid = validateText(cur);
      }

      if (!valid)
      {
        no_errors = false;
        error_msg += "\t" + fields[cur.name] + "\n";
      }

    }

    if (!no_errors) alert(error_msg);
    else f.submit();
  }

  function validateText(obj)
  {
    var result = false;

    if (obj.value != "") result = true;
    return result;
  }

  function validateSelect(f,obj)
  {
    var result = true;
    var stmt = "f."+obj.name+"[f."+obj.name+".selectedIndex].value";    
    if (eval(stmt) == "") result = false;
    return result;
  }
  
  function validateCheckbox(obj)
  {
    var result = false;
    
    if (obj.checked) result = true;
    return result;
  }
//-->