$(document).ready(function() {

    //Setup the sorting for the table with the first column initially sorted ascending
    //and the rows striped using the zebra widget
        $("#tableOne").tablesorter({ sortList: [[0, 0]], widgets: ['zebra'] });

    //Setup the quickSearch plugin with on onAfter event that first checks to see how
    //many rows are visible in the body of the table. If there are rows still visible
    //call tableSorter functions to update the sorting and then hide the tables footer. 
    //Else show the tables footer  
        $("#tableOne tbody tr").quicksearch({
            labelText: '&nbsp;Filtre &nbsp;&nbsp;&nbsp;&nbsp;',
            attached: '#tableOne',
            position: 'before',
            delay: 100,
            loaderText: 'Chargement...',
            onAfter: function() {
                if ($("#tableOne tbody tr:visible").length != 0) {
                    $("#tableOne").trigger("update");
                    $("#tableOne").trigger("appendCache");
                    $("#tableOne tfoot tr").hide();
                }
                else {
                    $("#tableOne tfoot tr").show();
                }
            }
        });

});
