// IMAGE ROLLOVER & PRELOAD

function menuPreload(imgList)
{
	if (document.images)
	{
		if (!document.imgContainer) document.imgContainer = new Array();
		
		for (var i = 0; i < imgList.length; i++)
		{
			var ext = (imgList[i] == section) ? "_selected" : "_rollout";
			
			document.imgContainer[imgList[i] + ext] = new Image;
			document.imgContainer[imgList[i] + ext].src = path + "img/" + imgList[i] + ext + ".png";
			document.imgContainer[imgList[i] + "_rollover"] = new Image;
			document.imgContainer[imgList[i] + "_rollover"].src = path + "img/" + imgList[i] + "_rollover.png";
		}
	}
}

function menuRollover(img)
{
	if (document.images) document[img].src = document.imgContainer[img + "_rollover"].src;
}

function menuRollout(img)
{
	var ext = (img == section) ? "_selected" : "_rollout";
	if (document.images) document[img].src = document.imgContainer[img + ext].src;
}

// FLOAT MENU CONTROLLERS

function openMenu(obj)
{
	var menuObj = (typeof obj == "string") ? document.getElementById(obj) : obj;
	
	if (menuObj)
	{
		for (var i = 0; i < menuList.length; i++)
		{
			if (menuList[i] != obj && document.getElementById(menuList[i]).menuState == "open") closeMenu(menuList[i]);
		}
		
		stopTimer(menuObj);
		createFX(menuObj, {opacity: 100}, 1000, 1.25);
		menuObj.menuState = "open";
	}
}

function timerClose()
{
	if (document.toClose)
	{
		stopTimer(document.toClose);
		createFX(document.toClose, {opacity: 0}, 1000, 1.25);
		document.toClose.menuState = "closed";
	}
}

function closeMenu(obj)
{
	var menuObj = (typeof obj == "string") ? document.getElementById(obj) : obj;
	stopTimer(menuObj);
	createFX(menuObj, {opacity: 0}, 1000, 1.25);
	menuObj.menuState = "closed";
}

function startTimer(obj)
{
	document.toClose = (typeof obj == "string") ? document.getElementById(obj) : obj;
	stopTimer(document.toClose);
	document.toClose.timerID = window.setTimeout("timerClose()", 1000);
}

function stopTimer(obj)
{
	var menuObj = (typeof obj == "string") ? document.getElementById(obj) : obj;
	if (menuObj.timerID)
	{
		window.clearTimeout(menuObj.timerID);
		menuObj.timerID = null;
	}
}