text: $.fn.paginateCore=function(e){var d=parseInt(e.currentPage);var h=parseInt(e.visiblePage);var b=parseInt(e.maxPage);var a=Math.floor(h/2);var g=1;var c=0;var f='<div class="paging-wrapper"><ul class="paging noselect" data-p="'+d+'">';f+='<li id="page-back" data-p="prev-page">&lt </li>';if(b<10){for(c=1;c<=b;++c){f+='<li id="page-'+c+'" data-p="'+c+'">'+c+" </li>"}}else{if(d<h){f+='<li id="page-'+g+'" data-p="'+g+'">'+g+" </li>";for(c=2;c<((b<h)?b:h)+1;++c){f+='<li id="page-'+c+'" data-p="'+c+'">'+c+" </li>"}f+='<li class="paging" style="margin-left: 25px;" id="page-'+b+'" data-p="'+b+'">'+b+"</li>"}else{if(d>=h&&d<=b-h){f+='<li id="page-'+g+'" data-p="'+g+'" style="margin-right: 25px;">'+g+" </li>";for(c=d-a;c<d+h-a;++c){f+='<li id="page-'+c+'" data-p="'+c+'">'+c+" </li>"}f+='<li id="page-'+b+'" data-p="'+b+'" style="margin-left: 25px;">'+b+"</li>"}else{if(d>=b-h){f+='<li id="page-'+g+'" data-p="'+g+'" style="margin-right: 25px;">'+g+" </li>";c=(b-h<d)?b-h:d;for(;c<=b;++c){f+='<li id="page-'+c+'" data-p="'+c+'"> '+c+"</li>"}}}}}f+='<li id="page-next" data-p="next-page"> &gt</li></a>';f+='<span class="goto-text">Go to: </span><input type="number" id="goto-page" name="cpage" onkeypress="return event.charCode >= 48 && event.charCode <= 57"/>';f+='<li id="page-goto" data-p="go-page" alt="Go to page" title="Go to page"> &gt&gt</li>';f+="</ul></div>";this.html(f);return this};$.fn.paginate=function(c){var b;var a=$(this);if(c.currentPage===undefined){c.currentPage=1}if(c.visiblePage===undefined){c.visiblePage=5}if(c.maxPage===undefined){throw new Error("maxPage is undefined!")}$(this).paginateCore(c);$("#page-"+c.currentPage).addClass("active");$("ul.paging li").click(function(){var d=$(this).data("p");if(d===c.currentPage){return}if(d==="prev-page"){if(c.currentPage<=1){return}$("ul.paging li").removeClass("active");b=c.currentPage<=1?1:c.currentPage-1}else{if(d==="next-page"){if(c.currentPage>=c.maxPage){return}$("ul.paging li").removeClass("active");b=c.currentPage>=c.maxPage?c.maxPage:c.currentPage+1}else{if(d==="go-page"){b=$("#goto-page").val();b=parseInt(b);if(!b||b===c.currentPage){return}$("ul.paging li").removeClass("active");b=b<=1?1:(b>=c.maxPage?c.maxPage:b)}else{b=parseInt(d)}}}c.currentPage=b;a.paginate(c);$("#page-"+c.currentPage).addClass("active")});$("#goto-page").unbind().keypress(function(f){var d=$(this).val();d=parseInt(d);if(f.which===13&&d){c.currentPage=d<=1?1:(d>=c.maxPage?c.maxPage:d);a.paginate(c)}});if(c.onPageChange!==undefined){c.onPageChange(c.currentPage)}};