$j=jQuery.noConflict();(function(p){p.fn.easyPaginate=function(c){var d={step:4,delay:100,numeric:true,nextprev:true,auto:false,pause:4000,clickstop:true,controls:'pagination',current:'current'};var c=p.extend(d,c);var e=c.step;var f,upper;var g=p(this).children();var h=p(this);var j=g.length;var k,next,prev;var l=1;var m;var n=false;var o;function show(){clearTimeout(m);f=((l-1)*e);upper=f+e;p(h).css("height",o);p(g).each(function(i){var a=p(this);if(i>=f&&i<upper){a.fadeIn('fast')}else{a.fadeOut('fast')}if(c.nextprev){if(upper>=j){next.fadeOut('fast')}else{next.fadeIn('fast')};if(f>=1){prev.fadeIn('fast')}else{prev.fadeOut('fast')}}});p('li','#'+c.controls).removeClass(c.current);p('li[data-index="'+l+'"]','#'+c.controls).addClass(c.current);if(c.auto){if(c.clickstop&&n){}else{m=setTimeout(auto,c.pause)}};setTimeout(function(){o=p(h).height()},(1+j/50)*300)};function auto(){if(upper<=j){l++;show()}};this.each(function(){k=this;if(j>e){var a=Math.floor(j/e);if((j/e)>a)a++;var b=p('<ol id="'+c.controls+'"></ol>').insertAfter(k);if(c.nextprev){prev=p('<li class="prev">Previous</li>').hide().appendTo(b).click(function(){n=true;l--;show()})};if(c.numeric){for(var i=1;i<=a;i++){p('<li data-index="'+i+'">'+i+'</li>').appendTo(b).click(function(){n=true;l=p(this).attr('data-index');show()})}};if(c.nextprev){next=p('<li class="next">Next</li>').hide().appendTo(b).click(function(){n=true;l++;show()})};show()}})}})(jQuery);
