(function(b){b.fn.jCarouselLite=function(e){e=b.extend({btnPrev:null,btnNext:null,btnGo:null,mouseWheel:false,auto:null,speed:200,easing:null,vertical:false,circular:true,visible:3,start:0,scroll:1,beforeStart:null,afterEnd:null},e||{});return this.each(function(){var f;var j;var l=false,g=e.vertical?"top":"left",k=e.vertical?"height":"width";var t=b(this),r=b("ul",t),n=b("li",r),m=n.size(),p=e.visible;if(e.circular){r.prepend(n.slice(m-p-1+1).clone()).append(n.slice(0,p).clone());e.start+=p}var q=b("li",r),o=q.size(),u=e.start;t.css("visibility","visible");q.css({overflow:"hidden","float":e.vertical?"none":"left"});r.css({margin:"0",padding:"0",position:"relative","list-style-type":"none","z-index":"1"});t.css({overflow:"hidden",position:"relative","z-index":"2",left:"0px"});var x=790;var w=x*o;var s=790;q.css({width:790});r.css(k,w+"px").css(g,-(u*x));t.css(k,s+"px");if(e.btnPrev){b(e.btnPrev).click(function(){return i(u-e.scroll)})}if(e.btnNext){b(e.btnNext).click(function(){return i(u+e.scroll)})}if(e.btnGo){b.each(e.btnGo,function(y,v){b(v).click(function(){return i(e.circular?e.visible+y:y)})})}if(e.mouseWheel&&t.mousewheel){t.mousewheel(function(y,v){return v>0?i(u-e.scroll):i(u+e.scroll)})}if(e.auto){setInterval(function(){i(u+e.scroll)},e.auto+e.speed)}function h(){return q.slice(u).slice(0,p)}function i(v){if(!l){if(e.beforeStart){e.beforeStart.call(this,h())}if(e.circular){if(v<=e.start-p-1){r.css(g,-((o-(p*2))*x)+"px");u=v==e.start-p-1?o-(p*2)-1:o-(p*2)-e.scroll}else{if(v>=o-p+1){r.css(g,-((p)*x)+"px");u=v==o-p+1?p+1:p+e.scroll}else{u=v}}}else{if(v<0||v>o-p){return}else{u=v}}l=true;r.animate(g=="left"?{left:-(u*x)}:{top:-(u*x)},e.speed,e.easing,function(){if(e.afterEnd){e.afterEnd.call(this,h())}l=false});if(!e.circular){b(e.btnPrev).removeClass("disabled");b((u-e.scroll<0&&e.btnPrev)).addClass("disabled").attr("href",e.linkPrevPage)}if(!e.circular){b(e.btnNext).removeClass("disabled");b((u+e.scroll>o-p&&e.btnNext)).addClass("disabled").attr("href",e.linkNextPage)}}return false}})};function d(e,f){return parseInt(b.css(e[0],f))||0}function a(e){return e[0].offsetWidth+d(e,"marginLeft")+d(e,"marginRight")}function c(e){return e[0].offsetHeight+d(e,"marginTop")+d(e,"marginBottom")}})(jQuery);
