(function(f){jQuery.fn.scroll=function(b){b=f.extend({scrollLeft:"div.scrollLeft",scrollRight:"div.scrollRight",scrollWrapper:"div.scrollWrapper",scrollArea:"div.scrollArea",scrollingSpeed:3,mouseDownSpeedBooster:3},b);return this.each(function(){function g(){if(a.find(b.scrollWrapper).scrollLeft()===0){a.find(b.scrollLeft).hide();a.find(b.scrollRight).show()}else{a.scrollAreaWidth<=a.find(b.scrollWrapper).innerWidth()+a.find(b.scrollWrapper).scrollLeft()?a.find(b.scrollRight).hide():a.find(b.scrollRight).show();
a.find(b.scrollLeft).show()}}var a=f(this),c,d=1;f(window).one("load",function(){a.scrollAreaWidth=1600;a.find(b.scrollArea).css("width",a.scrollAreaWidth+"px");a.find(b.scrollWrapper).scrollLeft(0)});a.find(b.scrollRight).bind("mousemove",function(e){c=Math.round((e.pageX-this.offsetLeft)/25*b.scrollingSpeed);if(c===Infinity)c=0});a.find(b.scrollRight).bind("mouseover",function(){a.rightScrollInterval=setInterval(h,6)});a.find(b.scrollRight).bind("mouseout",function(){clearInterval(a.rightScrollInterval);
c=0});a.find(b.scrollRight).bind("mousedown",function(){d=b.mouseDownSpeedBooster});f("*").bind("mouseup",function(){d=1});var h=function(){c>0&&a.find(b.scrollWrapper).scrollLeft(a.find(b.scrollWrapper).scrollLeft()+c*d);g()};a.find(b.scrollLeft).bind("mousemove",function(e){e=a.find(b.scrollLeft).innerWidth()-e.pageX;c=Math.round(e/25*b.scrollingSpeed);if(c===Infinity)c=0});a.find(b.scrollLeft).bind("mouseover",function(){b.autoScroll=="onstart"&&clearInterval(a.autoScrollInterval);a.leftScrollInterval=
setInterval(i,6)});a.find(b.scrollLeft).bind("mouseout",function(){clearInterval(a.leftScrollInterval);c=0});a.find(b.scrollLeft).bind("mousedown",function(){d=b.mouseDownSpeedBooster});var i=function(){c>0&&a.find(b.scrollWrapper).scrollLeft(a.find(b.scrollWrapper).scrollLeft()-c*d);g()}})}})(jQuery);
