var scrollDir=0;
var scrollStep=10;
var scrollSleep=30;

var isScrolling=false;

function setScroll(val)
	{
	scrollDir=val;

	if(!isScrolling) { scrollIt(); }
	}

function scrollToTop()
	{
	document.getElementById("contentContainer").scrollTop=0;
	}

function scrollToBottom()
	{
	document.getElementById("contentContainer").scrollTop=
		document.getElementById("contentContainer").scrollHeight;
	}

function scrollIt()
	{
	isScrolling=true;

	var currentScroll=document.getElementById("contentContainer").scrollTop;
	var maxScroll=document.getElementById("contentContainer").scrollHeight;
	var newScroll;

	if(scrollDir==-1)
		{
		newScroll=currentScroll-scrollStep;
		if(newScroll<=0)
			{
			newScroll=0;
			}
		}
	if(scrollDir==1)
		{
		newScroll=currentScroll+scrollStep;

		if(newScroll>=maxScroll)
			{
			newScroll=maxScroll;
			}
		}
	if(scrollDir==0)
		{
		isScrolling=false;
		return;
		}

	document.getElementById("contentContainer").scrollTop=newScroll;

	setTimeout("scrollIt()",scrollSleep);
	}