
get_null = function() { return null; }
if (!document.getElementById) {
	document.getElementById = get_null;
}

function expand(s)
{
  var td = s;
  var d = td.getElementsByTagName("div").item(0);
  td.className = "menuHover";
  td.background = "/images/topnavBG2.gif";
  ypos=findYpos();
  d.style.position="absolute";
  d.style.top=ypos;
  d.className = "menuHover";
}

function collapse(s)
{
  var td = s;
  var d = td.getElementsByTagName("div").item(0);
  td.className = "menuNormal";
  td.background = "/images/topnavBG.gif";
  d.className = "menuNormal";
}

function findYpos()
{
  var t = document.getElementById("menuTbl").offsetTop;
  var h = document.getElementById("menuTbl").offsetHeight;
  return t+h;
}

function displayTopMenu (menuTitles,menuLinks,menuWidth,subMenus,currentTab)
{
document.write("<table background=\"/images/topnavBG.gif\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" id=\"menuTbl\"><tr>");
for (var i = 0; i < menuTitles.length; i++) 
	{
	document.write ("<td width=\"2\"><img src=\"/images/topnavEdge.gif\" width=\"2\" height=\"22\" border=\"0\"></td>");
	if (currentTab != "" && currentTab == i)
		{
		document.write ("<td class=\"menuCurrent\" height=\"22\" width=\""+menuWidth[i]+"\">");
		document.write("<center>"+menuTitles[i]+"</center>");
		}
	else
		{
		document.write ("<td height=\"22\" width=\""+menuWidth[i]+"\" onmouseover=\"expand(this);\" onmouseout=\"collapse(this);\">");
		document.write("<center><a class=\"new1\" href=\""+menuLinks[i][0]+"\">"+menuTitles[i]+"</a></center>");

		if(subMenus != "")
			{
			document.write("<div class=\"menuNormal\">");
			document.write("<table cellspacing=\"0\" cellpadding=\"0\" class=\"menu\" width=\"155\">");
			for(var j=0;j<subMenus[i].length;j++)
				{
				if(subMenus[i][j]!="")
					{
					document.write("<tr>");
					document.write("<td align=\"center\" class=\"submenuNormal\" ><a class=\"submenuitem\" href=\""+menuLinks[i][j]+"\">"+subMenus[i][j]+"</a></td>");
					//class=\"menuitem\" after +"
					document.write("</tr>");
					}
				}
			document.write("</table>");
			document.write("</div>");
			}
		}
	document.write("</td>");
	}
document.write("</tr></table>");
}