(function(c){c.fn.pager=function(e){var d=c.extend({},c.fn.pager.defaults,e);return this.each(function(){c(this).empty().append(b(parseInt(e.pagenumber),parseInt(e.pagecount),e.buttonClickCallback));c(".pages li").mouseover(function(){document.body.style.cursor="pointer"}).mouseout(function(){document.body.style.cursor="auto"})})};function b(k,i,g){var f=c('<ul class="pages"></ul>');f.append(a("first",k,i,g)).append(a("prev",k,i,g));var h=1;var d=9;if(k>4){h=k-4;d=k+4}if(d>i){h=i-8;d=i}if(h<1){h=1}for(var j=h;j<=d;j++){var e=c('<li class="page-number">'+(j)+"</li>");j==k?e.addClass("pgCurrent"):e.click(function(){g(this.firstChild.data)});e.appendTo(f)}f.append(a("next",k,i,g)).append(a("last",k,i,g));return f}function a(f,h,d,i){var g=c('<li class="pgNext">'+f+"</li>");var e=1;switch(f){case"first":e=1;break;case"prev":e=h-1;break;case"next":e=h+1;break;case"last":e=d;break}if(f=="first"||f=="prev"){h<=1?g.addClass("pgEmpty"):g.click(function(){i(e)})}else{h>=d?g.addClass("pgEmpty"):g.click(function(){i(e)})}return g}c.fn.pager.defaults={pagenumber:1,pagecount:1}})(jQuery);
