<?php

if (!defined('PARENT') || !isset($cmd)) { exit; }

/* STUPID TABLE
------------------------------------------*/

?>
<script src="content/js/plugins/jquery.stupidtable.js"></script>
<script>
//<![CDATA[
jQuery(function() {
  var table = jQuery('#sortTable').stupidtable();
  table.bind('aftertablesort', function (event, data) {
    jQuery('#sortTable th').removeClass('simple-table-sort-desc')
    jQuery('#sortTable th').removeClass('simple-table-sort-asc')
    switch(data.direction) {
      case 'asc':
        jQuery('#sortTable th:nth-child(' + parseInt(data.column+1) + ')').addClass('simple-table-sort-asc');
        break;
      default:
        jQuery('#sortTable th:nth-child(' + parseInt(data.column+1) + ')').addClass('simple-table-sort-desc');
        break;
    }
  });
});
//]]>
</script>