function toggle_filter(field) { check_box = $('cb_' + field); to_toggle = check_box.up().siblings(); if (check_box.checked) to_toggle.invoke('show'); else to_toggle.invoke('hide'); } function toggle_multi_select(field) { select = $('values_' + field); if (select.multiple === true) { select.multiple = false; } else { select.multiple = true; } } function operator_changed(field, select) { option_tag = select.options[select.selectedIndex] arity = option_tag.getAttribute("data-arity"); change_argument_visibility(field, arity) } function change_argument_visibility(field, arg_nr) { arg1 = $(field + '_arg_1') arg2 = $(field + '_arg_2') if (arg1 != null) if(arg_nr == 0) arg1.hide(); else arg1.show(); if (arg2 != null) if(arg_nr >= 2 || arg_nr <= -2) arg2.show(); else arg2.hide(); } function show_filter(field) { if ((field_el = $('tr_' + field)) != null) { field_el.show(); check_box = $('cb_' + field); check_box.checked = true; toggle_filter(field); operator_changed(field, $("operators_" + field)) display_category(field_el) } } function display_category(tr_field) { if ((label = $(tr_field.getAttribute("data-label"))) != null) label.show(); } function disable_select_option(select, field) { for (i=0; i