//add form functionality to the jquery object
$.fn.extend({
  //returns an array of all the checked values for checkboxes with the search areay
  get_checked_values: function() {
    return $.map(this.find(":checked"), function(checkbox) {return $(checkbox).val();});
  },

  //sets up a checkbox as an 'check all' checkbox for those specified by expr
  checkbox_for_all: function(expr) {
    this.change(function() {
      $(expr).attr('checked', this.checked);
    });
    return this;
  }

});