function list_hover(_row, _class) { var cells = _row.getElementsByTagName('TD'); for (var i = 0; i < cells.length; i++) { cells[i].className = _class; } } function list_mouseover(_row) { list_hover(_row, 'over'); } function list_mouseout(_row) { list_hover(_row, 'out'); } function list_select(row) { var cells = row.getElementsByTagName('TD'); var cell = cells[0]; var inputs = cell.getElementsByTagName('INPUT'); var checkbox = inputs[0]; if (checkbox.disabled) return; if (checkbox.checked) { checkbox.checked = false; } else { checkbox.checked = true; } } function list_select_all() { var list_table = document.getElementById('list_table'); var rows = list_table.getElementsByTagName('TR'); for (var i = 1; i < rows.length; i++) { list_select(rows[i]); } } function list_append_hidden(_name, _value) { var list_form = document.getElementById('list_form'); var inputs = list_form.getElementsByTagName('INPUT'); for (var i = 0; i < inputs.lenght; i++) { if (inputs[i].name == _name) { var element = inputs[i]; break; } } if (!element) { var element = document.createElement('INPUT'); element.name = _name; element.type = 'hidden'; list_form.appendChild(element); } element.value = _value; } function list_delete() { var list_form = document.getElementById('list_form'); var list_action = document.getElementById('list_action'); list_action.value = 'delete'; list_form.submit(); }