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