var downTimeout = null;
var upTimeout = null;

$j(document).ready(function(){
	$content = $j("#content div");
	$height = $content.height();
	$holder_height = $j("#content").height();
	$j("#arrow_down").mouseover(function() {
		move_down();
	});
	$j("#arrow_up").mouseover(function() {
		move_up();
	});
	$j("#arrow_down").mouseout(function() {
		stop_down();
	});
	$j("#arrow_up").mouseout(function() {
		stop_up();
	});
	
	// Navigation Rollover
	$j("#nav li").hover(function(){
		$j(this).addClass("hover");
	},function(){
		$j(this).removeClass("hover");
	});
});

function move_down()
{
	$current = $content.css("top");
	$length = $current.length;
	$current_int = parseInt($current.substring(0, $length-2));
	$next_int = parseInt($current_int - 2);
	$next = $next_int+"px";
	if($current_int > -$height+$holder_height)
	{
		$content.css("top", $next);
	}
	
	downTimeout = window.setTimeout("move_down()", 20);
}

function move_up()
{
	$current = $content.css("top");
	$length = $current.length;
	$current_int = parseInt($current.substring(0, $length-2));
	$next_int = parseInt($current_int + 2);
	$next = $next_int+"px";
	if($current_int < 0)
	{
		$content.css("top", $next);
	}
	
	upTimeout = window.setTimeout("move_up()", 20);
}

function stop_down()
{
	window.clearTimeout(downTimeout);
}

function stop_up()
{
	window.clearTimeout(upTimeout);
}