jQuery: Select global checkbox when all its options have been selected
<p>I've seen several 'check all' solutions here but none that works the other way around: select the global checkbox when all its options have been selected.</p>

<p>I have a list of groups. Each group has 4 items and an 'Unsubscribe from all' option at the bottom.</p>

<p>So far I've been able to handle the "check all" options, but I'm struggling with being able to check a group's 'Unsubscribe from all' option, when all unsubscribe options have been selected.</p>

<p>Here's a <strong><em><a href="http://jsfiddle.net/rzea/pYcQY/4/" rel="nofollow">DEMO</a></em></strong> (old now) of what I have so far. At the bottom is the piece of code I have for this, but of course, it doesn't work.</p>

<p>The other  functionalities work fine except, this one is the one I need a hand with.</p>

<p>Any help is greatly appreciated.</p>

<p>Thanks.</p>

<p><strong>EDIT -</strong> <em>Adding link to fiddle since the solution is buried in the comments below. Thanks to <strong>j08691</strong> for the script.</em></p>

<p><em><strong><a href="http://jsfiddle.net/rzea/pYcQY/19/" rel="nofollow">DEMO</a></em></strong></p>
