//<script>
var mF = "";
var mT = 100;
var mFchild = "";
var mTchild = 100;
var	show = "block";
var	hide = "none";
var openItems = new Array();

function showChild(parentID, childID, src)
{
	if (mF)
	{
		eval(mF);
		clearTimeout(mT);
		clearTimeout(mTchild);
	}
	showHide(parentID, show);
	showHide(childID, show);
	if (src)
	{
	    src.firstChild.style.backgroundColor = "#FFB017";
	}
}

function showChild2(parentID, childID)
{
	if (mFchild)
	{
		eval(mFchild);
		clearTimeout(mTchild);
	}
	showHide(parentID, show);
	showHide(childID, show);
}

function hideAll(childID, src)
{
    mFchild = "menuSwapChild('" + childID + "', hide)";
    mTchild = setTimeout(mFchild, 200);;
	mF = "menuSwap()";
	mT = setTimeout(mF, 200);
	if (src)
	{
	    src.firstChild.style.backgroundColor = "";
	}
}

function menuSwap()
{
    mF = "";
    
    itemsLength = openItems.length;
   
	for (var i = 0; i < itemsLength; i++)
	{
	    showHide(openItems[i], hide);
	}
	openItems = new Array();;
}

function menuSwapChild(childID)
{
    mFchild = "";
    showHide(childID, hide);
}

function showHide(elementID, vizProp)
{
	element = document.getElementById(elementID);
	if (element)
	{
		element.style.display = vizProp;
		openItems.push(elementID);
	}
}
