<input type="checkbox" name="selectall" value=on onclick="selectAll()">
function selectAll(form) {
var obj = document.getElementsByName('selectall');
var cks = document.getElementsByTagName("input");
var ckslen = cks.length;
for(var i=0;i<ckslen-1;i++) {
if(cks[i].type == 'checkbox') {
cks[i].
checked = obj[0].checked;
}
}
}