function generateMenus()
	{
		var linkLabels = [["Home"], ["Trucking"], ["Warehousing"], ["Careers"], ["Links"]];

		var linkUrls = [["index.html"], ["trucking.html"], ["warehousing.html"], ["careers.html"], ["links.html"]];

		for (var m=0; m<linkLabels.length; m++)
			{
				createParent(m);
				if (linkLabels[m][1]) 
					{
						createChild(m);
						createHookup(m);
					}
			}

		function createParent(parentCount)
			{
				document.write("<div id=\"menu" + parentCount + "Parent\" class=\"parentMenuOff\">");
				document.write("<div class=\"parentLinkWrapper\"><a href=\"" + linkUrls[parentCount][0] + "\" onmouseover=\"this.parentNode.parentNode.className='parentMenuOver';\" onmouseout=\"this.parentNode.parentNode.className='parentMenuOff';\">" + linkLabels[parentCount][0] + "</a></div>");
				document.write("</div>");
			}

		function createChild(parentCount)
			{
				document.write("<table id=\"menu" + parentCount + "Child\" class=\"menuTable\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"menuLeft\"></td><td class=\"menuMid\">");

				for (var n=1; n<linkLabels[parentCount].length; n++)
					{
						document.write("<a href=\"" + linkUrls[parentCount][n] + "\" class=\"childLink\">" + linkLabels[parentCount][n] + "</a>");
					}

				document.write("</td><td class=\"menuRight\"></td></tr><td class=\"menuBotLeft\"><img src=\"images/menuBotLeft.gif\"></td><td class=\"menuBotMid\"></td><td class=\"menuBotRight\"><img src=\"images/menuBotRight.gif\"></td></tr></table>");
			}

		function createHookup(parentCount)
			{
				document.write("<script type=\"text/javascript\">");
				document.write("hookUpMenu(\"menu" + parentCount + "Parent\", \"menu" + parentCount + "Child\", \"y\", \"pointer\");");
				document.write("</script>");
			}
	}

// PARAMETERS:
// parent   - id of visible html element
// child    - id of invisible html element that will be dropdowned
// position - "x" = the child is displayed to the right of the parent
//            "y" = the child is displayed below the parent
// cursor   - Omit to use default cursor or check any CSS manual for possible
//            values of this field

function hookUpMenu(parent, child, position, cursor)
	{
		p = document.getElementById(parent);
		c = document.getElementById(child);


		p["parentID"] = p.id;
		c["parentID"] = p.id;
		p["childID"] = c.id;
		c["childID"] = c.id;
		p["menuOrientation"] = position;
		c["menuOrientation"] = position;

		c.style.position   = "absolute";
		c.style.visibility = "hidden";

		if (cursor != undefined) p.style.cursor = cursor;

		p.onmouseover = showMenu;
		p.onmouseout = hideMenu;
		c.onmouseover = showMenu;
		c.onmouseout = hideMenu;
	}

function showMenuAux(parent, child)
	{
		var p = document.getElementById(parent);
		var c = document.getElementById(child);

		var top = (c["menuOrientation"] == "y") ? p.offsetHeight : 0;
		var left = (c["menuOrientation"] == "x") ? p.offsetWidth : -13;

		for (; p; p = p.offsetParent)
			{
				top += p.offsetTop;
				left += p.offsetLeft;
			}

		c.style.position = "absolute";
		c.style.top = top +'px';
		c.style.left = left+'px';
		c.style.visibility = "visible";
	}


function showMenu()
	{
		p = document.getElementById(this["parentID"]);
		c = document.getElementById(this["childID" ]);

		showMenuAux(p.id, c.id);
	}



function hideMenu()
	{
		c = document.getElementById(this["childID"]);

		c.style.visibility = 'hidden';
	}

