// This function stores data specific to each menu.
// DO NOT ALTER THIS CODE.
//
function MD(menuId, prop, cElements)
{
	this.menuId = menuId;
	this.prop = prop;
	this.cElements = cElements;
}

// This function write the HTML for the DHTML menus.
// This code should not need to be altered unless you are changing
// some characteristics of the menus and there is some new data
// that has been stored for the menu and it is needed for creating
// the menu.
//
function renderMenu(menuDataArray)
{
	for (i=1; i < menuDataArray.length; i++)
	{
		currMenuData = menuDataArray[i];
        
		writeMenuStart(currMenuData.menuId,
				currMenuData.prop[0], //menuHeight
				currMenuData.prop[1], //pBgColor
				currMenuData.prop[2], //pMenuName
				currMenuData.prop[3], //pTrBgColor
				currMenuData.prop[4], //pStyleOnBg
				currMenuData.prop[5], //pStyleOffBg
				currMenuData.prop[7]); //pMenuPos

		for (j=0; j<currMenuData.cElements.length; j++)
		{
			writeMenu(currMenuData.cElements[j][0],currMenuData.cElements[j][1],currMenuData.cElements[j][2],currMenuData.cElements[j][3],
				currMenuData.prop[3],
				currMenuData.prop[4],
				currMenuData.prop[5],
				currMenuData.prop[6],
				currMenuData.prop[8]); //menuItemHt
		}

		writeMenuEnd();
	}
}

// This function writes the HTML for the beginning of a given DHTML menu.
//
function writeMenuStart(pMenuId,menuHeight,pBgColor,pMenuName,pTrBgColor,pStyleOnBg,pStyleOffBg,pMenuPos)
{
	var pTabName = "menu" + pMenuName + pMenuPos;

	if (document.layers)
	{
		document.write('<layer id='+pMenuId+' visibility=hide z-index=3 onmouseout="Hide(\''+pMenuId+'\');" onmouseover="Show(\''+pMenuId+'\',\''+pTabName+'\',\''+menuHeight+'\');">');
	}
	else
	{
		document.write('<div id='+pMenuId+' Style="Position:Absolute;Visibility:hidden;z-index:3" onmouseout="menudestroy(\''+pMenuName+'\','+pMenuPos+');Hide(\''+pMenuId+'\');" onmouseover="menuactivate(\''+pMenuName+'\','+pMenuPos+');Show(\''+pMenuId+'\',\''+pTabName+'\',\''+menuHeight+'\');">');
	}

	document.write('<table border=0 cellpadding=0 cellspacing=0 bgcolor="'+pBgColor+'"> ');
	document.write('<tr><td colpspan=3><img src="img/shim.gif" width="1" height="5"></td></tr>');
}

// This function writes the HTML for each individual menu item.
//
function writeMenu(url,link,imgName,status,pTrBgColor,pStyleOnBg,pStyleOffBg,classname,menuItemHt)
{
	// Use the code below when generating a simple text link DHTML menu
	// This code can be altered in order to create the desired layout/spacing of the menu.
	//
	pAnchorTag = '<a href="'+url+'" class="'+classname+'" onmouseover="self.status=\''+status+'\';return true;" onmouseout="self.status=\'\';return true;">'+link+'</a>';


	// Use the code below when generating a DHTML menus with rollover images.
	// This code can be altered in order to create the desired layout/spacing of the menu.
	//
	//pAnchorTag = '<a href="'+url+'" class="'+classname+'" onmouseover="rollOver(\'menu'+imgName+'\',\'menu/'+imgName+'_on.gif\');" onmouseout="rollOver(\'menu'+imgName+'\',\'menu/'+imgName+'.gif\');"><img name="menu'+imgName+'" src="img/menu/'+imgName+'.gif" border="0"></a>';
	document.write('<tr bgcolor="'+pTrBgColor+'" onmouseover="javascript:style.backgroundColor=\''+pStyleOnBg+'\';" onmouseout="javascript:style.backgroundColor=\''+pStyleOffBg+'\';"><td><img src="img/shim.gif" width="8" height="'+menuItemHt+'"></td><td nowrap><img src="img/shim.gif" width="1" height="1">'+pAnchorTag+'</td><td><img src="img/shim.gif" width="30" height="'+menuItemHt+'"></td></tr>');
}


// This function writes the closing HTML for a given DHTML menu.
//
function writeMenuEnd()
{
	document.write('<tr><td colpspan=3><img src="img/shim.gif" width="1" height="5"></td></tr>');
	document.write('<tr><td colspan=3 bgcolor="#ACD5F1"><img src="img/shim.gif" width="1" height="1"></td></tr>');
	document.write('</table>');
	if (document.layers)
	{
		document.write('</layer>');
	}
	else
	{
		document.write('</div>');
	}
}
