Simplify JQuery code?
<p><strong>NOTE</strong>:  I added this to a JSFIDDLE found at <a href="http://jsfiddle.net/kbarrows/SWEvm/1/" rel="nofollow">this link</a></p>

<hr>

<p>I've written some basic jQuery code to manipulate rows from one of 3 tables, handle a couple button clicks and checkboxes.  I feel so much like a n00b right now.  I am looking at this and realize that there is so much that could be turned into more generic functions, but am not versed with creating JS functions.  Any pointers would be welcome.</p>

<p>Since I have blocks of like functionality, I would prefer to discuss how to simplify each block type.</p>

<ul>
<li>buttonSwap</li>
<li>Select/deselct check list</li>
<li>Move check list</li>
<li>Show/hide panels</li>
</ul>

<p>Here is the code:</p>

<pre><code>   &lt;script type="text/javascript" language="javascript"&gt;
        $(document).ready(function () {

        $('#displayActivePanel').hide();
        $('#displayInactivePanel').hide();

        // Button event handlers to move items from/to differing tables...
        $('#TableAdminPortfolio tbody .buttonSwap').live('click', function () {
            var tr = $(this).closest('tr');
            var stat = tr.children('.padLeft.status').text().trim();
            var tableActiveProjects = $('#TableActiveProjects tbody');
            var tableInactiveProjects = $('#TableInactiveProjects tbody');

            tr.fadeOut(1000);
            if (stat == 'Active') {
                tableActiveProjects.prepend(tr);
            } else {
                tableInactiveProjects.prepend(tr);
            }
            tr.fadeIn(1000);
        });

        $('#TableActiveProjects tbody .buttonSwap').live('click', function () {
            var tr = $(this).closest('tr');
            var tableAdminPortfolio = $('#TableAdminPortfolio tbody');

            tr.fadeOut(1000);
            tableAdminPortfolio.prepend(tr);
            tr.fadeIn(1000);
        });

        $('#TableInactiveProjects tbody .buttonSwap').live('click', function () {
            var tr = $(this).closest('tr');
            var tableAdminPortfolio = $('#TableAdminPortfolio tbody');

            tr.fadeOut(1000);
            tableAdminPortfolio.prepend(tr);
            tr.fadeIn(1000);
        });

        $('#masterCheckBoxAdminPortfolio').live('change', function () {
            var isChecked = $('#masterCheckBoxAdminPortfolio:checked').val() != undefined;

            var list = $('#TableAdminPortfolio .CheckBoxProjects');
            list.each(function () {
                this.checked = isChecked;
            });
        });
        $('#TableActiveProjectsCheckbox').live('change', function () {
            var isChecked = $('#TableActiveProjectsCheckbox:checked').val() != undefined;

            var list = $('#TableActiveProjects .CheckBoxProjects');
            list.each(function () {
                this.checked = isChecked;
            });
        });
        $('#TableInactiveProjectsCheckbox').live('change', function () {
            var isChecked = $('#TableInactiveProjectsCheckbox:checked').val() != undefined;

            var list = $('#TableInactiveProjects .CheckBoxProjects');
            list.each(function () {
                this.checked = isChecked;
            });
        });

        $('#TableAdminPortfolioRemoveAllChecked').live('click', function () {
            var list = $('#TableAdminPortfolio .CheckBoxProjects');
            list.each(function () {
                var isChecked = $(this).closest('td').children('.CheckBoxProjects:checked').val() != undefined;
                if (isChecked) {
                    var tr = $(this).closest('tr');
                    var stat = tr.children('.padLeft.status').text().trim();
                    var tableActiveProjects = $('#TableActiveProjects tbody');
                    var tableInactiveProjects = $('#TableInactiveProjects tbody');

                    tr.fadeOut(1000);
                    if (stat == 'Active') {
                        tableActiveProjects.prepend(tr);
                    } else {
                        tableInactiveProjects.prepend(tr);
                    }
                    tr.fadeIn(1000);
                }
            });
        });
        $('#TableActiveProjectsAddAllChecked').live('click', function () {
            var tableAdminPortfolio = $('#TableAdminPortfolio tbody');
            var list = $('#TableActiveProjects .CheckBoxProjects');
            list.each(function () {
                var tr = $(this).closest('tr');
                var isChecked = $(this).closest('td').children('.CheckBoxProjects:checked').val() != undefined;
                if (isChecked) {
                    tr.fadeOut(1000);
                    tableAdminPortfolio.prepend(tr);
                    tr.fadeIn(1000);
                }
            });
        });
        $('#TableInactiveProjectsAddAllChecked').live('click', function () {
            var tableAdminPortfolio = $('#TableAdminPortfolio tbody');
            var list = $('#TableInactiveProjects .CheckBoxProjects');
            list.each(function () {
                var tr = $(this).closest('tr');
                var isChecked = $(this).closest('td').children('.CheckBoxProjects:checked').val() != undefined;
                if (isChecked) {
                    tr.fadeOut(1000);
                    tableAdminPortfolio.prepend(tr);
                    tr.fadeIn(1000);
                }
            });
        });

        $('#showActivePanel').click(function () {
            $('#displayActivePanel').show();
        });
        $('#hideActivePanel').click(function () {
            $('#displayActivePanel').hide();
        });
        $('#showInactivePanel').click(function () {
            $('#displayInactivePanel').show();
        });
        $('#hideInactivePanel').click(function () {
            $('#displayInactivePanel').hide();
        });
    });
}
&lt;/script&gt;
</code></pre>
