<!--
/*Parametros do construtor
		        divElement, Tamanho do menu, objeto para o eventos Up, objeto para o eventos Down*/
function Scroll(oLayer, oMaxClip, objEventUp, objEventDown){
	var oEventUp = null;
	var oEventDown = null;
	var isEndUp = true;
	var isEndDown = true;
	var refInterval = 0;
	var x = 0;
	var defaultPxSlide = isIE ? 8 : 10;
	var pxSlide = defaultPxSlide;
	var mlInterval = 80;
	var maxClip = oMaxClip;
	var minClip = -(defaultPxSlide);
	var isIE = ((navigator.userAgent).indexOf('MSIE') > -1) ? true : false;
	
	Scroll.prototype.on_up = function(isUp){};
	Scroll.prototype.on_down = function(isDown){};

	this.oEventUp = objEventUp;
	this.oEventDown = objEventDown;
	maxClip = parseFloat(oMaxClip);
	
	this.ScrollUp = function(){
		if((oLayer.clientHeight - x) >= maxClip){
			if(!this.isEndDown){				
				this.on_down(true);
				this.isEndDown = true;
			}			
		}
		if(((oLayer.clientHeight + x)-oLayer.clientHeight) >= minClip+1){
			x -= pxSlide;
			this.ScrollTo(x);
		}else{
			this.on_up(false);
			this.isEndUp = false;
		}		
	}
	
	this.ScrollDown = function(){
		if(((oLayer.clientHeight + x)-oLayer.clientHeight) >= minClip+1){
			if(!this.isEndUp){
				this.on_up(true);
				this.isEndUp = true;
			}			
		}		
		if((oLayer.clientHeight - x) >= maxClip){
			x += pxSlide;
			this.ScrollTo(x);
		}else{
			this.on_down(false);
			this.isEndDown = false;			
		}
	}
	
	this.ScrollTo = function(slideX){		
		var clipValue = '';
		//alert(slideX);
		x = slideX > maxClip ? maxClip : slideX;
		x = slideX < minClip ? minClip : slideX;		
		
		/*clip:rect('top', 'right', 'bottom', 'left');*/
		clipValue = 'rect(' + ((oLayer.clientHeight + x)-oLayer.clientHeight) + 'px auto auto auto)';
		
		oLayer.style.clip = clipValue;
		oLayer.style.top = -(oLayer.clientHeight -(oLayer.clientHeight - x));		
	}
	
	this.GoToTop = function(){
		this.ScrollTo(minClip);
	}

	this.oEventUp.onmouseover = function(){		
		if(refInterval == 0){
			pxSlide = defaultPxSlide
			refInterval = setInterval('objScroll.ScrollUp()', mlInterval);
		}
	}
	
	this.oEventUp.onmouseout = function(){
		clearInterval(refInterval);
		refInterval = 0;
		pxSlide = defaultPxSlide
	}
	
	this.oEventUp.onmousedown = function(){
		clearInterval(refInterval);
		refInterval = 0;
		pxSlide = defaultPxSlide * 2;
		refInterval = setInterval('objScroll.ScrollUp()', mlInterval);
	}
	
	this.oEventUp.onmouseup = function(){
		clearInterval(refInterval);
		refInterval = 0;
		pxSlide = defaultPxSlide / 2;
		refInterval = setInterval('objScroll.ScrollUp()', mlInterval);
	}

	this.oEventDown.onmouseover = function(){
		if(refInterval == 0){
			pxSlide = defaultPxSlide
			refInterval = setInterval('objScroll.ScrollDown()', mlInterval);
		}
	}
	
	this.oEventDown.onmouseout = function(){
		clearInterval(refInterval);
		refInterval = 0;
		pxSlide = defaultPxSlide
	}
	
	this.oEventDown.onmousedown = function(){
		clearInterval(refInterval);
		refInterval = 0;
		pxSlide = defaultPxSlide * 2;
		refInterval = setInterval('objScroll.ScrollDown()', mlInterval);
	}
	
	this.oEventDown.onmouseup = function(){
		clearInterval(refInterval);
		refInterval = 0;
		pxSlide = defaultPxSlide / 2;
		refInterval = setInterval('objScroll.ScrollDown()', mlInterval);
	}
	
	this.getSlideX = function(){
		return x;
	}
	
	this.setMaxClip = function(oValue){
		maxClip = (isIE) ? parseFloat(oValue)+5 : parseFloat(oValue);
		this.ScrollTo(x);
		
		if(((oLayer.clientHeight + x)-oLayer.clientHeight) >= minClip+1){
			if(!this.isEndUp){
				this.on_up(true);
				this.isEndUp = true;
			}			
		}
		
		if((oLayer.clientHeight - x) <= maxClip){
			this.on_down(false);
			this.isEndDown = false;
		}
		
		if((oLayer.clientHeight - x) >= maxClip){
			if(!this.isEndDown){				
				this.on_down(true);
				this.isEndDown = true;
			}			
		}		
			
		if(((oLayer.clientHeight + x)-oLayer.clientHeight) <= minClip){
			this.on_up(false);
			this.isEndUp = false;
		}
	}

	this.ScrollTo(minClip);
} 
-->