

 function validate_form(form, mandatory_fields) {


  missing = []
  for (i=0;i<mandatory_fields.length;i++) {
    if ( mandatory_fields[i].field.value ) {
        }
        else {
         missing[missing.length] = mandatory_fields[i].label
        }
  }

  if ( missing.length > 0 ) {
    missing_fields = ""
    for (i=0;i<missing.length;i++) {
          missing_fields = missing_fields + "    " + missing[i] + "\n"
        }

    alert(
              "______________________________________________________________\n\n" +
              "The form was not submitted because of the following error(s).\n" +
                  "Please correct these error(s) and re-submit.\n" +
              "______________________________________________________________\n\n" +
                  " - The following required field(s) are empty:\n" +
                  missing_fields
                  )
        return false
  }

   return true;

 }
