(function(e,t,undefined){function a(){var t=this;t.name="Footable Sortable",t.init=function(a){t.footable=a,a.options.sort===!0&&e(a.table).unbind(".sorting").bind({"footable_initialized.sorting":function(){var i,o,n=e(a.table),r=(n.find("> tbody"),a.options.classes.sort);if(n.data("sort")!==!1){n.find("> thead > tr:last-child > th, > thead > tr:last-child > td").each(function(){o=e(this),i=a.columns[o.index()],i.sort.ignore===!0||o.hasClass(r.sortable)||(o.addClass(r.sortable),e("").addClass(r.indicator).appendTo(o))}),n.find("> thead > tr:last-child > th."+r.sortable+", > thead > tr:last-child > td."+r.sortable).unbind("click.footable").bind("click.footable",function(a){a.preventDefault(),o=e(this);var i=!o.hasClass(r.sorted);return t.doSort(o.index(),i),!1});var l=!1;for(var s in a.columns)if(i=a.columns[s],i.sort.initial){var d="descending"!==i.sort.initial;t.doSort(i.index,d);break}l&&a.bindToggleSelectors()}},"footable_redrawn.sorting":function(){var i=e(a.table),o=a.options.classes.sort;i.data("sorted")>=0&&i.find("> thead > tr:last-child > th").each(function(a){var i=e(this);return i.hasClass(o.sorted)||i.hasClass(o.descending)?(t.doSort(a),undefined):undefined})},"footable_column_data.sorting":function(t){var a=e(t.column.th);t.column.data.sort=t.column.data.sort||{},t.column.data.sort.initial=a.data("sort-initial")||!1,t.column.data.sort.ignore=a.data("sort-ignore")||!1,t.column.data.sort.selector=a.data("sort-selector")||null;var i=a.data("sort-match")||0;i>=t.column.data.matches.length&&(i=0),t.column.data.sort.match=t.column.data.matches[i]}}).data("footable-sort",t)},t.doSort=function(a,i){var o=t.footable;if(e(o.table).data("sort")!==!1){var n=e(o.table),r=n.find("> tbody"),l=o.columns[a],s=n.find("> thead > tr:last-child > th:eq("+a+")"),d=o.options.classes.sort,f=o.options.events.sort;if(i=i===undefined?s.hasClass(d.sorted):"toggle"===i?!s.hasClass(d.sorted):i,l.sort.ignore===!0)return!0;var u=o.raise(f.sorting,{column:l,direction:i?"ASC":"DESC"});u&&u.result===!1||(n.data("sorted",l.index),n.find("> thead > tr:last-child > th, > thead > tr:last-child > td").not(s).removeClass(d.sorted+" "+d.descending),i===undefined&&(i=s.hasClass(d.sorted)),i?s.removeClass(d.descending).addClass(d.sorted):s.removeClass(d.sorted).addClass(d.descending),t.sort(o,r,l,i),o.bindToggleSelectors(),o.raise(f.sorted,{column:l,direction:i?"ASC":"DESC"}))}},t.rows=function(t,a,i){var o=[];return a.find("> tr").each(function(){var a=e(this),n=null;if(a.hasClass(t.options.classes.detail))return!0;a.next().hasClass(t.options.classes.detail)&&(n=a.next().get(0));var r={row:a,detail:n};return i!==undefined&&(r.value=t.parse(this.cells[i.sort.match],i)),o.push(r),!0}).detach(),o},t.sort=function(e,a,i,o){var n=t.rows(e,a,i),r=e.options.sorters[i.type]||e.options.sorters.alpha;n.sort(function(e,t){return o?r(e.value,t.value):r(t.value,e.value)});for(var l=0;n.length>l;l++)a.append(n[l].row),null!==n[l].detail&&a.append(n[l].detail)}}if(t.footable===undefined||null===t.footable)throw Error("Please check and make sure footable.js is included in the page and is loaded prior to this script.");var i={sort:!0,sorters:{alpha:function(e,t){return"string"==typeof e&&(e=e.toLowerCase()),"string"==typeof t&&(t=t.toLowerCase()),e===t?0:t>e?-1:1},numeric:function(e,t){return e-t}},classes:{sort:{sortable:"footable-sortable",sorted:"footable-sorted",descending:"footable-sorted-desc",indicator:"footable-sort-indicator"}},events:{sort:{sorting:"footable_sorting",sorted:"footable_sorted"}}};t.footable.plugins.register(a,i)})(jQuery,window);