function checkForm() {

        this.msgsep     = '\n';
        this.blank      = '';
        this.problem    = new Array();
        this.display    = new Array();

        this.addMssg    = _checkForm_addMssg;
        this.showAlrt   = _checkForm_showAlrt;
        this.ckValue    = _checkForm_ckValue;

return this;  }

function _checkForm_addMssg (field, msg) {
	if (field.value || field.focus) field.focus();
		this.problem[this.problem.length] = msg;
}

function _checkForm_showAlrt (head, foot) {

    if (this.problem.length) {
      err = head ? head + this.msgsep : '';
      err += this.problem.join(this.msgsep);
      err += foot ? this.msgsep + foot : '';
      alert(err);
     return false;
    }
    return true;
}

function _checkForm_ckValue (field) {
  if ( ! field.type && field.length ) {
    for (var x = 0; x < field.length; x++)
      if (field[x].type && this.ckValue(field[x]))
        return true;
    return false;
  }
  if (/select/.test(field.type))
    return (field.selectedIndex != -1 &&
(field.options[field.selectedIndex].value != this.blank));
  if (/(checkbox|radio)/.test(field.type))
    return ( field.checked && (field.value != this.blank) );
  if (/(button|reset|submit)/.test(field.type))
    return false;
  return (field.value != this.blank)
}


function checkIt (form) {

  var v = new checkForm();
  if ( ! v.ckValue(form.Agreement_3days_prior_to_event) )  v.addMssg(form.Agreement_3days_prior_to_event,      "»  Three Day Agreement", 0);
  if ( ! v.ckValue(form.Date_of_Activity) )  v.addMssg(form.Date_of_Activity,      "»  Date of Activity", 1);
  if ( ! v.ckValue(form.Location) )  v.addMssg(form.Location,      "»  Location", 2);
  if ( ! v.ckValue(form.ActivityType) )  v.addMssg(form.ActivityType,      "»  Type of Activity", 3);
  if ( ! v.ckValue(form.One_Sponsoring_Organization) )  v.addMssg(form.One_Sponsoring_Organization,      "»  Sponsoring Organization", 4);
  if ( ! v.ckValue(form.Contact_Person) )  v.addMssg(form.Contact_Person,      "»  Contact Person", 5);
  if ( ! v.ckValue(form.Preferred_Phone_Number) )  v.addMssg(form.Preferred_Phone_Number,      "»  Preferred Phone Number", 6);
  if ( ! v.ckValue(form.Email) )  v.addMssg(form.Email,      "»  Email", 7);
  if ( ! v.ckValue(form.Time_of_Activity_From) )  v.addMssg(form.Time_of_Activity_From,      "»  Start Time of Activity", 8);
  if ( ! v.ckValue(form.Time_of_Activity_To) )  v.addMssg(form.Time_of_Activity_To,      "»  End Time of Activity", 9);
  if ( ! v.ckValue(form.Amplification) )  v.addMssg(form.Amplification,      "»  Amplified Music", 10);
  if ( ! v.ckValue(form.Attendance_Expected) )  v.addMssg(form.Attendance_Expected,      "»  Attendance Expected", 11);
  if ( ! v.ckValue(form.Mercer_Police_Hired) )  v.addMssg(form.Mercer_Police_Hired,      "»  Mercer Police", 12);
  if ( ! v.ckValue(form.Alcohol_Served) )  v.addMssg(form.Alcohol_Served,      "»  Alcohol Served", 13);
  if ( ! v.ckValue(form.Transportation) )  v.addMssg(form.Transportation,      "»  Transportation", 14);
  if ( ! v.ckValue(form.Activity_Monitor) )  v.addMssg(form.Activity_Monitor,      "»  Activity Monitor", 15);
  if ( ! v.ckValue(form.Activity_Agreement) )  v.addMssg(form.Activity_Agreement,      "»  Activity Agreement", 16);
  if ( ! v.ckValue(form.Advisor_Name) )  v.addMssg(form.Advisor_Name,      "»  Advisor Name", 17);
  if ( ! v.ckValue(form.Advisor_Email) )  v.addMssg(form.Advisor_Email,      "»  Advisor Email", 18);
  if ( ! v.ckValue(form.President_Name) )  v.addMssg(form.President_Name,      "»  President Name", 19);
  if ( ! v.ckValue(form.President_Email) )  v.addMssg(form.President_Email,      "»  President Email", 20);
 
  
  return v.showAlrt('Please Complete The Following\nFields In The Form:\n',
    '\nTo Return To The Form,\nPress "OK"');
}
