var divClassDisplay	= '';
var downTimer		= '';
var upTimer			= '';
var curTop			= '';

function init_scrollers()
{
	divClassDisplay	= document.getElementById('classdisplay');
	divClassDisplay.style.top	= 0;
	divClassDisplay.style.top	= "0px";
}

function menu(byImage,byRef)
{	byImage.src	= 'image/'+byRef;
}

function over_scrollup(byImage)
{	byImage.src	= 'image/conscroll_up_over.jpg';
}
function out_scrollup(byImage)
{	byImage.src	= 'image/conscroll_up.jpg';
}
function over_scrolldown(byImage)
{	byImage.src	= 'image/conscroll_down_over.jpg';
}
function out_scrolldown(byImage)
{	byImage.src	= 'image/conscroll_down.jpg';
}
function scroll_upclass()
{	clearTimeout(downTimer);

	if(parseInt(divClassDisplay.style.top) < 0)
	{	divClassDisplay.style.top	= parseInt(divClassDisplay.style.top)+20+"px";
		upTimer 					= setTimeout("scroll_upclass()",40)
	}
}
function stop_scroll_upclass()
{	clearTimeout(upTimer);
}
function scroll_downclass()
{	clearTimeout(downTimer);
	
	curTop		= parseInt(divClassDisplay.style.top);
	curHeight	= parseInt(divClassDisplay.offsetHeight);

	if(canScroll() && stillScroll())
	{
		divClassDisplay.style.top	= parseInt(divClassDisplay.style.top)-20+"px";
		downTimer 					= setTimeout("scroll_downclass()",40)
	}
}
function stop_scroll_downclass()
{	clearTimeout(downTimer);
}
function stillScroll()
{
	curTop		= parseInt(divClassDisplay.style.top);
	curHeight	= parseInt(divClassDisplay.offsetHeight);

	if(curTop+curHeight > 50)
		return true;
}
function canScroll()
{
	curHeight	= parseInt(divClassDisplay.offsetHeight);
	if(curHeight > 450)
		return true;
}

function over_part(byRef)
{	//if(byRef.getAttribute('className') != 'component_expanded')
	//	byRef.setAttribute('className','component_hover');
	parentTable	= document.getElementById(byRef);
	for(i=0;i<parentTable.cells.length;i++)
		parentTable.cells[i].setAttribute('className',parentTable.cells[i].getAttribute('className')+'_hover');
}
function out_part(byRef)
{	//if(byRef.getAttribute('className') != 'component_expanded')
	//	byRef.setAttribute('className','component');
	parentTable	= document.getElementById(byRef);
	for(i=0;i<parentTable.cells.length;i++)
		parentTable.cells[i].setAttribute('className',parentTable.cells[i].getAttribute('className').substr(0,parentTable.cells[i].getAttribute('className').indexOf('_')));
}
