function scrollBarMoo(containerId,subConteinerId,wrapperId,scrollBarId,scUpId,scDownId,scrollBarHandle,scBackId){
			var posY = 0;
			var tarY = 0;
			var handlePosY = 0;
			var step = 50;
			var pressInterval = 100;
			var moveInterval = 50;
			var decrease = 0.2;
			var isUpBtnPress = false;
			var isDownBtnPress = false;
			var timerScrollUp = null;
			var timerScrollDown = null;
			var timerScrollMove = null;
			var container = containerId ;
			var subConteiner = '';
			var wrapper = wrapperId;
			var handle = scrollBarHandle;
			var back  = scBackId;
			var isHandleDragging = false;
			var scrollBar = scrollBarId;
			var scrollUpbtn = scUpId;
			var scrollUpbtnHeight = $(scrollUpbtn).getCoordinates().height;
			var scrollDownbtn = scDownId;
			var scrollDownbtnHeight = $(scrollDownbtn).getCoordinates().height;
			var scrollBarTop = 198;
			var scrollBarLeft = 755;
			var scrollHandleHeight = $(scrollBarHandle).getCoordinates().height;
			var scrollBarHeight = $(scrollBarId).getCoordinates().height;
			var scrollBarBackHeight = scrollBarHeight-scrollUpbtnHeight-scrollDownbtnHeight;

			function scrollUp(){
				if(isUpBtnPress){
					tarY+=step;
					if(tarY>0) tarY = 0;
					timerScrollUp = window.setTimeout(scrollUp,pressInterval);
					if(timerScrollMove ==null){
						scrollMove();
					}
				}
			}
			
			this.scrollTop = function(){
					tarY = 0;
					timerScrollUp = window.setTimeout(scrollUp,pressInterval);
					if(timerScrollMove ==null){
						scrollMove();
					}
			}

			function scrollDown(){
				if(isDownBtnPress){
					tarY-=step;
					if(tarY<$(wrapper).getCoordinates().height-$(container).getCoordinates().height) tarY =$(wrapper).getCoordinates().height-$(container).getCoordinates().height;
					timerScrollDown = window.setTimeout(scrollDown,pressInterval);
					if(timerScrollMove ==null){
						scrollMove();
					}
				}
			}

			this.pressBtn = function(n){ //n=0:up n=1:down
				if(n==0){
					isUpBtnPress = true;
					scrollUp();
				}
				if(n==1){
					isDownBtnPress = true;
					scrollDown();
				}
			}

			this.releaseBtn = function(){
				isUpBtnPress = false;
				isDownBtnPress = false;
				clearTimeout(timerScrollUp);
				clearTimeout(timerScrollDown);
			}


			function scrollMove(){
				if($(wrapper).getCoordinates().height<$(container).getCoordinates().height){
					posY += (tarY-posY)*decrease;
					$(container).style.marginTop = posY+'px';
					if(subConteiner!=''){
						$(subConteiner).style.marginTop = posY+'px';
					}
					if(Math.abs(tarY-posY)>0.5){
						timerScrollMove = window.setTimeout(scrollMove,moveInterval);
						if(!isHandleDragging){
							handlePosY = (-1*posY/($(container).getCoordinates().height-$(wrapper).getCoordinates().height))*(scrollBarBackHeight-scrollHandleHeight);
							//$("result").innerHTML =handlePosY;
							$(handle).style.top = handlePosY+'px'
						}
					}else{
						posY = tarY;
						$(container).style.marginTop = posY+'px';	
						if(subConteiner!=''){			
							$(subConteiner).style.marginTop = posY+'px';
						}
						timerScrollMove = null;
					}
				}
			}



			this.initSc=function(){
				
				scrollHandleHeight = scrollBarBackHeight * $(wrapper).getSize().size.y /$(container).getSize().size.y ;
				$(handle).setStyle('height',scrollHandleHeight);
				
				
				var mySlide3 = new Slider($(back), $(handle), {	
					steps: $(container).getSize().size.y - $(wrapper).getSize().size.y,	
					mode: 'vertical',	
					onChange: function(step){
						tarY = posY= -1*step;
						isHandleDragging = true;
						scrollMove();				
					},
					onComplete: function(){	
						isHandleDragging = false;
					}
				}).set(0);
					
				
				$(back).addEvent('mousedown',function(e){
					e.preventDefault();
					scDragStart();
				});
				$(back).addEvent('mouseup',function(e){
					e.preventDefault();
					scDragEnd();
				});	
				
			}
			
			function scDragStart(){
				isHandleDragging = true;
			}
			function scDragEnd(){
				isHandleDragging = false;
			}

			function dispValue(event){
				if(isHandleDragging){

						handlePosY = scrollBarTop-$(scrollUpbtn)-scrollHandleHeight/2;
						if(handlePosY<0)handlePosY=0;
						if(handlePosY>scrollBarBackHeight-scrollHandleHeight)handlePosY=scrollBarBackHeight-scrollHandleHeight;
						tarY = -1*($(container).getCoordinates().height - $(wrapper).getCoordinates().height)* handlePosY/(scrollBarBackHeight-scrollHandleHeight);
						if(timerScrollMove ==null){
							scrollMove();
						}

						$(handle).style.top = handlePosY+'px';
				}
			}
			
			this.hidden =function(){
				$(scrollBarId).style.display = 'none';
			}
			this.show = function(){
				$(scrollBarId).style.display = 'block';
			}
}
