//=================================================================================================
var 
	scrollDivs = new Array()
//=================================================================================================
TScrollDiv = function( name, speed )
{
	this.className = "TScrollDiv";
	this.name      = name;
	this.speed     = speed;
	this.timer     = null;
	this.inner     = document.getElementById('div' + name + 'Inner');
	this.outer     = document.getElementById('div' + name + 'Outer');
	
	scrollDivs[scrollDivs.length] = this;
}
//=================================================================================================
TScrollDiv.prototype.up = function()
{
	this.startScrolling( -3 );
}
//=================================================================================================
TScrollDiv.prototype.down = function()
{
	this.startScrolling( 3 );
}
//=================================================================================================
TScrollDiv.prototype.stop = function()
{
	if ( this.timer ) 
		clearTimeout( this.timer ) ;
}
//=================================================================================================
TScrollDiv.prototype.startScrolling = function( scrollDir )
{
	this.outer.scrollTop += scrollDir;
	this.timer = setTimeout( this.name + '.startScrolling( ' + scrollDir + ' );', 20 );
}
//=================================================================================================
TScrollDiv.prototype.mouseScroll = function()
{
	if ( event )
	{
		if ( event.wheelDelta >= 120 )
		{
			this.startScrolling( -20 );
			this.stop();
		}
		else if ( event.wheelDelta <= -120 )
		{
			this.startScrolling( 20 )
			this.stop();
		}
	}
}
//=================================================================================================

