(function(e,t,undefined){function a(t){var a=e(t.table);a.find("> tbody"),this.pageNavigation=a.data("page-navigation")||t.options.pageNavigation,this.pageSize=a.data("page-size")||t.options.pageSize,this.firstText=a.data("page-first-text")||t.options.firstText,this.previousText=a.data("page-previous-text")||t.options.previousText,this.nextText=a.data("page-next-text")||t.options.nextText,this.lastText=a.data("page-last-text")||t.options.lastText,this.currentPage=0,this.pages=[],this.control=!1}function i(){var t=this;t.name="Footable Paginate",t.init=function(i){if(i.options.paginate===!0){if(e(i.table).data("page")===!1)return;e(i.table).bind({footable_initialized:function(){i.pageInfo=new a(i),i.raise("footable_setup_paging")},"footable_row_removed footable_redrawn footable_sorted footable_filtered footable_setup_paging":function(){i.pageInfo&&t.setupPaging(i)}})}},t.setupPaging=function(a){var i=e(a.table).find("> tbody");t.createPages(a,i),t.createNavigation(a,i),t.fillPage(a,i,a.pageInfo.currentPage)},t.createPages=function(t,a){var i=1,o=t.pageInfo,n=i*o.pageSize,r=[],l=[];o.pages=[];var d=a.find("> tr:not(.footable-filtered,.footable-row-detail)");d.each(function(e,t){r.push(t),e===n-1?(o.pages.push(r),i++,n=i*o.pageSize,r=[]):e>=d.length-d.length%o.pageSize&&l.push(t)}),l.length>0&&o.pages.push(l),o.currentPage>=o.pages.length&&(o.currentPage=o.pages.length-1),0>o.currentPage&&(o.currentPage=0),1===o.pages.length?e(t.table).addClass("no-paging"):e(t.table).removeClass("no-paging")},t.createNavigation=function(a){var i=e(a.table).find(a.pageInfo.pageNavigation);if(0===i.length){if(i=e(a.pageInfo.pageNavigation),i.parents("table:first")!==e(a.table))return;i.length>1&&a.options.debug===!0&&console.error("More than one pagination control was found!")}if(0!==i.length){i.is("ul")||(0===i.find("ul:first").length&&i.append("
"),i=i.find("ul")),i.find("li").remove();var o=a.pageInfo;o.control=i,o.pages.length>0&&(i.append('"),e.each(o.pages,function(e,t){t.length>0&&i.append('")}),i.append('"),i.append('")),i.find("a").click(function(i){i.preventDefault();var n=e(this).data("page"),r=o.currentPage;"first"===n?r=0:"prev"===n?r>0&&r--:"next"===n?o.pages.length-1>r&&r++:r="last"===n?o.pages.length-1:n,t.paginate(a,r)}),t.setPagingClasses(i,o.currentPage,o.pages.length)}},t.paginate=function(a,i){var o=a.pageInfo;if(o.currentPage!==i){var n=e(a.table).find("> tbody"),r=a.raise("footable_paging",{page:i,size:o.pageSize});if(r&&r.result===!1)return;t.fillPage(a,n,i),o.control.find("li").removeClass("active disabled"),t.setPagingClasses(o.control,o.currentPage,o.pages.length)}},t.setPagingClasses=function(e,t,a){e.find("li.footable-page > a[data-page="+t+"]").parent().addClass("active"),t>=a-1&&(e.find('li.footable-page-arrow > a[data-page="next"]').parent().addClass("disabled"),e.find('li.footable-page-arrow > a[data-page="last"]').parent().addClass("disabled")),1>t&&(e.find('li.footable-page-arrow > a[data-page="first"]').parent().addClass("disabled"),e.find('li.footable-page-arrow > a[data-page="prev"]').parent().addClass("disabled"))},t.fillPage=function(a,i,o){a.pageInfo.currentPage=o,i.find("> tr").hide(),e(a.pageInfo.pages[o]).each(function(){t.showRow(this,a)})},t.showRow=function(t,a){var i=e(t),o=i.next(),n=e(a.table);n.hasClass("breakpoint")&&i.hasClass("footable-detail-show")&&o.hasClass("footable-row-detail")?(i.add(o).show(),a.createOrUpdateDetailRow(t)):i.show()}}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 o={paginate:!0,pageSize:10,pageNavigation:".pagination",firstText:"«",previousText:"‹",nextText:"›",lastText:"»"};t.footable.plugins.register(i,o)})(jQuery,window);