var timer;
var sel;
var content;
var scrollpane;
var scrollarrowup;
var scrollarrowdown;
var scrollarrowupcover;
var scrollarrowdowncover;
var cheight;

function libinit()
{
	page = new lib_doc_size();
	scrollpane = new lib_obj('scrollpane');
	content = new lib_obj('content','scrollpane');
	scrollarrowup = new lib_obj('scrollarrowup');
	scrollarrowdown = new lib_obj('scrollarrowdown');
	scrollarrowupcover = new lib_obj('scrollarrowupcover');
	scrollarrowdowncover = new lib_obj('scrollarrowdowncover');
	showcontent();
}

function movecontent(x)
{
	if(x==0)
	{
		if(content.y < 0)
		{ 
			content.y = content.css.top = content.y + 5;
			timer = setTimeout("movecontent("+x+")",20);	
		}
	}
	else
	{
		if (bw.ns6)
		{
			ns6fix = 20;
		}
		else
		{
			ns6fix = 0;
		}
	
		if(content.y > -(cheight-220 + ns6fix))
		{ 
			content.y = content.css.top = content.y - 5;
			timer = setTimeout("movecontent("+x+")",20);	
		}
	}
}

function stopcontent()
{
	clearTimeout(timer);
	timer = setTimeout("null", 1);
}

function showcontent()
{
	content.y = content.css.top = 0;
	
	if(bw.ns4)
	{
		cheight = content.evnt.clip.height;
	}
	else
	{
		cheight = content.evnt.offsetHeight;
	}
	
	if (cheight < 220)
	{
		if (bw.ie && !bw.mac)
		{	
			scrollarrowup.evnt.filters.blendTrans.apply();
			scrollarrowdown.evnt.filters.blendTrans.apply();
		}
		scrollarrowup.hideIt();
		scrollarrowdown.hideIt();
		if (bw.ie && !bw.mac)
		{	
			scrollarrowup.evnt.filters.blendTrans.play();
			scrollarrowdown.evnt.filters.blendTrans.play();
		}
				
		scrollarrowupcover.hideIt();
		scrollarrowdowncover.hideIt();
	}
	else
	{
		if (bw.ie && !bw.mac)
		{	
			scrollarrowup.evnt.filters.blendTrans.apply();
			scrollarrowdown.evnt.filters.blendTrans.apply();
		}
		scrollarrowup.showIt();
		scrollarrowdown.showIt();
		if (bw.ie && !bw.mac)
		{	
			scrollarrowup.evnt.filters.blendTrans.play();
			scrollarrowdown.evnt.filters.blendTrans.play();
		}

		if (!bw.mac)
		{		
		scrollarrowupcover.showIt();
		scrollarrowdowncover.showIt();
		}
		else
		{
			scrollarrowupcover.hideIt();
			scrollarrowdowncover.hideIt();
		}
	}

	scrollpane.showIt();
	content.showIt();
}
