/**

This JS is a validation function for the archive search form. It makes sure that at least one audience has been selected and that the dates are in the correct format.

The latter functionality isn't really needed anymore since we moved to a popup calendar based approach.

 */
  function validateArchiveSearchForm()
  {
    var debugMe = 0;

    var audience1 = document.getElementById("audience_student_ID").checked;
    var audience2 = document.getElementById("audience_faculty_ID").checked;
    var audience3 = document.getElementById("audience_staff_ID").checked;
    //var audience4 = document.getElementById("audience_other_community_ID").checked;
    var audience4 = 0;
    if (debugMe > 1)
    {
      alert("audience1 == "+audience1);
      alert("audience2 == "+audience2);
      alert("audience3 == "+audience3);
      alert("audience4 == "+audience4);
      alert("combo == "+(! ((audience1) || (audience2) || (audience3) || (audience4))));
    }
    if (! ((audience1) || (audience2) || (audience3) || (audience4)))
    {
      alert("You must choose at least one audience or else you'll get no results");
      document.getElementById("audience_student_ID").focus();
      return false;
    }

    /* *****************************************************
     * not needed as of 2006/06/30
    var beginDate_elt = document.getElementById("begin_date_ID");
    var beginDate = beginDate_elt.value;
    if ((beginDate != "") && (! (beginDate.match(/^\d\d\d\d\/\d\d\/\d\d$/))))
    {
      alert("If you enter an begin date it must be in the format YYYY/MM/DD");
      beginDate_elt.focus();
      return false;
    }

    var endDate_elt = document.getElementById("end_date_ID");
    var endDate = endDate_elt.value;
    if ((endDate != "") && (! (endDate.match(/^\d\d\d\d\/\d\d\/\d\d$/))))
    {
      alert("If you enter an end date it must be in the format YYYY/MM/DD");
      endDate_elt.focus();
      return false;
    }
     * *****************************************************
     */

    return true;
  }

