﻿// configuration variables
var slow_speed = 3;
var fast_speed = 15;
var top_position_scroll = 0;
var bottom_position_scroll = 174;

// no need to touch below this line
var px = "px";
var scroll_timer = null;

function contentSetup( id, top )
{
    content = document.getElementById( id ).style;
    content.htm = document.getElementById( id );
    content.top = top + px;
}

function scrollManager( action )
{
    var args = scrollManager.arguments;
    switch ( args[ 0 ] )
    {
case "scroll_page":
    content_height = content.htm.offsetHeight;
//	alert(content_height);
    switch ( args[ 1 ] )
    {
    case "up_slow":
clearInterval( scroll_timer );
//alert(content_height);
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;
    }
    }
}