divStyleScroller=function(d,h,i,j,k,f){document.getElementById(d);this.get=function(a){return document.getElementById(a)};this.scroller=this.get(j);this.scrollerBar=this.get(i);this.menu=this.get(h);this.content=this.get(d);this.scrollerTrackHeight=k;this.objectHeight=this.content.offsetHeight;this.objectTrackHeight=this.menu.offsetHeight;d=Math.round(this.objectHeight*this.scrollerTrackHeight/this.objectTrackHeight);this.scrollerHeight=f!=""&&f!=0?f:d;this.scrollEnabled=d<this.scrollerTrackHeight? true:false;this.scrollerBar.style.display=this.scrollEnabled?"block":"none";try{this.scroller.style.height=this.scrollerHeight+"px"}catch(l){this.scroller.style.height="0px"}this.delta=this.scrollEnabled?(this.objectTrackHeight-this.objectHeight)/(this.scrollerTrackHeight-this.scrollerHeight):0;this.step=10/this.delta;this.canDrag=false;this.shift_y=0;this.jump=function(a){if(!a)a=window.event;if(a.target!=this.scroller){var b=a.layerY?a.layerY:a.offsetY,e=parseInt(this.scroller.style.marginTop); this.setPosition(2*(b>e?1:-1)*this.step+e);this.fixForBrowsers(a)}return false};this.drag=function(a){if(!a)a=window.event;this.canDrag=true;this.shift_y=a.clientY-parseInt(this.scroller.style.marginTop);return false};this.move=function(a){if(!a)a=window.event;this.canDrag&&this.setPosition(a.clientY-this.shift_y);return false};this.drop=function(){this.canDrag=false};this.setPosition=function(a){this.scroller.style.marginTop=a<=this.scrollerTrackHeight-this.scrollerHeight&&a>=0?a+"px":a>this.scrollerTrackHeight- this.scrollerHeight?this.scrollerTrackHeight-this.scrollerHeight+"px":"0px";this.menu.style.marginTop=Math.round(parseInt(this.scroller.style.marginTop)*this.delta*-1)+"px";return false};this.blockEvent=function(a){if(!a)a=window.event;if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true;if(a.preventDefault)a.preventDefault();else a.returnValue=false};this.wheel=function(a){var b=0;if(!a)a=window.event;if(a.wheelDelta)b=-a.wheelDelta/120;else if(a.detail)b=a.detail/3;if(b){var e=parseInt(this.scroller.style.marginTop); this.setPosition(b*this.step+e)}a.preventDefault&&a.preventDefault();a.returnValue=false;this.blockEvent(a)};this.fixForBrowsers=function(a){if(!a)a=window.event;if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true;if(a.preventDefault)a.preventDefault();else a.returnValue=false};var g=function(){};if(this.scrollEnabled==true){var c=this;this.scrollerBar.onmousedown=function(a){c.drag(a)};this.scrollerBar.onmousemove=function(a){c.move(a)};this.scrollerBar.onmouseup=function(a){c.drop(a)}; this.scrollerBar.onclick=function(a){c.jump(a)};if(this.content.addEventListener)this.content.addEventListener("DOMMouseScroll",g=function(a){c.wheel(a)},false);this.content.onmousewheel=function(a){c.wheel(a)}}else{this.content.removeEventListener&&this.content.removeEventListener("DOMMouseScroll",g,false);this.content.onmousewheel=null}this.remove=function(){this.content.removeEventListener&&this.content.removeEventListener("DOMMouseScroll",g,false);this.content.onmousewheel=null}};
