
// ===================== Is06ExplorerMenuBar Class ======================================

function Is06ExplorerMenuBar (strInstanceName, strCgiPath, strAssetsPath, strShowHome)
{
	this.m_InstanceName = strInstanceName;
	this.m_CgiPath		= strCgiPath;
	this.m_AssetsPath	= strAssetsPath;
	this.m_ShowHome	    = false;
	
	if (strShowHome != null && strShowHome == 'true')
		this.m_ShowHome = true;

	this.m_src_Space = strAssetsPath + 'space.gif';				
	this.m_arrowDownImage = strAssetsPath + 'ArrowDown.gif';
	this.m_arrowDownOverImage = strAssetsPath + 'ArrowDown_over.gif';
	this.m_arrowRightImage = strAssetsPath + 'ArrowRight.gif';
	this.m_arrowRightOverImage = strAssetsPath + 'ArrowRight_over.gif';	
	this.m_arrowMenuBottom = strAssetsPath + 'PD_Bottom.gif';
	this.m_bgCompany = strAssetsPath + 'PD_Top_Company.gif';
	this.m_bgConsulting = strAssetsPath + 'PD_Top_Consulting.gif';
	this.m_bgSolution = strAssetsPath + 'PD_Top_Solutions.gif';
	this.m_bgIntegration = strAssetsPath + 'PD_Top_Integration.gif';
	this.m_bgConversion = strAssetsPath + 'PD_Top_Conversion.gif';
	this.m_bgTraining = strAssetsPath + 'PD_Top_Training.gif';
	this.m_bgCustSuccess = strAssetsPath + 'PD_Top_CustSuccess.gif';
	this.m_bgSupport = strAssetsPath + 'PD_Top_Support.gif';
	this.m_bgProducts = strAssetsPath + 'PD_Top_Products.gif';
	this.m_bgNews = strAssetsPath + 'PD_Top_News.gif';
	this.m_bgEvents = strAssetsPath + 'PD_Top_Events.gif';
	
		
	this.m_arrowRightImageWidth = "11";
	this.m_arrowRightImageHeight = "11";
	this.m_arrowDownImageWidth = "11";
	this.m_arrowDownImageHeight = "11";	

	this.m_HeaderTableId = strInstanceName + '_HeaderTable';
	this.m_HeaderMenuId  = strInstanceName + '_HeaderMenu';
	
	this.m_selectedElements = new Array(0);

	this.m_ds = new Array();
	this.m_di = 0;

	// primary display 
	Is06ExplorerMenuBar.prototype.Display = Is06ExplorerMenuBar_Display;
	Is06ExplorerMenuBar.prototype.DisplayNode = Is06ExplorerMenuBar_DisplayNode;
	
	// content page generation
	Is06ExplorerMenuBar.prototype.OpeningHtml = Is06ExplorerMenuBar_OpeningHtml;
	Is06ExplorerMenuBar.prototype.CoreHtml = Is06ExplorerMenuBar_CoreHtml;
	Is06ExplorerMenuBar.prototype.ClosingHtml = Is06ExplorerMenuBar_ClosingHtml;	
	
	// runtime support
	Is06ExplorerMenuBar.prototype.topCollectionItem_mouseover	= Is06ExplorerMenuBar_topCollectionItem_mouseover;
	Is06ExplorerMenuBar.prototype.topCollectionItem_mouseout	= Is06ExplorerMenuBar_topCollectionItem_mouseout;
		
	Is06ExplorerMenuBar.prototype.childCollectionItem_mouseover = Is06ExplorerMenuBar_childCollectionItem_mouseover;
	Is06ExplorerMenuBar.prototype.childCollectionItem_mouseout	= Is06ExplorerMenuBar_childCollectionItem_mouseout;

	Is06ExplorerMenuBar.prototype.highlightItem					= Is06ExplorerMenuBar_highlightItem;
	Is06ExplorerMenuBar.prototype.unhighlightItem				= Is06ExplorerMenuBar_unhighlightItem;

	Is06ExplorerMenuBar.prototype.linkItem_mouseover			= Is06ExplorerMenuBar_linkItem_mouseover;
	Is06ExplorerMenuBar.prototype.linkItem_mouseout				= Is06ExplorerMenuBar_linkItem_mouseout;

	Is06ExplorerMenuBar.prototype.topCollectionItem_onclick		= Is06ExplorerMenuBar_topCollectionItem_onclick;
	Is06ExplorerMenuBar.prototype.childCollectionItem_onclick	= Is06ExplorerMenuBar_childCollectionItem_onclick;
	Is06ExplorerMenuBar.prototype.linkItem_onclick				= Is06ExplorerMenuBar_linkItem_onclick;

	Is06ExplorerMenuBar.prototype.closeChildMenusOf				= Is06ExplorerMenuBar_closeChildMenusOf;
	Is06ExplorerMenuBar.prototype.closeOpenSiblingsOf			= Is06ExplorerMenuBar_closeOpenSiblingsOf;

	Is06ExplorerMenuBar.prototype.setMenuDisplayStatus			= Is06ExplorerMenuBar_setMenuDisplayStatus;
	Is06ExplorerMenuBar.prototype.resetMenus					= Is06ExplorerMenuBar_resetMenus;
	
	// image display support classes
	Is06ExplorerMenuBar.prototype.getOverlayImage				= Is06ExplorerMenuBar_getOverlayImage;
	Is06ExplorerMenuBar.prototype.getOverlaySize				= Is06ExplorerMenuBar_getOverlaySize;

	//Set isSafari
	var vendorName = navigator.vendor
	if (vendorName == null) {
		vendorName = ""
	}
	this.isSafari = (vendorName.toUpperCase() == "APPLE COMPUTER, INC.")
}

function Is06ExplorerMenuBar_Display(node)
{
	this.m_ds[this.m_di++] = 
		'<!-- Header Table -->' + 
		'<table id="' + this.m_HeaderTableId + '" class="ddm_HeaderTable" border="0" cellspacing="0" cellpadding="0"' +
		'' + ((navigator.appName == "Netscape") ? ' style="position: relative; top: -1; left: -2;"' : ' ') + ' >' +
		'	<tr>' +
		'		<td colspan="3" class="ddm_HeaderSpacerCell"><img src="' + this.m_src_Space + '" width="16" height="1"></td>' +
		'	</tr>' +
		'	<tr>' +
		'<td id="' + this.m_HeaderMenuId + '" class="ddm_HeaderMenuCell" '+/*width="701px"*/'>' +
		'';

// opening HTML for the Home node... but really binding the whole top level
		this.m_ds[this.m_di++] =
			'<table border="0" cellpadding="0" cellspacing="0">\n' +
			'<tr>\n';
// opening HTML

// core HTML
	this.DisplayNode(node);		// recursive walk...
// core HTML

// closing HTML for the Home node...
		this.m_ds[this.m_di++] =
			'	</tr>\n' +
			'</table>\n';
// closing HTML for the Home node...

	this.m_ds[this.m_di++] = 
		'	</td>' +
		'	</tr>' +
		'</table>' +	
		'';

	document.write(this.m_ds.join(''));
}

/**
 * Display the nodes recursively
 */
function Is06ExplorerMenuBar_DisplayNode (parentElement, parentPath)
{
	// Create a variable containing all children of the passed-in element. 
	var childList = parentElement.m_subNodes;

	// Call the function that generates the opening html code for a collection (the generated
	// code will typically be an opening <div> tag that will act as a container for the collection).
	this.OpeningHtml(parentElement);

	if (parentElement.m_level == 0 && this.m_ShowHome)
		this.CoreHtml(parentElement, parentPath);

	// Loop through the children of the passed-in element. For each child, run the core html function,
	// and if that child has children of its own, recursively call the DisplayNode function.
	
	for (var i=0; i<childList.length; i++)
	{		
		var childNode = childList[i];
		var nodepath  = "";
			
		if (parentPath)
		{
			nodePath = parentPath + "." + i;
		}
		else
		{
			nodePath = i.toString();
		}

		this.CoreHtml(childNode, nodePath);

		if (childNode.m_subNodes.length > 0 || childNode.m_level == 1)
		{
			this.DisplayNode(childNode, nodePath);
		}
	}

	/* Call the function that generates the closing html code for a collection (the generated
		code will typically be a closing </div> tag for the collection container).*/
		
	this.ClosingHtml(parentElement);
}

// ============== Page Data Generation functions ========================

/**
 * Opening HTML for the elements
 */
function Is06ExplorerMenuBar_OpeningHtml(parentElement)
{
	var level = parentElement.m_level;

	if (level == 0) // Home node
	{

	}
	else 
	if (level == 1) // Top-level menu items
	{
		this.m_ds[this.m_di++] =
			'<div class="ddm_TopChildCollectionContainer" style="display:none">\n' +
			//Create the top overlay
			'<table class="ddm_TopChildListTable" border="0" cellpadding="0" cellspacing="0" style="width:' + this.getOverlaySize(parentElement) + ';">\n' +
			'<tr>\n' +
			'<td class="ddm_TopCollectionItemOverlay" style="background-image: url(' + this.getOverlayImage(parentElement) + ');" >\n' +
			//'<div class="ddm_TopCollectionOverlay" style="display:none; background-image: url(' + this.getOverlayImage(parentElement) + '); style="width:' + this.getOverlaySize(parentElement) + ';">\n' +
			parentElement.m_label +
			'</td>\n' +
			'</tr>\n' +
			'</table>\n' + 
			'</div>\n' +
			'<div class="ddm_TopChildCollectionContainer" style="display:none">\n' +
			'<table class="ddm_TopChildListTable" border="0" cellpadding="0" cellspacing="0">\n';
	}
	else							// Child menu items
	{
		this.m_ds[this.m_di++] =
			'<div class="ddm_SubChildCollectionContainer" style="display:none">\n' +
			'	<table class="ddm_SubChildListTable" border="0" cellpadding="0" cellspacing="0">\n' +
			'		<tr>\n' +
			'			<td>\n' +
			'				<img src="' + this.m_src_Space + '" width="1" height="2"></td>\n' +
			'		</tr>\n';
	}
}

/**
 * Core HTML for the elements
 */
function Is06ExplorerMenuBar_CoreHtml(childElement, nodeLocation)
{
	var label = childElement.m_label;
	var id = nodeLocation;

	var level = childElement.m_level;
	
	if (level == 0) // Home node
	{

	}
	else
	if (level == 1) // Top-level menu items
	{
		var linkTarget = "_self";
		var url = childElement.m_href.replace(/'/g, "\\'");
				// * "collection"
				this.m_ds[this.m_di++] =
					'<td id="' + id + '"' +
	/* bjn */ 		' onclick="' + this.m_InstanceName + '.linkItem_onclick(event, this, \'' + url + '\', \'' + linkTarget + '\')"' +
					' onmouseover="' + this.m_InstanceName + '.topCollectionItem_mouseover(event, this)"' +
					' onmouseout="' + this.m_InstanceName + '.topCollectionItem_mouseout(event, this)">\n' +
					'	<table class="ddm_TopCollectionItemTable" border="0" cellpadding="0" cellspacing="0">\n' +
					'		<tr>\n' +
					'			<td class="ddm_TopCollectionItem">\n' + 
					'' + label + '</td>\n' + '<td class="ddm_MenuSeparator">\n' + ((nodeLocation != 9) ? '|' : '') + '</td>\n' +
					'		</tr>\n' +
					'</table>\n';
	}
	else // Child menu items
	{
		var linkTarget = "_self";
		var url = childElement.m_href.replace(/'/g, "\\'");

		if (childElement.m_subNodes.length == 0)
		{	// "item"
			this.m_ds[this.m_di++] =
				'<tr>\n' +
				'	<td id="' + id + '" class="ddm_ChildLinkItem"' +
				' onclick="' + this.m_InstanceName + '.linkItem_onclick(event, this, \'' + url + '\', \'' + linkTarget + '\')"' +
				' onmouseover="' + this.m_InstanceName + '.linkItem_mouseover(this)"' +
				' onmouseout="' + this.m_InstanceName + '.linkItem_mouseout(this)">\n' +
				'	' + label + '\n' +
				'	</td>\n' +
				'</tr>\n';
		}
		else 
		{ // "collection"
			this.m_ds[this.m_di++] =			
				'<tr>\n' +
				'	<td id="' + id + '"' +
/* bjn */			' onclick="' + this.m_InstanceName + '.linkItem_onclick(event, this, \'' + url + '\', \'' + linkTarget + '\')"' +
				' onmouseover="' + this.m_InstanceName + '.childCollectionItem_mouseover(event, this)"' +
				' onmouseout="' + this.m_InstanceName + '.childCollectionItem_mouseout(event, this)">\n' +
				'		<table class="ddm_ChildCollectionItemTable" style="width:100%" border="0" cellpadding="0" cellspacing="0">\n' +
				'			<tr>\n' +
				'				<td class="ddm_ChildCollectionItem">\n' +
				'					' + label + '</td>\n' +
				'			</tr>\n' +
				'		</table>\n';
		}
	}
}

/**
 * Closing HTML for elements
 */
function Is06ExplorerMenuBar_ClosingHtml(parentElement)
{
	var level = parentElement.m_level;

	if (level == 0) // Home node
	{

	}
	else 
	if (level == 1) // Top-level menu items
	{
		if(parentElement.m_subNodes.length > 0) {
		this.m_ds[this.m_di++] =
			'			<tr>\n' +
			'				<td>\n' +		// ph:
			'					<img src="' + this.m_arrowMenuBottom + '" width="130" height="9"></td>\n' +
			'		</tr>\n' +
			'		</table>\n' +
			'	</div>\n' +
			'</td>\n'; // Closing tag for parent cell
		} else { //If no children, don't add bottom bar
		this.m_ds[this.m_di++] =
			'		</table>\n' +
			'	</div>\n' +
			'</td>\n'; // Closing tag for parent cell
		}
	}
	else							// Child menu items
	{
		this.m_ds[this.m_di++] =
			'			<tr>\n' +
			'				<td>\n' +
			'					<img src="' + this.m_src_Space + '" width="1" height="2"></td>\n' +
			'			</tr>\n' +
			'		</table>\n' +
			'	</div>\n' +
			'	</td>\n' + // Closing tag for parent cell.
			'</tr>\n'; // Closing tag for parent row.
	}
}

// ============= Runtime Support Functions =============================

/**
 * Specifies what to happen to a top collection item when the
 * mouse moves over the item.
 * @param element		the top collection item element
 */
function Is06ExplorerMenuBar_topCollectionItem_mouseover(e, element)
{
	var menuBottomBorder = null;
	var menuBottomPadding = null;
	//Offset the menu position with the
	//css position of the menu.
	var topOffset = -20;
	var leftOffset = 18 - 2;
	
	if (navigator.appName == "Netscape")
	{
		menuBottomBorder = parseInt(document.getElementById(this.m_HeaderMenuId).style.borderBottomWidth);
		menuBottomPadding = parseInt(document.getElementById(this.m_HeaderMenuId).style.paddingBottom);
	}
	else //IE Branch
	{
		menuBottomBorder = parseInt(document.getElementById(this.m_HeaderMenuId).currentStyle.borderBottomWidth);
		menuBottomPadding = parseInt(document.getElementById(this.m_HeaderMenuId).currentStyle.paddingBottom);	
	}					

	this.highlightItem(element);

	//Set up header information
	var headerTable = document.getElementById(this.m_HeaderTableId);
	var headerHeight = parseInt(headerTable.offsetHeight);
	var headerTop = parseInt(headerTable.offsetTop);		
	var headerLeft = parseInt(headerTable.offsetLeft);		
	var trikLeft = 0;
	var trikTop = 0;
	var container = headerTable.offsetParent;				

	while (container)
	{
		trikLeft += container.offsetLeft;
		trikTop += container.offsetTop;			
		container = container.offsetParent;
	}

	if (isNaN(menuBottomBorder)) { menuBottomBorder = 0 }
	if (isNaN(menuBottomPadding)) { menuBottomPadding = 0 }
	headerHeight = parseInt(headerHeight) - parseInt(menuBottomBorder) - parseInt(menuBottomPadding);

	// Specifies two div elements because they top item is comprised of
 	// two divs (the overlay image and the menu).
	if (element.getElementsByTagName("div").length > 0)
	{
		//Show overlay
		var childMenu = element.getElementsByTagName("div")[0];
		
		if (this.isSafari) {
			childMenu.style.top =  2;
			childMenu.style.left = element.offsetLeft + 16;
		} else {
			childMenu.style.top = trikTop + headerTop + headerHeight + topOffset;
			childMenu.style.left = trikLeft + headerLeft + element.offsetLeft + leftOffset;
		}

		childMenu.style.display = "block";

		this.setMenuDisplayStatus(childMenu, "on");
		
		//Show menu
		var childMenu2 = element.getElementsByTagName("div")[1];

		if (this.isSafari) {
			childMenu2.style.top =  2 - topOffset;
			childMenu2.style.left = element.offsetLeft + 16;
		} else {
			childMenu2.style.top = trikTop + headerTop + headerHeight;
			childMenu2.style.left = trikLeft + headerLeft + element.offsetLeft + leftOffset;
		}

		childMenu2.style.display = "block";
		
		this.setMenuDisplayStatus(childMenu2, "on");
	}		
}

/**
 * Specifies what to happen to a top collection item when the
 * mouse moves off the item.
 * Specifies two div elements because they top item is comprised of
 * two divs (the overlay image and the menu).
 * @param element		the top collection item element
 */
function Is06ExplorerMenuBar_topCollectionItem_mouseout(e, element)
{
	if (!e) { e = window.event; }		
	this.unhighlightItem(element);

	if (element.getElementsByTagName("div").length > 0)
	{			
		var childMenu = element.getElementsByTagName("div")[0];
		childMenu.style.display = "none";

		this.setMenuDisplayStatus(childMenu, "off");
		
		var childMenu2 = element.getElementsByTagName("div")[1];
		childMenu2.style.display = "none";
		
		this.setMenuDisplayStatus(childMenu2, "off");
	}
}

/**
 * Specifies what to happen to a child collection item when the
 * mouse moves over the item.
 * @param element		the child collection item element
 */
function Is06ExplorerMenuBar_childCollectionItem_mouseover(e, element)
{
	if (navigator.appName == "Netscape")
	{
		this.highlightItem(element);
	}
	else
	{
		this.highlightItem(element);
	}
}

/**
 * Unhilights an item element by changing its class from
 * its regular varient to its over varient
 * @param element		the item element to highlight
 */
function Is06ExplorerMenuBar_highlightItem(element)
{
	var itemDisplayTable = element.getElementsByTagName("table")[0];

	// Set style for item's display table element.
	if (itemDisplayTable.className == "ddm_TopCollectionItemTable")
	{
		itemDisplayTable.className = "ddm_TopCollectionItemTable_over";
	}
	else if (itemDisplayTable.className == "ddm_ChildCollectionItemTable")
	{
		itemDisplayTable.className = "ddm_ChildCollectionItemTable_over";
	}

	var tableCells = itemDisplayTable.getElementsByTagName("td")
	for (var i=0; i<tableCells.length; i++)
	{
		// Set style for item's label cell element.
		if (tableCells[i].className == "ddm_TopCollectionItem")
		{
			tableCells[i].className = "ddm_TopCollectionItem_over";
		}
		else if (tableCells[i].className == "ddm_ChildCollectionItem")
		{
			tableCells[i].className = "ddm_ChildCollectionItem_over";
		}
	}
}

/**
 * Specifies what to happen to a child collection item when the
 * mouse moves off the item.
 * @param element		the child collection item element
 */
function Is06ExplorerMenuBar_childCollectionItem_mouseout(e, element)
{
	if (!e) { e = window.event; }

	if (navigator.appName == "Netscape") // NN/Mozilla
	{
		if (element.getElementsByTagName("div").length > 0)
		{	
			//Hide overlay
			var childMenu = element.getElementsByTagName("div")[0];
			if (childMenu.style.display == "none")
			{
				this.unhighlightItem(element);
			}
		}				
	}
	else // IE
	{
		this.unhighlightItem(element);

		if (element.getElementsByTagName("div").length > 0)
		{			
			//Hide overlay
			var childMenu = element.getElementsByTagName("div")[0];
			childMenu.style.display = "none";

			this.setMenuDisplayStatus(childMenu, "off");
		}
	}
}

/**
 * Unhilights an item element by changing its class from
 * its over varient to its regular varient
 * @param element		the item element to unhighlight
 */
function Is06ExplorerMenuBar_unhighlightItem(element)
{
	var itemDisplayTable = element.getElementsByTagName("table")[0];

	// Set style for item's display table element.
	if (itemDisplayTable.className == "ddm_TopCollectionItemTable_over")
	{
		itemDisplayTable.className = "ddm_TopCollectionItemTable";
	}
	else if (itemDisplayTable.className == "ddm_ChildCollectionItemTable_over")
	{
		itemDisplayTable.className = "ddm_ChildCollectionItemTable";
	}

	var tableCells = itemDisplayTable.getElementsByTagName("td")
	for (var i=0; i<tableCells.length; i++)
	{
		// Set style for item's label cell element.
		if (tableCells[i].className == "ddm_TopCollectionItem_over")
		{
			tableCells[i].style.backgroundImage = "none";
			tableCells[i].className = "ddm_TopCollectionItem";
		}
		else if (tableCells[i].className == "ddm_ChildCollectionItem_over")
		{
			tableCells[i].className = "ddm_ChildCollectionItem";
		}
	}
}

/**
 * Specifies what to do when the mouse move onto a link item
 * Changes the class from its regular varient to its over varient
 * @param element		the link item element
 */
function Is06ExplorerMenuBar_linkItem_mouseover(element)
{		
	if (element.className == "ddm_TopLinkItem")
	{
		element.className = "ddm_TopLinkItem_over";
		
		if(element.id == 1) {	//Consulting
			element.style.backgroundImage = "url(" + this.m_bgConsulting + ")";
		}
		else if(element.id == 2) {	//Integration
			element.style.backgroundImage = "url(" + this.m_bgIntegration + ")";
		}
	}

	else if (element.className == "ddm_ChildLinkItem")
	{
		element.className = "ddm_ChildLinkItem_over";
	}				
}

/**
 * Specifies what to do when the mouse moves off of a link item
 * Changes the class from its over varient to its regular varient
 * @param element		the link item element
 */
function Is06ExplorerMenuBar_linkItem_mouseout(element)
{
	if (element.className == "ddm_TopLinkItem_over")
	{
		element.style.backgroundImage = "none";
		element.className = "ddm_TopLinkItem";
	}

	else if (element.className == "ddm_ChildLinkItem_over")
	{
		element.className = "ddm_ChildLinkItem";
	}
}

/**
 * Specifies what to do when a top collection item is clicked on.
 * @param element		the top collection item element
 */
function Is06ExplorerMenuBar_topCollectionItem_onclick(e, element)
{
	var headerTable  = document.getElementById(this.m_HeaderTableId);
	var headerHeight = headerTable.offsetHeight;

	var trikLeft = 0;
	var trikTop = 0;
	
	var container = headerTable.offsetParent;				
	while (container)
	{
		trikLeft += container.offsetLeft;
		trikTop += container.offsetTop;			
		container = container.offsetParent;
	}

	if (navigator.appName == "Netscape")
	{
		if (element.getElementsByTagName("div").length > 0)
		{				
			var childMenu = element.getElementsByTagName("div")[0];

			if (childMenu.style.display == "none")
			{
				this.resetMenus();
				childMenu.style.top = headerHeight + trikTop;
				childMenu.style.left = element.offsetLeft + trikLeft;
				childMenu.style.display = "block";
				this.setMenuDisplayStatus(childMenu, "on");
			}
			else if (childMenu.style.display == "block")
			{
				this.resetMenus();
				this.highlightItem(element);
				/* Note: have to rehighlight the element since the mouse is logically
					still over this element, and the closeChildMenusOf function loop sets parent
					elements of ALL child menus (including the target) back to regular style */
			}
		}

		e.stopPropagation();
	}

	else // IE Branch
	{
		e.cancelBubble = true;
	}
}

/**
 * Specifies what to do when a child collection item is
 * clicked on.
 * @param element		the child collection item element
 */
function Is06ExplorerMenuBar_childCollectionItem_onclick(e, element)
{
	if (navigator.appName == "Netscape")
	{
		if (element.getElementsByTagName("div").length > 0)
		{				
			var childMenu = element.getElementsByTagName("div")[0];

			if (childMenu.style.display == "none")
			{
				this.closeOpenSiblingsOf(element);
				childMenu.style.top = element.offsetTop;
				childMenu.style.left = element.offsetParent.offsetWidth;
				childMenu.style.display = "block";
				this.setMenuDisplayStatus(childMenu, "on");
			}
			else if (childMenu.style.display == "block")
			{
				this.closeChildMenusOf(element);
				this.highlightItem(element);
				/* Note: have to rehighlight the element since the mouse is logically
					still over this element, and the closeChildMenusOf function loop sets parent
					elements of ALL child menus (including the target) back to regular style */
			}
		}

		e.stopPropagation();
	}
	else // IE Branch
	{
		e.cancelBubble = true;
	}
}

/**
 * Provides hyperlinks for items in the menu without 
 * using an anchor tag.
 * Opens a url in the target window.
 * @param element		element to have a hyperlink
 * @param url			url of the hyperlink
 * @param target		target window of the hyperlink
 */
function Is06ExplorerMenuBar_linkItem_onclick(e, element, url, target)
{
	if (target == "")
	{
		target = "_self";
	}
	window.open(url, target);
	this.resetMenus();

	if (navigator.appName == "Netscape")
	{
		if (element.className == "ddm_ChildLinkItem_over")
		{
			element.className = "ddm_ChildLinkItem";
		}
		else if (element.className == "ddm_TopLinkItem_over")
		{
			element.className = "ddm_TopLinkItem";
		}			
		e.stopPropagation();
	}
// bjn 	
	else // IE Branch
	{
		e.cancelBubble = true;
	}
}

/**
 * Closes an element's associated child menu as well as all 
 * decendents of that menu.
 * @param element		Specified element
 */
function Is06ExplorerMenuBar_closeChildMenusOf(element)
{ 
	var decendentMenus = element.getElementsByTagName("div");

	for (var i=decendentMenus.length-1; i>=0; i--)
	{
		var childMenu = decendentMenus[i];		

		this.unhighlightItem(childMenu.parentNode);
		
		childMenu.style.display = "none";

		this.setMenuDisplayStatus(childMenu, "off");
	}
}

/**
 * Close all the siblings of the specified element.
 * @param element		Element to find siblings of
 */
function Is06ExplorerMenuBar_closeOpenSiblingsOf(element)
{
	var hierarchyLevel = element.id.split(".").length;
	
	if (hierarchyLevel == 1) // Top-level items
	{
		var siblingCellElements = element.parentNode.cells;
		
		for (var i=0; i<siblingCellElements.length; i++)
		{
			var siblingCellElement = siblingCellElements[i];
			
			if (siblingCellElement.getElementsByTagName("div").length > 0)
			{
				if (siblingCellElement.getElementsByTagName("div")[0].style.display == "block" && siblingCellElement != element)
				{
					this.closeChildMenusOf(siblingCellElement);
				}
			}				
		}			
	}
	else // Sub-level items
	{
		var siblingRowElements = element.parentNode.parentNode.rows; // Note: had to use parentNode twice to get past the TBODY element to the TABLE element.

		for (var i=0; i<siblingRowElements.length; i++)
		{
			var siblingCellElement = siblingRowElements[i].cells[0];

			if (siblingCellElement.getElementsByTagName("div").length > 0)
			{
				if (siblingCellElement.getElementsByTagName("div")[0].style.display == "block" && siblingCellElement != element)
				{
					this.closeChildMenusOf(siblingCellElement);
				}
			}
		}
	}
}

/**
 * Adds and removes elements from the selectedElements array based
 * on their status (On or Off).
 *
 * This function uses a global array (defined above) to record element references
 * to all menu containers that are currently visible.
 *
 * @param menuElement		Element to add or remove
 * @param status		Status of element "On" or "Off"
 */
function Is06ExplorerMenuBar_setMenuDisplayStatus(menuElement, status)
{
	if (status == "on")
	{
		/* If setting status to "on", add the element to the selectedElements array. */
		var alreadyOn = false;
		for (var i=0; i<this.m_selectedElements.length; i++)
		{
			if (this.m_selectedElements[i] == menuElement)
			{
				alreadyOn = true;
				break;
			}
		}

		if (!alreadyOn)
		{
			this.m_selectedElements.concat(new Array(menuElement));
		}
	}
	else if (status == "off")
	{
		/* If setting status to "off", loop through the selectedElements array and
			find the array item that matches the current menu element and remove it
			from the array. */
		for (var i=0; i<this.m_selectedElements.length; i++)
		{
			if (this.m_selectedElements[i] == menuElement)
			{
				this.m_selectedElements.splice(i, 1); //Removes the selected element from the array.
				break;
			}
		}
	}
}

/**
 * Resets the menu by gathering all of the elements by
 * their id number
 */
function Is06ExplorerMenuBar_resetMenus(e)
{
	var i = 0;
	var topLevelMenuCell = document.getElementById(i.toString());
	while (topLevelMenuCell != null)
	{			
		if (topLevelMenuCell.getElementsByTagName("div").length > 0 && topLevelMenuCell.getElementsByTagName("div")[0].style.display == "block")
		{
			this.closeChildMenusOf(topLevelMenuCell);
		}
		i++;
		topLevelMenuCell = document.getElementById(i.toString());
	}

	this.m_selectedElements.length = 0; // Clear out the array.
}

/**
 * Return the overlay image for the specified element
 * based on its label
 * @param element		Element to check
 */
function Is06ExplorerMenuBar_getOverlayImage(element) {
	switch(element.m_label) {
		case 'Company':			return this.m_bgCompany;
		case 'Conversion':		return this.m_bgConversion;
		case 'Consulting':		return this.m_bgConsulting;
		case 'Integration':		return this.m_bgIntegration;
		case 'Solutions':		return this.m_bgSolution;
		case 'Training':		return this.m_bgTraining;
		case 'Customer Success':	return this.m_bgCustSuccess;
		case 'Support':			return this.m_bgSupport;
		case 'Products':		return this.m_bgProducts;
		case 'News':			return this.m_bgNews;
		case 'Events':			return this.m_bgEvents;
	}
}

/**
 * Return the size for the overlay image for the
 * specified element based on its label
 * @param element		Element to check
 */
function Is06ExplorerMenuBar_getOverlaySize(element) {
	switch(element.m_label) {
		case 'Company':			return 70;
		case 'Conversion':		return 86 - 1;
		case 'Consulting':		return 85 - 2;
		case 'Integration':		return 88 - 3;
		case 'Solutions':		return 77 - 2;
		case 'Training':		return 65;
		case 'Customer Success':	return 126;
		case 'Support':			return 70 - 4;
		case 'Products':		return 77 - 4;
		case 'News':			return 50 - 2;
		case 'Events':			return 60 - 3;
	}
}

// ==================== the end ===========================
