// Parent functions

var divId
var lastDivId
var justWait

function showMe(showId) {
	if (lastDivId > '') {
		//alert ('worked');
		document.getElementById(lastDivId).className = 'level3HideMe';
	}
	if (divId == null || showId == divId) {
		
		document.getElementById(showId).className = 'level2ShowMe';
		killTimeMe();
		divId = showId
	}else if (divId != showMe) {
		//alert('argument incomplete');
		document.getElementById(showId).className = 'level2ShowMe';
		document.getElementById(divId).className = 'level2HideMe';	
		divId = showId
		killTimeMe();
	}
}

function killTimeMe () {
	clearTimeout(justWait);
	//alert('Time Out Stopped');
}	

function timeMe(Id) {
	divId = Id
	justWait = setTimeout ("hideMe()", 500);
}


function hideMe() {
	document.getElementById(divId).className = 'level2HideMe';
}

//Child functions

var divIdSub
var lastDivIdSub
var justWaitSub

function showMeSub(showIdSub) {
	if (divIdSub == null || showIdSub == divIdSub) {
		document.getElementById(showIdSub).className = 'level3ShowMe';
		killSubTimeMe();
		divIdSub = showIdSub
	}else if (divIdSub != showMeSub) {
		//alert('argument incomplete');
		document.getElementById(showIdSub).className = 'level3ShowMe';
		document.getElementById(divIdSub).className = 'level3HideMe';	
		divIdSub = showIdSub;
		killSubTimeMe();
	}
}

function killSubTimeMe () {
	clearTimeout(justWaitSub);
	//alert('Time Out Stopped');
}	

function subTimeMe(IdSub) {
	divIdSub = IdSub
	justWaitSub = setTimeout ("subHideMe()", 5);
}


function subHideMe() {
	lastDivId = divIdSub
	document.getElementById(divIdSub).className = 'level3HideMe';
}

function subHideMe2(divKill) {
	document.getElementById(divKill).className = 'level3HideMe';
}
