// configuration variables
var slow_speed = 3;
var fast_speed = 12;
var top_position_scroll = 10;
var bottom_position_scroll = 200;

// no need to touch below this line
var px = "px";
var scroll_timer = null;

function contentSetup(id,top)
{
	//alert(top);
    content2 = document.getElementById(id).style;
	//alert(content);
    content2.htm = document.getElementById(id);
    content2.top = top + px;
}


function scrollManager( action )
{
    var args = scrollManager.arguments;
    switch ( args[ 0 ] )
    {
	case "scroll_page":
    	content_height = content2.htm.offsetHeight-50;
    	switch ( args[ 1 ] )
    	{
    	case "up_slow":
		clearInterval( scroll_timer );
		scroll_timer = setInterval( "if(parseInt(content2.top)>-(content_height-bottom_position_scroll)){content2.top=(parseInt(content2.top)-slow_speed+px);}else{clearInterval(scroll_timer);}", 40 );
		break;
    	case "up_fast":
		clearInterval( scroll_timer );
		scroll_timer = setInterval( "if(parseInt(content2.top)>-(content_height-bottom_position_scroll)){content2.top=(parseInt(content2.top)-fast_speed+px);}else{clearInterval(scroll_timer);}", 20 );
		break;
    	case "dn_slow":
		clearInterval( scroll_timer );
		scroll_timer = setInterval( "if(parseInt(content2.top)<top_position_scroll){content2.top=(parseInt(content2.top)+slow_speed+px);}else{clearInterval(scroll_timer);}", 40 );
		break;
    	case "dn_fast":
		clearInterval( scroll_timer );
		scroll_timer = setInterval( "if(parseInt(content2.top)<top_position_scroll){content2.top=(parseInt(content2.top)+fast_speed+px)}else{clearInterval(scroll_timer);}", 20 );
		break;
    	case "all_stop":
		clearInterval( scroll_timer );
		break;
		case "return_top":
		content2.top = 10+px; 
		break;
    	}
    }
}