var tableWidth = 915;
var menuSpacesWidth = 417;
var isIE = document.all?1:0;
var isFF = document.getElementById?1:0;
var timer;

var menus = new Array();
menus[0] = new menuItems('network', 'network.htm', 121, 'Network Services',
									new Array('business', 'security', 'networksupport'),
									new Array('business.htm', 'security.htm', 'networksupport.htm'),
									new Array('Business Solutions', 'Security', 'Network Support'),
									'network');
menus[1] = new menuItems('support', 'support.htm', 119, 'Support Services',
									 new Array('project'),
									 new Array('project.htm'),
									 new Array('Project Resources and Flexible Resources'),
									 'support');
menus[2] = new menuItems('recruitment', 'recruitment.htm', 95, 'Recruitment',
									new Array('cvupload', 'jobboard', 'client', 'candidate'),
									new Array('cvupload.asp','jobboard.asp','client.htm','candidate.htm'),
									new Array('CV Upload', 'Job Board', 'Client', 'Candidate'),
									'recruitment');
menus[3] = new menuItems('aboutus', 'aboutus.htm', 77, 'About Us',
									new Array(),
									new Array(),
									new Array(),
									'aboutus');
menus[4] = new menuItems('contactus', 'contactus.htm', 77, 'Contact Us',
									new Array(),
									new Array(),
									new Array(),
									'contactus');

//****************** Don't Edit ************************************************************************/
function menuItems(mainImg, mainHrf, mainWidth, mainImgAlt, subItemsImg, subItemshrf, subItemAlt, flder) {
	this.mainImg = mainImg;
	this.mainHrf = mainHrf;
	this.mainWidth = mainWidth;
	this.mainImgAlt = mainImgAlt;
	this.subItemsImg = subItemsImg;
	this.subItemshrf = subItemshrf;
	this.subItemAlt = subItemAlt;
	this.flder = flder;
}

function calLayer(imgWidth) {
	var bodyWidth = 0;
	var leftCorner = 0;
	var layerLeft = 0;
	var ly;

	bodyWidth = document.body.clientWidth;
	leftCorner = (bodyWidth - tableWidth) / 2;
	layerLeft = leftCorner + menuSpacesWidth;
	if (isIE) {
		ly = document.all.Layer1;
	}
	if (isFF) {
		ly = document.getElementById("Layer1");
	}
	ly.style.left = layerLeft + imgWidth;
}

function showSubMenuItems(pos, lv) {
	var totalWidthMenu = 0;
	var ly;
	var template = '';

	for (var i=1; i<=pos; i++) {
		totalWidthMenu += menus[i-1].mainWidth;
	}
	calLayer(totalWidthMenu);
	for (i=0; i<menus[pos].subItemsImg.length; i++) {
		template += '<a href="'+lv+menus[pos].flder+'/'+menus[pos].subItemshrf[i]+'" onMouseOut="hiddenMenu();MM_swapImgRestore()" onMouseOver="fireTimer();MM_swapImage(\''+menus[pos].subItemsImg[i]+'99\',\'\',\''+lv+'share_images/buttom/'+menus[pos].subItemsImg[i]+'_on.jpg\',1)"><img src="'+lv+'share_images/buttom/'+menus[pos].subItemsImg[i]+'_off.jpg" alt="'+menus[pos].subItemAlt[i]+'" name="'+menus[pos].subItemsImg[i]+'99" border="0"></a>';
	}
	if (isIE) {
		document.all.Layer1.innerHTML = template;
	}
	if (isFF) {
		document.getElementById("Layer1").innerHTML = template;
	}
}

function showSubMenu(pos, lv) {
	showSubMenuItems(pos, lv);
	if (isIE) {
		document.all.Layer1.style.visibility='visible';
	}
	if (isFF) {
		document.getElementById("Layer1").style.visibility='visible';
	}
	fireTimer();
}
function fireTimer() {
	clearTimeout(timer);
}

function runHiddenMenu() {
	if (isIE) {
		document.all.Layer1.style.visibility='hidden';
	}
	if (isFF) {
		document.getElementById("Layer1").style.visibility='hidden';
	}

}
function hiddenMenu() {
	timer=setTimeout(runHiddenMenu, 1000);
}
function showmenu(lv) {
	var layerTop=0;
	var loc = document.location.href;
	var currentFolder = loc.substring(0, loc.lastIndexOf("/"));
	currentFolder = "/"+currentFolder.substring(currentFolder.lastIndexOf("/")+1, currentFolder.length)+"/";
	var highlightPrefix = '';
	if (lv == '') {
		layerTop = 375;
	} else {
		layerTop = 117;
	}
	document.write('<div id="Layer1" style="position:absolute; width:135px; height:20; z-index:1; left: 0; top: '+layerTop+';"></div>');
	document.write('<table width="100%"  border="0" cellspacing="0" cellpadding="0">');
	document.write('         <tr>');
	document.write('           <td width="99%">&nbsp;</td>');
	for (var i=0; i<menus.length; i++) {
		if (currentFolder == "/"+menus[i].flder+"/") {
			highlightPrefix = "_on";
		} else {
			highlightPrefix = "_off";
		}
		document.write('           <td><a href="'+lv+menus[i].flder+"/"+menus[i].mainHrf+'" onMouseOut="hiddenMenu();MM_swapImgRestore()" onMouseOver="showSubMenu('+i+', \''+lv+'\');MM_swapImage(\''+menus[i].mainImg+'80\',\'\',\''+lv+'share_images/buttom/'+menus[i].mainImg+'_on.jpg\',1)"><img src="'+lv+'share_images/buttom/'+menus[i].mainImg+highlightPrefix+'.jpg" alt="'+menus[i].mainImgAlt+'" name="'+menus[i].mainImg+'80" width="'+menus[i].mainWidth+'" height="35" border="0"></a></td>');
	}
	document.write('         </tr>');
	document.write('</table>')
}
