/* scripts to control hiding and showing layers */

function hide(nav)
{
	if (document.layers) nav.visibility = 'hide';
	else nav.style.visibility = 'hidden';
}

function show(nav)
{
	if (document.layers) nav.visibility = 'show';
	else nav.style.visibility = 'visible';		
}


/* script to control drop-down scrolling */

	var interval = 75; // controls the scrolling speed

	var numvert = 0;
	var distance = 11; // height of each row (this should be divisible evenly by the total height of every nav)
	var intervalID;
	
	function start(direction, thissection)
	{
		thesection = thissection + '_slider';
		section = thissection;
		nav = document.getElementById(thesection);
		nav.style.top = numvert + 'px';
		intervalID = setInterval('move' + direction + '(nav, section)', interval);
	}
	
	function stop()
	{
		clearInterval(intervalID);
	}

	function moveup(nav, section)
	{
		if (section == 'menu_select_story') bottomnum = 0; // (ORG -99)This is the height of the nav minus the distance between the top and bottom of the nav, minus 2 times the distance value, made negative
		if (section == 'menu_resources') bottomnum = 0; // (ORG -99)This is the height of the nav minus the distance between the top and bottom of the nav, minus 2 times the distance value, made negative
		
		// you may need to make french and english values for the above numbers
		
		if (numvert < 0)
		{
			numvert = numvert + distance;
			nav.style.top = numvert + 'px';

			if (numvert == 0)
			{
				thesection = section + '_up';
				hide(document.getElementById(thesection));
				if (section == 'menu_select_story') swapOffMenu('arrow_up');
				if (section == 'menu_resources') swapOffMenu('res_arrow_up');
				clearInterval(intervalID);
			}
			if (numvert == bottomnum)
			{
				thesection = section + '_down';
				show(document.getElementById(thesection));
			}
		}
	}
	
	function movedown(nav, section)
	{
		if (section == 'menu_select_story') bottomnum = -33; // (ORG -132) This is the height of the nav minus the distance between the top and bottom of the nav, minus the distance value, made negative
		if (section == 'menu_resources') bottomnum = -33; // (ORG -132) This is the height of the nav minus the distance between the top and bottom of the nav, minus the distance value, made negative
		
		// you may need to make french and english values for the above numbers

		if (numvert > bottomnum)
		{
			numvert = numvert - distance;
			nav.style.top = numvert + 'px';
			if (numvert == bottomnum)
			{
				thesection = section + '_down';
				hide(document.getElementById(thesection));
				if (section == 'menu_select_story') swapOffMenu('arrow_down');
				if (section == 'menu_resources') swapOffMenu('res_arrow_down');
				clearInterval(intervalID);
			}
			if (numvert == -11) // This is the distance value, made negative
			{
				thesection = section + '_up';
				show(document.getElementById(thesection));
			}
		}
	}


