var run;

function step(id, dir)
{
	if(dir==1)	document.getElementById(id).scrollTop-=6;
	else		document.getElementById(id).scrollTop+=6;

	show_height(id);
}

function step_scroll(id, dir)
{
	if(dir==1)	document.getElementById(id).scrollTop-=50;
	else		document.getElementById(id).scrollTop+=50;

	show_height(id);
}

function start_move(id, dir)
{
	run = window.setInterval("step('" + id + "', " + dir + ")", 1);
}

function stop_move()
{
	window.clearInterval(run);
}

function show_height(id)
{
	var sub_height = document.getElementById(id + "_sub").offsetHeight;
	var offset = document.getElementById(id).scrollTop;
	var height = document.getElementById(id).offsetHeight;

	height = offset/(sub_height - height)*(358-70);

	document.getElementById(id + "_balken").style.top = height + "px";
}
