jQuery searchable checkbox list and tristate checkbox
<p>I'm building a simple asp page on which I have list of peoples with checkbox on left of every name.
I've managed to create a simple jQuery script that allows hiding and showing rows of table based on input:
<a href="http://jsfiddle.net/Tq97v/" rel="nofollow">http://jsfiddle.net/Tq97v/</a> (first part)</p>

<p>As You can see I can enter part of name and then specific row are hidden.
Using red "x" I can uncheck all checkboxes.</p>

<p>What I'm trying to do now is to change that static red "x" into tristate checkbox.
Don't have idea how to even start.</p>

<p>Do I must add change listener to every checkbox in my list?</p>

<p>Second thing - how to create multiple instances of the same "plugin" on site.
Right now I'm identifying input by it, but it would be nice to call function with that input as param, and it would fine table after that input and create necessary logic.
This way I could call function multiple times on page to have more than one list.</p>

<p>I'm not asking for whole solution (of course it is always welcome :) ) but what I need is idea how to accomplish this in efficient way and as optimized as possible, because sometimes my list has 500+ elements.</p>

<p>P.S. don't look at HTML code, it is ASP generated.</p>

<hr>

<p>I found this plugin: <a href="https://github.com/bcollins/jquery.tristate" rel="nofollow">https://github.com/bcollins/jquery.tristate</a>, but  I have no idea how to use it with my list.</p>

<hr>

<p><strong>UPDATE:</strong></p>

<p>I've managed to turn my code into functions, but right now I must call 3 functions for every list.<br>
Here is my updated code: <a href="http://jsfiddle.net/65MEV/4/" rel="nofollow">http://jsfiddle.net/65MEV/4/</a><br>
How can I change it to one function? Will it be better?<br>
This is my updated code. Still thinking about way of doing that Indeterminate Checkbox instead of my remove image.</p>

<p><strong>UPDATE2</strong></p>

<p>I build working code :)<br>
<a href="http://jsfiddle.net/65MEV/9/" rel="nofollow">http://jsfiddle.net/65MEV/9/</a><br>
But I would like to improve it as much as possible.<br>
Any suggestions are welcome!</p>
