Trouble with shading every other row in a table
<p>I'm having trouble shading every other row of a table after certain filters are applied and some rows become hidden/visible.  <code>$("#tableJudges tr:not([th]):even").addClass("altr");</code> is called immediately, and <code>$('#tableJudges').removeClass('altr').filter(':visible:not([th]):even').addClass('altr');</code> gets called whenever there's rows hidden/made visible. Still there's multiple rows that are shaded, rather than every other row being shaded. Can anyone tell me why this is?</p>

<p>Full source: </p>

<pre><code>$(document).ready(function(){
        $("#tableJudges tr:not([th]):even").addClass("altr");
            toggleJudges();

    // inactive/active judge drop down changed
    $('#judgeStatusDropDown').change(function(){
        toggleJudges();
    });

    // judge section drop down changed
    $('#judgeSectionDropDown').change(function(){
        toggleJudges();
    });
});

function toggleJudges(){

    var selectedString = $('#judgeStatusDropDown').val() + ' ' + $('#judgeSectionDropDown').val();
    switch (selectedString){
        case 'Both All Sections':
            $('#tableJudges tr').show();
            $('#tableJudges').removeClass('altr').filter(':visible:not([th]):even').addClass('altr');
            break;

        case 'Both Bowens':
            $('#tableJudges tr:gt(1)').hide();
            $('#tableJudges tr[info="Active Bowens"]').show();
            $('#tableJudges tr[info="Inactive Bowens"]').show();
            $('#tableJudges').removeClass('altr').filter(':visible:not([th]):even').addClass('altr');
            break;

        case 'Both Complex':
            $('#tableJudges tr:gt(1)').hide();
            $('#tableJudges tr[info="Active Complex"]').show();
            $('#tableJudges tr[info="Inactive Complex"]').show();
            $('#tableJudges').removeClass('altr').filter(':visible:not([th]):even').addClass('altr');
            break;

        case 'Both Non-complex':
            $('#tableJudges tr:gt(1)').hide();
            $('#tableJudges tr[info="Active Non-Complex"]').show();
            $('#tableJudges tr[info="Active Non-Complex"]').show();
            $('#tableJudges').removeClass('altr').filter(':visible:not([th]):even').addClass('altr');
            break;

        case 'Both Specialty':
            $('#tableJudges tr:gt(1)').hide();
            $('#tableJudges tr[info="Active Specialty"]').show();
            $('#tableJudges tr[info="Active Specialty"]').show();
            $('#tableJudges').removeClass('altr').filter(':visible:not([th]):even').addClass('altr');
            break;

        case 'Inactive All Sections':
            $('#tableJudges tr:gt(1)').hide();
            $('#tableJudges tr[info="Inactive Bowens"]').show();
            $('#tableJudges tr[info="Inactive Complex"]').show();
            $('#tableJudges tr[info="Inactive Non-complex"]').show();
            $('#tableJudges tr[info="Inactive Specialty"]').show();
            $('#tableJudges').removeClass('altr').filter(':visible:not([th]):even').addClass('altr');
            break; 

        case 'Active All Sections':
            $('#tableJudges tr:gt(1)').hide();
            $('#tableJudges tr[info="Active Bowens"]').show();
            $('#tableJudges tr[info="Active Complex"]').show();
            $('#tableJudges tr[info="Active Non-complex"]').show();
            $('#tableJudges tr[info="Active Specialty"]').show();
            $('#tableJudges').removeClass('altr').filter(':visible:not([th]):even').addClass('altr');
            break;          

        default:
            $('#tableJudges tr:gt(1)').hide();
            $('#tableJudges tr[info="'+selectedString+'"]').show();
            $('#tableJudges').removeClass('altr').filter(':visible:not([th]):even').addClass('altr');
    }
}
</code></pre>
