<script>
function checkAll() {
var el = document.getElementsByTagName('input');
var len = el.length;
for(var i=0; i<len; i++) {
if((el[i].type=="checkbox") && (el[i].id=='chk')) {
el[i].checked = true;
}
}
}
function clearAll() {
var el = document.getElementsByTagName('input');
var len = el.length;
for(var i=0; i<len; i++) {
if((el[i].type=="checkbox") && (el[i].id=='chk')) {
el[i].checked = false;
}
}
}
function setAllOff() {
document.getElementById('chkAll').checked = false;
}
</script>
<th width="3%" align=left>
<input type="checkbox" id="chkAll" name="chkAll" οnclick="if(this.checked==true) { checkAll(); } else { clearAll(); }"/>
</th>
<td width="5">
<nested:checkbox styleId="chk" property="ischecked" οnclick="if(this.checked==false) { setAllOff(); }"></nested:checkbox>
</td>