// ADD THE PARENT ELEMENTS' IDS HERE
var menuIDList = Array(
"development_plans"
);

/*
 *	 WCSITE Dynamic Menu
 *	 Copyright (c) 2005 by The Web Center, Inc. All rights reserved.
 *
 *	 Permission is granted to the script in this file use as needed
 *	 as long as visible credit is properly	given to The Web Center, Inc.
 *  somewhere within the site using the script.
 *
 */

// END EDITING - NO NEED TO GO DOWN FUsRTHER
// global stuff
var emod; //the event model
var currentTimer;
var currentObject;
var IEeventObject;
/////////////////////////////////////////////////
function SetWCMenuTimeOut (e)
{
   if (!currentObject.id) return;
// alert(currentObject + ': ' + currentObject.id);
	currentTimer=setTimeout("ToggleWCMenu (currentObject.id, 'hidden')",500);
}
/////////////////////////////////////////////////
// The event handler for the onMouseOver event.
function ShowWCMenu(e)
{
	currentObject = getEventObject(e);
    if (!currentObject.id) return;
    clearTimeout(currentTimer);
	ToggleWCMenu (currentObject.id, 'visible');

	return true;
}
/////////////////////////////////////////////////
function ToggleWCMenu (id, state)
{
	if (id == null) return;

	switch (emod) {
		case "IE4+":
			cssRules = 'rules';
		break;
		case "W3C":
			cssRules = 'cssRules';
		break;
	}

	// Either the parent menu button or it's submenu
	if (id.indexOf('_submenu') == -1) id = id + '_submenu';

	for (var S = 0; S < document.styleSheets.length; S++) {
		for (var R = 0; R < document.styleSheets[S][cssRules].length; R++) {
			if (document.styleSheets[S][cssRules][R].selectorText.toLowerCase() == '#' + id) {
				document.styleSheets[S][cssRules][R].style['visibility'] = state;
			}
		}
	}
	if (state == 'hidden') currentObject = '';
}
/////////////////////////////////////////////////
//The event handler for the onLoad event.
function BeginWCMenu(e)
{
 var i;
 var l = menuIDList.length;
 var submenu;

	if (window.event != null) { // IE4+
		emod= "IE4+";
		for (i=0; i<l; i++)
		{
			submenu = menuIDList[i] + '_submenu';
			if (document.all[menuIDList[i]]) {
				document.all[menuIDList[i]].onmouseover = ShowWCMenu;
				document.all[menuIDList[i]].onmouseout = SetWCMenuTimeOut;
				}
			if (document.all[submenu]) {
				document.all[submenu].onmouseover =ShowWCMenu;
				document.all[submenu].onmouseout = SetWCMenuTimeOut;
			}
		}
	} // IE4+
	else if (document.getElementById(menuIDList[0])) {
		emod= "W3C";
		for (i=0; i<l ; i++)
		{
			document.getElementById(menuIDList[i]).addEventListener("mouseover",ShowWCMenu,true);
			document.getElementById(menuIDList[i] + '_submenu').addEventListener("mouseover",ShowWCMenu,true);
			document.getElementById(menuIDList[i]).addEventListener("mouseout",SetWCMenuTimeOut,true);
			document.getElementById(menuIDList[i] + '_submenu').addEventListener("mouseout",SetWCMenuTimeOut,true);
		}
	}

	document.onclick	= 	HideAllWCmenus;
	return true;
}
/////////////////////////////////////////////////
function HideAllWCmenus ()
{
 var l = menuIDList.length;
		for (var i=0; i<l ; i++)
		{
			submenu = menuIDList[i] + '_submenu';
			ToggleWCMenu (submenu, 'hidden')
		}

}
/////////////////////////////////////////////////
function getEventObject (e)
{
	switch (emod) {
		case "IE4+":
	     e = window.event;
		 if (e.srcElement) return e.srcElement;
		 return e.srcElement.parentNode;
		break;
		case "W3C":
			return e.currentTarget;
		break;
	}
}
//assign event handler for onload event
//window.onload = BeginWCMenu;