bgneal@312: function messages_master_click() bgneal@312: { bgneal@312: var state = document.getElementById('master_select').checked bgneal@312: for (i = 0; i < document.messages_box_form.length; ++i) bgneal@312: { bgneal@312: if (document.messages_box_form.elements[i].type == 'checkbox') bgneal@312: { bgneal@312: document.messages_box_form.elements[i].checked = state; bgneal@312: } bgneal@312: } bgneal@312: } bgneal@312: bgneal@312: function messages_set_master() bgneal@312: { bgneal@312: var count = 0; bgneal@312: var numChkBoxes = 0; bgneal@312: for (i = 0; i < document.messages_box_form.length; ++i) bgneal@312: { bgneal@312: if (document.messages_box_form.elements[i].type == 'checkbox' && bgneal@312: document.messages_box_form.elements[i].id != 'master_select') bgneal@312: { bgneal@312: ++numChkBoxes; bgneal@312: if (document.messages_box_form.elements[i].checked) bgneal@312: { bgneal@312: ++count; bgneal@312: } bgneal@312: } bgneal@312: } bgneal@312: document.getElementById('master_select').checked = count == numChkBoxes; bgneal@312: } bgneal@312: bgneal@312: function messages_count_selected() bgneal@312: { bgneal@312: var count = 0; bgneal@312: for (i = 0; i < document.messages_box_form.length; ++i) bgneal@312: { bgneal@312: if (document.messages_box_form.elements[i].type == 'checkbox' && bgneal@312: document.messages_box_form.elements[i].checked && bgneal@312: document.messages_box_form.elements[i].id != 'master_select') bgneal@312: { bgneal@312: ++count; bgneal@312: } bgneal@312: } bgneal@312: return count; bgneal@312: } bgneal@312: bgneal@312: function messages_confirm_delete() bgneal@312: { bgneal@312: var count = messages_count_selected(); bgneal@312: if (count == 0) bgneal@312: { bgneal@312: alert("No messages selected."); bgneal@312: return false; bgneal@312: } bgneal@312: return confirm('Really delete selected messages?'); bgneal@312: } bgneal@312: bgneal@312: function messages_confirm_undelete() bgneal@312: { bgneal@312: var count = messages_count_selected(); bgneal@312: if (count == 0) bgneal@312: { bgneal@312: alert("No messages selected."); bgneal@312: return false; bgneal@312: } bgneal@312: return confirm('Really undelete selected messages?'); bgneal@312: }