isDOM=document.getElementById //DOM1 browser (MSIE 5+, Netscape 6, Opera 5+)
isOpera=isOpera5=window.opera && isDOM //Opera 5+
isOpera6=isOpera && window.print //Opera 6+
isOpera7=isOpera && document.readyState //Opera 7+
isMSIE=document.all && document.all.item && !isOpera //Microsoft Internet Explorer 4+
isMSIE5=isDOM && isMSIE //MSIE 5+
isNetscape4=document.layers //Netscape 4.*
isMozilla=isDOM && navigator.appName=="Netscape" //Mozilla или Netscape 6.*

var timer;
var divWidth = 300;
var scrollWidth = 0;
var scrollSpeed = 3;
var scrollStep = 50;

if(isNetscape4 || isMozilla)
{
	scrollWidth = 18;
}
else
{
	scrollWidth = 16;
}

function myScrollStart(dir)
{
	if(dir == 'up')
	{
		timer=setInterval('myScrollUp()', scrollStep);
	}
	else
	{
		timer=setInterval('myScrollDown()', scrollStep);
	}
}

function myScrollUp()
{
	document.getElementById('divscroll').style.width = (divWidth+scrollWidth)+'px';
	document.getElementById('divscroll').style.overflow='auto';
	document.getElementById('divscroll').scrollTop-=scrollSpeed;	
}

function myScrollDown()
{	
	document.getElementById('divscroll').style.width = (divWidth+scrollWidth)+'px';
	document.getElementById('divscroll').style.overflow='auto';
	document.getElementById('divscroll').scrollTop+=scrollSpeed;
}

function myScrollTop()
{
	document.getElementById('divscroll').style.width = (divWidth+scrollWidth)+'px';
	document.getElementById('divscroll').style.overflow='auto';
	document.getElementById('divscroll').scrollTop=0;
}

function myScrollBottom()
{
	document.getElementById('divscroll').style.width = (divWidth+scrollWidth)+'px';
	document.getElementById('divscroll').style.overflow='auto';
	document.getElementById('divscroll').scrollTop=10000;
}

function myScrollClear()
{	
	clearInterval(timer);
}
