


	var gb_up;
	var gi_top;
	var gi_step;
	var gi_max;
	
	var gu_scrollContainer = null;
	var gu_scrollContainerBody = null;

	var gi_scroll_time = 1;
	var gi_scroll_step = 1;
	var gh_scroll = null;



	function scrollStart(vi_layer, vb_up)
	{
		if (gb_loaded)
		{
			gb_up = vb_up;
			var ls_prefix = 'scroller' + vi_layer;
			
			gu_scrollContainer = document.getElementById(ls_prefix + 'Container');
			gu_scrollContainerBody = document.getElementById(ls_prefix + 'ContainerBody');
			
			gi_top = gu_scrollContainerBody.offsetTop;
			gi_step = (gb_up)? gi_scroll_step : -gi_scroll_step;			
			gi_max = gu_scrollContainerBody.offsetHeight - gu_scrollContainer.style.pixelHeight + 5;
			
			if (gi_max > 0)	scrollMove();
			else scrollEnd();
		}
	}
	

	
	function scrollEnd()
	{
		gu_scrollContainer = null;
		gu_scrollContainerBody = null;
		if (gh_scroll != null)
		{
			clearInterval(gh_scroll);
			gh_scroll = null;
		}
	}
	

	
	function scrollMove()
	{
		if (gu_scrollContainer != null)
		{
			var lb_end = false;
			gi_top += gi_step;
			if (gb_up && gi_top > 0)
			{
				gi_top = 0;
				lb_end = true;
			}
			else if (!gb_up && gi_top < -gi_max)
			{
				gi_top = -gi_max;
				lb_end = true;
			}

			gu_scrollContainerBody.style.top = gi_top + 'px';
			
			if (lb_end) scrollEnd();
			else if (gh_scroll == null) gh_scroll = setInterval("scrollMove()", gi_scroll_time)
		}
	}





