var Scrollbar=new Class({Extends:Slider,options:{orientation:"vertical",discreet:false,divisor:1.2,cursor:14,wheel:false},initialize:function(B,D,A){this.setOptions(A);this.wrapper=D;this.frame=B;var C=(this.options.orientation=="vertical")?".vscrollbar":".hscrollbar";this.parent(B.getElement(C),this.options);this.setPosition();this.setCursor();if(this.options.wheel){this.frame.cloneEvents(this.container,"mousewheel")}this.addEvent("onChange",function(){D.setStyle(this.mode.direction,-this.getValue())})},mousedown:function(A){if(this.options.max<0){return }this.parent(A)},mousewheel:function(A){if(this.options.max<0){return }this.parent(A)},setPosition:function(){var A=this.frame.getSize(),H=0,C="x",G="left",E={},F,D;if(this.mode.axe=="x"){G="top";C="y";H=1}var B=this.container.getStyle("margin").split(" ");E.y=B[0+H].toInt()+B[2+H].toInt();E.x=B[1+H].toInt();this.container.setStyle(this.mode.offset,A[this.mode.axe]-E.y);F=A[C]-E.x-this.container.getSize()[C];this.container.setStyle(G,F);D=this.container.getElementsWithAssociate(".up, .bar, .down");F=D.up.getSize()[this.mode.axe]+D.down.getSize()[this.mode.axe];D.bar.setStyle(this.mode.offset,this.container.getSize()[this.mode.axe]-F);this.container.setStyle("visibility","visible")},setCursor:function(){var A=this.frame.getCoordinates(),E=this.wrapper.getCoordinates(),D,B,C;this.wrapper.setStyle("top",this.options.min);this.options.max=E[this.mode.offset]-A[this.mode.offset];if(this.options.max<0){this.element.setNone()}else{this.element.setBlock()}D=A[this.mode.offset]-this.options.max;D=(D<this.options.cursor)?this.options.cursor:D/=this.options.divisor;if(this.options.max<0){D=0}B=this.element.getElementsWithAssociate(".left, .middle, .right");C=B.left.getSize()[this.mode.axe]-B.right.getSize()[this.mode.axe];B.middle.setStyle(this.mode.offset,D-C);this.element.setStyle(this.mode.direction,0).setStyle("visibility","visible")}});