/*! tablesorter pager plugin minified - updated 10/13/2012 */ (function(a){"use strict";a.extend({tablesorterPager:new function(){this.defaults={container:null,ajaxUrl:null,ajaxProcessing:function(a){return[0,[],null]},output:"{startRow} to {endRow} of {totalRows} rows",updateArrows:true,page:0,size:10,fixedHeight:false,removeRows:false,cssFirst:".first",cssPrev:".prev",cssNext:".next",cssLast:".last",cssGoto:".gotoPage",cssPageDisplay:".pagedisplay",cssPageSize:".pagesize",cssDisabled:"disabled",totalRows:0,totalPages:0,filteredRows:0,filteredPages:0};var b=this,c=function(b,c){var d="addClass",e="removeClass",f=b.cssDisabled,g=!!c,h=Math.min(b.totalPages,b.filteredPages);if(b.updateArrows){a(b.cssFirst+","+b.cssPrev,b.container)[g||b.page===0?d:e](f);a(b.cssNext+","+b.cssLast,b.container)[g||b.page===h-1?d:e](f)}},d=function(b,d){var e,f,g,h,i,j=a(b).hasClass("hasFilters");d.filteredRows=j?a(b).find("tbody tr:not(.filtered)").length:d.totalRows;d.filteredPages=j?Math.ceil(d.filteredRows/d.size):d.totalPages;if(Math.min(d.totalPages,d.filteredPages)>0){h=d.size*d.page>d.filteredRows;d.startRow=h?1:d.size*d.page+1;d.page=h?0:d.page;d.endRow=Math.min(d.filteredRows,d.totalRows,d.size*(d.page+1));i=a(d.cssPageDisplay,d.container);g=d.output.replace(/\{(page|filteredRows|filteredPages|totalPages|startRow|endRow|totalRows)\}/gi,function(a){return{"{page}":d.page+1,"{filteredRows}":d.filteredRows,"{filteredPages}":d.filteredPages,"{totalPages}":d.totalPages,"{startRow}":d.startRow,"{endRow}":d.endRow,"{totalRows}":d.totalRows}[a]});if(i[0]){i[i[0].tagName==="INPUT"?"val":"html"](g);if(a(d.cssGoto,d.container).length){h="";f=Math.min(d.totalPages,d.filteredPages);for(e=1;e<=f;e++){h+=""}a(d.cssGoto,d.container).html(h).val(d.page+1)}}}c(d);a(b).trigger("pagerComplete",d)},e=function(b,c){var d,e,f=a(b.tBodies[0]);if(c.fixedHeight){f.find("tr.pagerSavedHeightSpacer").remove();e=a.data(b,"pagerSavedHeight");if(e){d=e-f.height();if(d>5&&a.data(b,"pagerLastSize")===c.size&&f.find("tr:visible").length')}}}},f=function(b,c){var d=a(b.tBodies[0]);d.find("tr.pagerSavedHeightSpacer").remove();a.data(b,"pagerSavedHeight",d.height());e(b,c);a.data(b,"pagerLastSize",c.size)},g=function(b,c){if(!c.ajaxUrl){var d,e=a("tr:not(."+b.config.cssChildRow+")",b.tBodies),f=e.length,g=c.page*c.size,h=g+c.size,i=0;for(d=0;d=g&&i'+(g?g.message+" ("+g.name+")":"No rows found")+"",s=f.ajaxProcessing(b)||[0,[]],t=s[1]||[],u=t.length,v=s[2];if(u>0){for(h=0;h";for(i=0;i"+t[h][i]+""}q+=""}}if(v&&v.length===p){j=m.hasClass("hasStickyHeaders");l=m.find("."+(n.widgetOptions&&n.widgetOptions.stickyHeaders||"tablesorter-stickyheader"));k=m.find("tfoot tr:first").children();m.find("th."+n.cssHeader).each(function(b){var c=a(this),d,e;if(c.find("."+n.cssIcon).length){e=c.find("."+n.cssIcon).clone(true);c.find(".tablesorter-header-inner").html(v[b]).append(e);if(j&&l.length){e=l.find("th").eq(b).find("."+n.cssIcon).clone(true);l.find("th").eq(b).find(".tablesorter-header-inner").html(v[b]).append(e)}}else{c.find(".tablesorter-header-inner").html(v[b]);l.find("th").eq(b).find(".tablesorter-header-inner").html(v[b])}k.eq(b).html(v[b]);if(j&&l.length){d=l.find("th").eq(b);d=d.find("span").length?d.find("span:first"):d;d.html(v[b])}})}if(g){m.find("thead").append(r)}else{o.html(q)}f.temp.remove();m.trigger("update");f.totalRows=s[0]||0;f.totalPages=Math.ceil(f.totalRows/f.size);d(c,f);e(c,f);m.trigger("pagerChange",f)}},j=function(b,c){var d=a(b),e=c.ajaxUrl.replace(/\{page\}/g,c.page).replace(/\{size\}/g,c.size);if(e!==""){c.temp=a("
",{"class":"tablesorter-processing",width:d.outerWidth(true),height:d.outerHeight(true)});d.before(c.temp);a(document).ajaxError(function(a,d,e,f){i(null,b,c,f)});a.getJSON(e,function(a){i(a,b,c)})}},k=function(b,c,f){var h,i,j,k=document.createDocumentFragment(),l=c.length,m=f.page*f.size,n=m+f.size;if(l<1){return}a(b).trigger("pagerChange",f);if(!f.removeRows){g(b,f)}else{if(n>c.length){n=c.length}a(b.tBodies[0]).addClass("tablesorter-hidden");a.tablesorter.clearTableBody(b);for(h=m;h=f.totalPages){p(b,f)}d(b,f);if(!f.isDisabled){e(b,f)}a(b).trigger("applyWidgets")},l=function(b,d){if(d.ajax){c(d,true)}else{d.isDisabled=true;a.data(b,"pagerLastPage",d.page);a.data(b,"pagerLastSize",d.size);d.page=0;d.size=d.totalRows;d.totalPages=1;a("tr.pagerSavedHeightSpacer",b.tBodies[0]).remove();k(b,b.config.rowsCopy,d)}a(d.cssPageSize,d.container).addClass(d.cssDisabled)[0].disabled=true},m=function(b,c){if(c.isDisabled){return}var d=Math.min(c.totalPages,c.filteredPages);if(c.page<0||c.page>d-1){c.page=0}a.data(b,"pagerLastPage",c.page);if(c.ajax){j(b,c)}else{k(b,b.config.rowsCopy,c)}a(b).trigger("pageMoved",c)},n=function(b,c,d){d.size=c;a.data(b,"pagerLastPage",d.page);a.data(b,"pagerLastSize",d.size);d.totalPages=Math.ceil(d.totalRows/d.size);m(b,d)},o=function(a,b){b.page=0;m(a,b)},p=function(a,b){b.page=Math.min(b.totalPages,b.filteredPages)-1;m(a,b)},q=function(a,b){b.page++;if(b.page>=Math.min(b.totalPages,b.filteredPages)-1){b.page=Math.min(b.totalPages,b.filteredPages)-1}m(a,b)},r=function(a,b){b.page--;if(b.page<=0){b.page=0}m(a,b)},s=function(b,c){l(b,c);a(c.container).hide();b.config.appender=null;a(b).unbind("destroy.pager sortEnd.pager filterEnd.pager enable.pager disable.pager")},t=function(b,c,d){var f=a(c.cssPageSize,c.container).removeClass(c.cssDisabled).removeAttr("disabled");c.isDisabled=false;c.page=a.data(b,"pagerLastPage")||c.page||0;c.size=a.data(b,"pagerLastSize")||parseInt(f.val(),10)||c.size;c.totalPages=Math.ceil(Math.min(c.totalPages,c.filteredPages)/c.size);if(d){a(b).trigger("update");n(b,c.size,c);h(b,c);e(b,c)}};b.appender=function(b,c){var d=b.config.pager;if(!d.ajax){b.config.rowsCopy=c;d.totalRows=c.length;d.size=a.data(b,"pagerLastSize")||d.size;d.totalPages=Math.ceil(d.totalRows/d.size);k(b,c,d)}};b.construct=function(c){return this.each(function(){var e=this.config,i=e.pager=a.extend({},a.tablesorterPager.defaults,c),k=this,u=a(k),v=a(i.container).addClass("tablesorter-pager").show();e.appender=b.appender;t(k,i,false);if(typeof i.ajaxUrl==="string"){i.ajax=true;j(k,i)}else{i.ajax=false;a(this).trigger("appendCache",true);h(k,i)}if(a(k).hasClass("hasFilters")){a(k).unbind("filterEnd.pager").bind("filterEnd.pager",function(){i.page=0;d(k,i);m(k,i);f(k,i)})}if(a(i.cssGoto,v).length){a(i.cssGoto,v).bind("change",function(){i.page=a(this).val()-1;m(k,i)});d(k,i)}a(i.cssFirst,v).unbind("click.pager").bind("click.pager",function(){if(!a(this).hasClass(i.cssDisabled)){o(k,i)}return false});a(i.cssNext,v).unbind("click.pager").bind("click.pager",function(){if(!a(this).hasClass(i.cssDisabled)){q(k,i)}return false});a(i.cssPrev,v).unbind("click.pager").bind("click.pager",function(){if(!a(this).hasClass(i.cssDisabled)){r(k,i)}return false});a(i.cssLast,v).unbind("click.pager").bind("click.pager",function(){if(!a(this).hasClass(i.cssDisabled)){p(k,i)}return false});a(i.cssPageSize,v).unbind("change.pager").bind("change.pager",function(){a(i.cssPageSize,v).val(a(this).val());if(!a(this).hasClass(i.cssDisabled)){n(k,parseInt(a(this).val(),10),i);f(k,i)}return false});u.unbind("disable.pager enable.pager destroy.pager update.pager").bind("disable.pager",function(){l(k,i)}).bind("enable.pager",function(){t(k,i,true)}).bind("destroy.pager",function(){s(k,i)}).bind("update.pager",function(){g(k,i)})})}}});a.fn.extend({tablesorterPager:a.tablesorterPager.construct})})(jQuery)