var t;
var pos = 0;
var scroll_in_progress=0;

function start_scroll(direction,img_name,img_src){
	//alert(direction + ' ' + scroll_in_progress);
	if (scroll_in_progress!=1) {
		
		scroll_in_progress=1;
		document[img_name].src=img_src;
		scroll(direction);
	}
}

function scroll(direction)
//direction: up=1, down=0;
// up and down are relative to what u want
{
	if (scroll_in_progress == 0){
		return;
		}
	v=document.getElementById('container');
	w=document.getElementById('container_list');
	delay = 1;
	if (w.style.top.length > 0)
		pos = w.style.top.substring(0,w.style.top.length-2) * 1;
	if (direction == 0){
		if (pos + w.clientHeight > v.clientHeight + 1){
			pos -= 2;
			w.style.top = pos;
			t=setTimeout("scroll("+direction+")",delay);
		} else
			clearTimeout(t);
	}
	else if (direction == 1){
		if (pos < 0){
			pos += 2;
			w.style.top = pos;
			t=setTimeout("scroll("+direction+")",delay);
		} else
			clearTimeout(t);
	}
}

function stop_scroll(img_name,img_src){
	clearTimeout(t);
	document[img_name].src=img_src;
	scroll_in_progress=0;
}