<!--
//--- Requires lauerUtils.js

var timerRunning = false; // boolean flag
var myTimer = null;

/**
 *	 Note: I'm not doing anything fancy here; I'm hard-coding the layer visibility/invisiblity in
 *	 the function as there are only two layers to deal with; this should be rewritten in the future. 
 **/
 
/*
May 2006 - adopting for FatigueImpairment.ca needs
Layers to deal with:
	mnuFatigueImpairment
	mnuCanadasPlan
	mnuNews
	mnuMaterials
*/
function showMenuLayer(visibleLayerName){
	cancelTimeout();
	
	hideAllMenuLayers()
	showLayer(getLayer(visibleLayerName));
}

function hideLayerTmOut(layerName){
	timerRunning = false;
	hideLayer(getLayer(layerName));
}

function hideLayerTimeout(layerName){
	myTimer = setTimeout("hideLayerTmOut('"+layerName+"')", 1000);
	timerRunning = true;
}

function cancelTimeout(){
    if (timerRunning)
        clearTimeout(myTimer);
}

function hideAllMenuLayers(){
	hideLayer(getLayer("mnuFatigueImpairment"));
	hideLayer(getLayer("mnuCanadasPlan"));
	hideLayer(getLayer("mnuNews"));
	
	hideLayer(getLayer("mnuFacts"));
	hideLayer(getLayer("mnuMaterials"));
}

//-->
