Well this is more of a client-side question, but here's a function I just wrote for you (and tested).
put this between the <head> and </head> tags of your document
<script language=javascript>
<!--
function toggleCheck(field)
{
if(document.myform.check_all.checked == true)
{
for (i = 0; i < field.length; i++)
{
field[i].checked = true;
}
}
else
{
for (i = 0; i < field.length; i++)
{
field[i].checked = false;
}
}
}
// End -->
</script>
Then, to have one master checkbox that checks and unchecks the rest, use this:
<input type="checkbox" name="check_all" onClick="toggleCheck(document.getElementsByName('post[]'));" />
The way this works is when you click this checkbox, toggleCheck() checks to see if it's checked or unchecked. If it's checked, then it checks all the boxes. If it's unchecked, it unchecks all the boxes. This way you can 'toggle' between checked and unchecked.
the getElementsbyName('post[]') is important, as if you just had document.myform.post[] you'd get some nasty javascript errors.
Let me know how it works.
EDIT: I forgot to mention: you need to name your form 'myform' for this to work.
<form method="post" action="wherever.php" name="myform">