на jquery красивее
<!DOCTYPE html>
<html>
<head>
<title></title>
<script class="jsbin" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script>
$(function () {
$('input[name="total"]').change(function () {
$(this).siblings('input').prop('checked', this.checked);
});
});
</script>
</head>
<body>
<form name="form1" method="post" action="">
<input type="checkbox" name="total">Отметить все
<input type="checkbox" name="checkbox[1]" >1
<input type="checkbox" name="checkbox[2]" >2
<input type="checkbox" name="checkbox[3]" >3
</form>
</body>
</html>