 function menuBuild()
{
	var strHTML = '';
	
	for (i = 0; i < arrSections.length; i++)
	{
		strHTML += '<div id="'+ arrSections[i][0] +'" style="position:absolute;top:'+ menuStartLoc +'px;left:'+ arrSections[i][1][0][0] +'px;visibility:hidden;z-index:2"><table cellspacing=0 cellpadding=0 border=0 bgcolor="'+ menuBGcolor +'"><tr><td rowspan='+ arrSections[i][1].length*2 +' width=1 bgcolor="'+ menuBGcolor3 +'"><img src="pixels.gif" width=1 height=1></td><td bgcolor="'+ menuBGcolor3 +'""><img src="pixels.gif" width=1 height=1></td><td rowspan='+ arrSections[i][1].length*2 +' width=1 bgcolor="'+ menuBGcolor3 +'"><img src="pixels.gif" width=1 height=1></td></tr>';

		for (j = 1; j < arrSections[i][1].length; j++)
		{
			var layerID = arrSections[i][0] +'XYZ'+ j;

			strHTML += (isIE) ? '<tr><td id="'+ layerID +'" nowrap>' : '<tr><td nowrap>';
			strHTML += '<font face="Verdana,Arial" size=1><img src="pixels.gif" width=1 height=2><br>&nbsp;&nbsp;<a href='+ arrSections[i][1][j][1] +' onMouseOver="menuBgChange(\''+ layerID +'\',\''+ menuBGcolor2 +'\');" onMouseOut="menuBgChange(\''+ layerID +'\',\''+ menuBGcolor +'\');" target="_top" class="menuLinks">'+ arrSections[i][1][j][0] +'</a>&nbsp;&nbsp;<br><img src="pixels.gif" width=1 height=3></font>';
			strHTML += (isIE) ? '' : '';
			strHTML += '</td></tr>';
			strHTML += '<tr><td height=1 bgcolor="'+ menuBGcolor3 +'"><img src="pixels.gif" width=1 height=1></td></tr>';
		}
		
		strHTML += '</table></div>';
	}

	document.write(strHTML);
	//menuAdjust();
}

function menuBgChange(obj,color)
{
	if (isIE) document.all[obj].style.background = color;
	else if (isNav)
	{
		 }
}

function menuToggle(obj)
{
	if (obj == null)
	{
		if (menuCurrent != -1) menuHide(menuCurrent);
		menuCurrent = -1;
	}
	else if (menuCurrent != obj)
	{
		if (menuCurrent != -1) menuHide(menuCurrent);
		menuCurrent = obj;	
		menuShow(menuCurrent);
	}
}

function menuHide(obj)
{
	if (isIE) document.all[obj].style.visibility = 'hidden';
	else if (isNav) document.layers[obj].visibility = 'hide';
}

function menuShow(obj)
{
	if (isIE) document.all[obj].style.visibility = 'visible';
	else if (isNav) document.layers[obj].visibility = 'show';
}

function menuCheck(e)
{
	if (menuCurrent != -1)
	{
		if (isIE)
		{
			var cX       = event.clientX + document.body.scrollLeft;
			var cY       = event.clientY + document.body.scrollTop;		
			var obj      = document.all[menuCurrent];
			var ptLeft   = obj.style.pixelLeft - 3;
			var ptRight  = ptLeft + obj.scrollWidth + 5;
			var ptBottom = obj.style.pixelTop + obj.scrollHeight + 3;
		}
		else if (isNav)
		{
			var cX       = e.pageX;
			var cY       = e.pageY;		
			var obj      = document.layers[menuCurrent];
			var ptLeft   = obj.left - 2;
			var ptRight  = ptLeft + obj.document.width + 3;
			var ptBottom = obj.top + obj.document.height + 3;
		}
		if ((cY < menuStartLoc-17) || (cY > ptBottom) || (cX < ptLeft) || (cX > ptRight))
		{
			menuHide(menuCurrent);
			menuCurrent = -1;
		}
	}
}


function menuOver(imgName) {
	if (document.images) {
		document[imgName].src = eval(imgName + "_on.src");
	}
}

function menuOff(imgName) {
	if (document.images) {
		document[imgName].src = eval(imgName + "_off.src");
	}
}

var arrNavImages = new Array('submenu_product','submenu_jobseeker','submenu_whocan','submenu_tours','submenu_contact','submenu_home');

if (document.images)
{
	for (i = 0; i < arrNavImages.length; i++)
	{
		eval(arrNavImages[i]+'_on = new Image()');
		eval(arrNavImages[i]+'_on.src = "'+arrNavImages[i]+'_dim.gif"');
		eval(arrNavImages[i]+'_off = new Image()');
		eval(arrNavImages[i]+'_off.src = "'+arrNavImages[i]+'.gif"');
	}
}

function menuResize() {
	if (browserWidth != window.innerWidth || browserHeight != window.innerHeight) document.location.href = document.location.href;
}

if (isMin)
{
	document.write('<style> a.menuLinks { font-family:Verdana,Helvetica,Arial; color:000000; text-decoration:none; font-size:');
	if (isIE) document.write('9px');
	else document.write('10px');
	document.write(' } a:hover.menuLinks { color:ffffff; text-decoration:none font-style:bold;} </style>');
	
	document.onmousemove = menuCheck;

	if (isNav)
	{
		var browserWidth  = window.innerWidth;
		var browserHeight = window.innerHeight;
		
		document.captureEvents(Event.MOUSEMOVE);
		window.onresize = menuResize;
		
		menuBuild();
	}
}