// Raland Therapeutics General Scripts

// Toggles More Information on and off
function ToggleShowHide(tID, eID, showText, hideText)
{
	
	var t = document.getElementById(tID);
	var e = document.getElementById(eID);
	
	
	// Show or Hide
	if (e.style.display == "block")
	{
		// Hide
		e.style.display = "none";
		t.innerHTML = showText;
	} else
	{
		// Show
		e.style.display = "block";
		t.innerHTML = hideText;	
	}
}

// Menu functions
var closeTimer = 0;
var menuRef = 0;

// Hide the menu
function menuHide()
{
	if 	(menuRef)
	{
		menuRef.style.visibility = "hidden";
	}
	
	// Close the timer
	menuCancelCloseTimer();
	
}

// Give the user a chance to leave the top menu and enter a submenu
function menuCloseTimer()
{
	closeTimer = window.setTimeout(menuHide,500);	
}

// Cancel the timer
function menuCancelCloseTimer()
{
	if (closeTimer)
	{
		window.clearTimeout(closeTimer);
		closeTimer = null;
	}
}


// Show the drop menu
function menuOpen(menuID)
{
	menuHide(); 
	
	menuRef = document.getElementById(menuID);
	menuRef.style.visibility = "visible";
}
