// JavaScript Document
var nTimeOut = null;
var prevLayer = null;
var activeParent = null;

// Set these parameters.
var hideAfter = 400 //milisecconds after the dropdown should be hidden.
var parentClassDef = "mainLink"; //From CSS file
var parentClassMo = "mainLinkMo"; //From CSS file


// drop down show hide.
function initTimer(){
	nTimeOut = setTimeout("hideLayer()",hideAfter);
	//nTimeOut = setTimeout("showHide(layerId)",hideAfter);
}

function clearTimer(){
	clearTimeout(nTimeOut);
}

function showLayer(layerId){
	if(prevLayer != null){
		hideLayer();
	}
	var curLayer = document.getElementById(layerId)
	curLayer.style.display = 'block';
	prevLayer = curLayer;
}

function hideLayer(){
	if(prevLayer != null){
		prevLayer.style.display = 'none';
		restoreParentClass();
		clearTimer();
	}
}

function changeParentClass(parentID){
	//activeParent = document.getElementById(parentId)
	//activeParent.class = parentClassMo;
}

function restoreParentClass(){
	//activeParent.class = parentClassDef;
}