// set global browser identification variables
browser = navigator.appName;
browserNum = parseInt(navigator.appVersion);
N4 = false;
N6 = false;
IE = false;
		
if ((browser == "Netscape") && (browserNum < 5))
{
	// Netscape 4.x
	layerRef = "document.layers['";
	endLayerRef = "']";
	styleRef = "";
	N4 = true;
}
else if ((browser == "Netscape") && (browserNum >= 5))
{
	// Netscape 6
	layerRef = "document.getElementById('";
	styleRef = ".style";
	endLayerRef = "')";
	N6 = true;
}
else
{
	// Internet Explorer
	layerRef = "document.all['";
	endLayerRef = "']";
	styleRef = ".style";
	IE = true;
}
		
// create way to remember which layer is visible
oldLayer = "none";
		
// set animation variables
initialTop = 120;
newTop = initialTop;
		
function showMenu(layerName)
{
	// show the layer the user wants to see
	eval(layerRef + layerName + endLayerRef + styleRef + ".visibility = 'visible'");
			
			
	// move other window
	if (oldLayer != "none")
	{
	// alter z-indices of layers to place
	// the new menu above older menu
	eval(layerRef + layerName + endLayerRef + styleRef + ".zIndex = 11");
	eval(layerRef + oldLayer + endLayerRef + styleRef + ".zIndex = 10");
				
	// slide the old menu layer up and out of sight
	slideMenu(oldLayer);
}
			
	// update which window is currently visible
	if (oldLayer == layerName)
	{
		oldLayer = "none";
	}
	else
	{
		oldLayer = layerName;
	}
	
}
		
function slideMenu(layerName)
{
	// find layer height
	if(N4)
	{
		height = eval(layerRef + layerName + endLayerRef + ".clip.height");
	}
	else
	{
		height = eval(layerRef + layerName + endLayerRef + ".offsetHeight");
	}
			
	// animate the layer upwards
	//moveLayer(layerName,height);
	eval(layerRef + layerName + endLayerRef + styleRef + ".visibility = 'hidden'");	
	return;
}
		
function moveLayer(layerName,height)
{
	// newTop and initialTop are global variables, set earlier
	endTop = initialTop - height;
	newHeight = height - newTop;
			
	if(newTop > endTop)
	{
		// move layer again
		newTop = newTop - 20;
		eval(layerRef + layerName + endLayerRef + styleRef + ".top = " + newTop);
		//eval(layerRef + layerName + endLayerRef + ".offsetHeight = " + newHeight);
	}
	else
	{
		// hide the old menu and reset its position
		eval(layerRef + layerName + endLayerRef + styleRef + ".visibility = 'hidden'");
		eval(layerRef + layerName + endLayerRef + styleRef + ".top = " + initialTop);
				
		// reset global variable in preparation for the next menu
		newTop = initialTop;
		return;
	}

	// wait a bit, then call this function again
	setTimeout("moveLayer('" + layerName + "'," + height + ")",1);
}