Here's a modified version of the code, let me know if it helps:
<body>
<form id='d' [other attributes]>
<input type='checkbox' name='ch1'/>
<input type='checkbox' name='ch2'/>
<input type='checkbox' name='ch3'/>
<input type='checkbox' onclick='checkAll(document.forms.d,this)'/>
</form>
<script type='text/javascript'>
function checkAll(form,cbox)
{
var ct;
if(cbox.checked == true)ct = false;
else if(cbox.checked == false)ct = true;
for(var i = 0; i < form.length; i++)
{
if(form[i].type=='checkbox')form[i].checked = ct;
}
}
</script>
</body>
-Snib
<><
http://www.snibworks.com/