//////////////////////////////
// DHTML Expandable TOC Library
// By Nicholas Skapura
// Version 1.0
// September 21, 2000
// Modified by: Brian Lindner
//  January 23, 2k1
//////////////////////////////

////////// Toggle Menu //////////
// Called locally (do not call in main page)
// Object - The sub menu container
//   to make visible.
/////////////////////////
function ToggleMenu(Object)
{
	if(!Object.ISOPEN)
	{
		Object.style.display = 'none';
		Object.ISOPEN = true;
	}
	else
	{
		Object.style.display = 'block';
		Object.ISOPEN = false;
	}
}

////////// Add Menu //////////
// Adds a Main Menu Item and
// Begins the sub-menu container.
// Name - Name label to display
// SubName - ID of sub-menu container
// Title - Optional title to assign
/////////////////////////
function AddMenu(Name,SubName,Title,Address)
{
  	if(Address != null) {
		document.write("<A TITLE='" + Title + "' HREF='" + Address + "' target='frmMain'>");
	}
  
	if(Title != null)
		document.write("<DIV TITLE='" + Title + "' CLASS='MenuContainer' ONMOUSEOVER='Highlight(this);' ONMOUSEOUT='Highlight(this);' ONCLICK='ToggleMenu(" + SubName + ");'>" + Name + "</DIV>");
	else
		//document.write("<DIV CLASS='MenuContainer' ONMOUSEOVER='Highlight(this);' ONMOUSEOUT='Highlight(this);' ONCLICK='ToggleMenu(" + SubName + ");'>" + Name + "</DIV>");
		document.write("<DIV CLASS='MenuContainer' ONMOUSEOVER='window.status=boo;' ONMOUSEOUT='Highlight(this);' ONCLICK='ToggleMenu(" + SubName + ");'>" + Name + "</DIV>");
	document.write("<DIV CLASS='SubMenu' ID='" + SubName + "' ISOPEN=false>");

	if(Address != null) {
		document.write("</A>");
	}
}

////////// CloseMenu ////
// Closes the sub-menu container
/////////////////////////
function CloseMenu()
{
	document.write("</DIV>");
}

////////// Add Sub-Menu //
// Adds a sub-menu item.
// Name - Name label to display
// Address - document URL when clicked
// Title - optional title to assign
/////////////////////////
function AddSubMenu(Name,Address,Title)
{
	//document.write("--");

	if(Title != null)
		document.write("<A TITLE='" + Title + "' HREF='" + Address + "' class='SubMenuItem' target='frmMain'>");
	else
		document.write("<A HREF='" + Address + "' class='SubMenuItem' target='frmMain'>");

	document.write("<DIV class='SubMenuItem' ONMOUSEOVER='Highlight(this);' ONMOUSEOUT='Highlight(this);'>" + Name + "</DIV>");
	document.write("</A>");
}




