$(document).ready(function(){
checkUncheckAll("#select_all","[name='check_boxes[]']");
});
var NUM_BOXES = 10;
// last checkbox the user clicked
var last = -1;
function check(event) {
// in IE, the event object is a property of the window object
// in Mozilla, event object is passed to event handlers as a parameter
event = event || window.event;
var num = parseInt(/box\[(\d+)\]/.exec(this.name)[1]);
if (event.shiftKey && last != -1) {
var di = num > last ? 1 : -1;
for (var i = last; i != num; i += di)
document.forms.boxes['box[' + i + ']'].checked = true;
}
last = num;
}
function init() {
for (var i = 0; i < NUM_BOXES; i++)
document.forms.boxes['box[' + i + ']'].onclick = check;
}