(function(a){a.fn.informationsScroller=function(b,c){return this.each(function(){if(typeof b=="string"){var n=this.scroller[b];if(!n)throw"informationsScroller - No such method: "+b;return n.call(this,this,c)}if(this.scroller)return;scroller=a.extend({speed:200,start:0,visible:3,current:0,offset:.03,css:function(c,b){return parseInt(a.css(c[0],b))||0},height:function(a){return a[0].offsetHeight+scroller.css(a,"marginTop")+scroller.css(a,"marginBottom")},pauseScroller:function(b){a("ul",b).stop()},resumeScroller:function(){m(scroller.current+scroller.offset)},changeSpeed:function(b,a){scroller.speed=a.speed},changeDirection:function(){scroller.offset=-scroller.offset}},b||{});this.scroller=scroller;var k="top",o="height",l=a(this),f=a("ul",l),h=a("li",f),p=h.size(),d=scroller.visible;scroller.start+=scroller.visible;if(h.length>0){f.prepend(h.slice(p-d-1+1).clone()).append(h.slice(0,d).clone());var i=a("li",f),e=i.size();scroller.current=scroller.start;l.css("visibility","visible");i.css({overflow:"hidden","float":"none"});f.css({margin:"0",padding:"0",position:"relative","list-style-type":"none","z-index":"1"});l.css({overflow:"hidden",position:"relative","z-index":"2",left:"0px"});var g=0,j=0;i.each(function(d){var b=a(this);b.css({width:b.width(),height:b.height()});var c=scroller.height(b);g=g+c;if(d+1<=scroller.current)j=j+c});f.css(o,g+"px").css(k,-j);m(scroller.current+scroller.offset);}function m(a){if(a<=scroller.start-d-.03){f.css(k,-((e-d*2)*(g/e))+"px");scroller.current=a==scroller.start-d-.03?e-d*2-.03:e-d*2-scroller.offset}else if(a>=e-d+.03){f.css(k,-(d*(g/e))+"px");scroller.current=a==e-d+.03?d+.03:d+scroller.offset}else scroller.current=a;f.animate({top:-(scroller.current*(g/e))},scroller.speed,"linear",function(){m(scroller.current+scroller.offset)})}})}})(jQuery);
