// JavaScript scroll thumbnails

var t_scroll = "";
var t_scroll_speed = 1;

function scrollDIV(dest,direction)
{

if ( document.getElementById(dest) )
{
	var obj = document.getElementById(dest);
	if ( (obj.scrollTop >= obj.scrollHeight && direction == 1) || (obj.scrollTop <= 0 && direction == -10) || direction == 0)
	{
		window.clearTimeout(t_scroll);
		t_scroll = "";
	}
	else
	{
		var speed = t_scroll_speed * direction;
		obj.scrollTop = obj.scrollTop + speed;
	}
}
}

function scroll_speedup()
{
	t_scroll_speed = 6;
}

function scroll_speeddown()
{
	t_scroll_speed = 1;
}

function scroll_start(dest,direction)
{
	if ( t_scroll != "" ) scroll_stop();
	t_scroll = window.setInterval("scrollDIV('"+dest+"',"+direction+")",10);
}

function scroll_stop()
{
	window.clearTimeout(t_scroll);
	t_scroll = "";
}

function scroll_set(dest,pos)
{
scroll_stop();
if ( document.getElementById(dest) )
{
	var obj = document.getElementById(dest);
	obj.scrollTop = pos;
}
}