(function(d){d.fn.rCarousel=function(j){var a={visible:3,rotateBy:1,speed:500,btnNext:null,btnPrev:null,auto:null,backSlide:false};return this.each(function(){function e(g){var m=!g?-1:1,k=0;if(!h){h=true;f&&window.clearInterval(f);if(g){b.children(":first").before(b.children().slice(c-a.rotateBy,c).clone(true));b.css("left",-i*a.rotateBy+"px")}else b.children(":last").after(b.children().slice(0,a.rotateBy).clone(true));k=parseInt(b.css("left"))+i*a.rotateBy*m;b.animate({left:k},{queue:false,duration:a.speed,
complete:function(){if(g)b.children().slice(c,c+a.rotateBy).remove();else{b.children().slice(0,a.rotateBy).remove();b.css("left",0)}if(a.auto)f=window.setInterval(function(){e(a.backslide)},a.auto);h=false}})}return false}j&&d.extend(a,j);var l=d(this),b=l.children(":first"),i=b.children().outerWidth(),c=b.children().length,h=false,f=null;if(a.visible>c)a.visible=c;if(a.rotateBy>c)a.rotateBy=c;l.css({position:"relative",overflow:"hidden",width:a.visible*i+"px"});b.css({position:"relative",width:"9999px",
left:0});d(a.btnNext).click(function(){return e(false)});d(a.btnPrev).click(function(){return e(true)});if(a.auto)f=window.setInterval(function(){e(a.backslide)},a.auto)})}})(jQuery);
