http://briancray.com/tests/checkboxes/index.html
The ways to implement select all is simple, but not perfect. The select all and unselect all works fine, but when under select all state, if you uncheck one the select all is also checked. How can this be corrected?
then

“Check all” is still checked. How can this be corrected?
Warning, shameless self-promotion ahead.
I’ve written a plugin for jQuery that does exactly this sort of thing. Have a look: http://mjball.github.com/jQuery-CheckAll
To use it with the markup on the page you linked:
This will suffice:
Demo: http://jsfiddle.net/mattball/npeTz/
CheckAll works correctly with jQuery 1.4.4 and 1.5.2. I have not had time to update it for jQuery 1.6. sorry.Updated for jQuery 1.6 compatibility: http://jsfiddle.net/mattball/CVQsp/
It still works even if you accidentally select the master along with the slaves: http://jsfiddle.net/mattball/BwFvc/