var pageCount=0;var currPage=1;var pageNumber=0;var pageControlLoad=false;$.fn.infiniteCarousel=function(b){this.name="pagingSelector";function a(d,c){return new Array(c+1).join(d)}return this.each(function(){var g=$(b,this),j=g.find("> div"),h=j.find("> ul"),f=h.filter(":first"),k=f.outerWidth(),d=Math.ceil(g.innerWidth()/k),c=Math.ceil(h.length/d);if((h.length%d)!=0){}h=j.find("> ul");g.get(0).scrollLeft=k*d;if(pageCount>0){$("a.back",this).click(function(){if(currPage<=1){currPage=2}return l(currPage-1)});$("a.forward",this).click(function(){return l(currPage+1)});for(var e=1;e<=pageCount;e++){$("#pageing"+e,this).click(function(){var i=parseInt(this.id.replace("pageing",""));return l(i)})}function m(n){for(var o=1;o<=pageCount;o++){if(o==n){$("#spnPaging"+o).show();$("#pageing"+o).hide()}else{$("#spnPaging"+o).hide();$("#pageing"+o).show()}}}$(".ActiveBack").hide();$(".InactiveFwd").hide();$(".ActiveFwd").show();$(".InactiveBack").show()}else{$(".InactiveFwd").show();$(".InactiveBack").show()}function l(o){action="";var i=o<currPage?-1:1,q=Math.abs(currPage-o),p=k*i*d*q;g.filter(":not(:animated)").animate({scrollLeft:"+="+p},500,function(){if(o==1){$(".InactiveBack").show();$(".ActiveBack").hide()}else{$(".InactiveBack").hide();$(".ActiveBack").show()}if(o==pageCount){$(".InactiveFwd").show();$(".ActiveFwd").hide()}else{$(".InactiveFwd").hide();$(".ActiveFwd").show()}m(o);currPage=o});return false}$(this).bind("goto",function(i,n){l(n)})})};$(document).ready(function(){$("#scrollButtons > div").parent().infiniteCarousel("> div")});