/*************************************************************/
/*** Written By:  Troy Millett							   ***/
/*** Date:		  07/12/2000							   ***/
/*** Version:	  1.0     								   ***/
/*** Description: Uses images to scroll layer up and down. ***/
/*************************************************************/

//*** Initialize Global Variables ***
var timer1 = null;
var MenuSelection = "One"
var OrginalYPos = 0
var speed = 2

function scroll(dir,FirstFlg) {

	//*** Create layer Object ***
	var DivLayer = eval(doc + '[MenuSelection]' + sty);
		
	//*** Reassign the parameters to local variable ***
    direction = dir;
    
    //*** Set the "OrginalYPos" only the first time the ***
	//*** function is called so it knows where the div layer started ***
	if (FirstFlg == 1 || OrginalYPos == 0)
	{	
		OrginalYPos = parseInt(DivLayer.top)
	}	
	
	//*** Set the "NewYPos" ***
	var NewYPos = parseInt(DivLayer.top);
	
	//*** Find out which direction the user wants ***
	//*** the DivLayer to scroll and move it in the direction ***
	if(direction == "dn") 
	{
		DivLayer.top = (NewYPos-(speed));
        clearTimeout(timer1);
        timer1 = setTimeout("scroll(direction,speed,0)", 1);
     }
     else if(direction == "up" && NewYPos < OrginalYPos)  
     {
		DivLayer.top = (NewYPos+(speed));
		clearTimeout(timer1);
	    timer1 = setTimeout("scroll(direction,speed,0)", 1);
     }
     else if(direction == "top") 
     {
		DivLayer.top = OrginalYPos;
     }
}

