
// scroller
var scrollers = new Array();
function ScrollableLayer(id)
{
	this.contentLayer = document.getElementById(id);
	this.drawerline = document.getElementById('drawerline' + id);
	this.drawer = document.getElementById('drawer' + id);
	this.scrollframe = document.getElementById('scrollframe' + id);
	this.scrollHeight = this.contentLayer.offsetHeight - this.scrollframe.offsetHeight;
	
	this.contentLayer.style.position = 'relative';
	this.scrollframe.style.position = 'absolute';
}
function start_scroll(id, speed)
{
	scrollers[id] = new ScrollableLayer(id);
	new_id = id;
	new_speed = speed;
	scrollers[id].timer = window.setInterval("scroll(new_id, new_speed);",30);
}
function stop_scroll(id) 
{
	window.clearInterval(scrollers[id].timer);
}
function scroll(id, speed)
{
	y_new = scrollers[id].contentLayer.offsetTop + speed;
	if (y_new <= 0 && y_new >= -scrollers[id].scrollHeight)
	{
		scrollers[id].contentLayer.style.top = y_new;
		if(scrollers[id].drawer && scrollers[id].drawerline)
		{
			scrollers[id].drawer.style.top = scrollers[id].drawerline.offsetTop - (scrollers[id].drawerline.offsetHeight - scrollers[id].drawer.offsetHeight) * (y_new / scrollers[id].scrollHeight);
		}
	}
	else
	{
		height = 0;
		if (y_new < -scrollers[id].scrollHeight)
		{
			height = scrollers[id].scrollHeight;
		}
		stop_scroll(id);
		start_scroll(id, height + y_new);
	}
}


// formclear
function clearFormS() {
	document.searchform.tx_indexedsearch.value = "";
	}

function clearFormN() {
	document.searchform.tx_indexedsearch.value = "";
	}
function clearFormK() {
	document.searchform.tx_indexedsearch.value = "";
	}

