I have a php script that auto populates an user list with emails. They are grouped by office departments. I have been able to create a select all checkbox on the top and bottom of the page successfully but need to know how to create a jquery script when I deselect a group checkbox so that it deselects the select all boxes on the top and bottom of the page. In turn I need the script to also include when I individually select each user in a group to automatically select the group checkbox when I manually check everyone within that group. It must also recognize when all groups have been selected (all users in the all groups) that it is to check the select all boxes at the top and bottom of the page. Vice versa as well, deselect a user would deselect the group checkbox since all users are not chosen and deselect the select all boxes.
Hope I have not confused you all :)