
var menuNumMap = new Array();

function menuUp(id, pos, event) {
	if (typeof HM_AreLoaded == "undefined" || !HM_AreLoaded) return;
	var menunum = getMenuNumById(id);
	if (menunum) {
		setMenuPos(id, menunum, pos);
		HM_f_PopUp('HM_Menu'+menunum, event);
	}
}

function menuDown(id) {
	if (typeof HM_AreLoaded == "undefined" || !HM_AreLoaded) return;
	var menunum = getMenuNumById(id);
	if (menunum) HM_f_PopDown('HM_Menu'+menunum);
}

function getNextMenuNum() {
	var x = 1;
	while (eval('window.HM_Array'+x)) x++;
	return x;
}

function getMenuNumById(id) {
	for (var x=0;x<menuNumMap.length;x++) {
		if (menuNumMap[x][0] == id) return menuNumMap[x][1];
	}
	return null;
}

function getMenuHeight(menu) {
	var height = 0;
	
	for (var x=0;x<menu.childNodes.length;x++) {
		height += menu.childNodes[x].offsetHeight;
	}
	
	return height;
}

function setMenuPos(id, count, pos) {
	var programImage = document.getElementById("menu_link_"+id);
	var menu = document.getElementById(HM_MenuIDPrefix+count);
	
	if (menu && programImage) {
		var mLeft;
		var mTop;
		var iLeft = 0;
		var iTop = 0;
		
		for (var obj=programImage;obj!=null;obj=obj.offsetParent) {
			iTop += obj.offsetTop;
			iLeft += obj.offsetLeft;
		}
		
		if (pos == "right") {
			var mHeight = getMenuHeight(menu);
			var scrollTop = (document.body.scrollTop ? document.body.scrollTop : 0);
			
			mLeft = iLeft + programImage.offsetWidth;
			mTop = Math.floor(iTop + programImage.offsetHeight / 2) - Math.floor(mHeight / 2);
			
			if (mTop + mHeight - scrollTop > document.body.offsetHeight)
				mTop = document.body.offsetHeight + scrollTop - mHeight;
			if (mTop - scrollTop < 0) mTop = scrollTop;
		}
		if (pos == "below") {
			mLeft = iLeft;
			mTop = iTop + programImage.offsetHeight;
			
			if (mLeft + menu.offsetWidth > document.body.offsetWidth)
				mLeft = document.body.offsetWidth - menu.offsetWidth;
		}
		
		menu.style.left = mLeft;
		menu.style.top = mTop;
	}
}


HM_Array1 = [
[
//	menu width	left_position	top_position	font_color	mouseover_font_color	background_color
	170,		0,		0,		'#333366',	'#FFFFFF',		'#FFFFFF',
//	mouseover_background_color	border_color	separator_color	top_is_permanent	top_is_horizontal
	'#336699',			'#333366',	'#333366',	0, 			0,
//	tree_is_horizontal	position_under	top_more_images_visible	tree_more_images_visible
	0,			1,		0,			0,
//	evaluate_upon_tree_show		evaluate_upon_tree_hide		right-to-left
	0,				0,				0
]
,["Who&nbsp;Are&nbsp;We?","/eng/aboutus/whoarewe.html",1,0,0]
,["History","/eng/aboutus/history.html",1,0,0]
,["Mission","/eng/aboutus/mission.html",1,0,0]
,["Core&nbsp;Values","/eng/aboutus/corevalues.html",1,0,0]
,["Quality&nbsp;Improvement","/eng/aboutus/professionalassociates.html",1,0,0]
,["Our&nbsp;Team","/eng/aboutus/leadershipteam.html",1,0,0]
,["Corporate&nbsp;Client&nbsp;Profile","/eng/aboutus/clients.html",1,0,0]
,["Professional&nbsp;Opportunities","/eng/aboutus/professionalopportunities.html",1,0,0]
]
//num = getNextMenuNum();
//eval('HM_Array'+num+' = Temp_HM_Array');
menuNumMap[menuNumMap.length] = [ '13', '1' ];

HM_Array2 = [
[
//	menu width	left_position	top_position	font_color	mouseover_font_color	background_color
	170,		0,		0,		'#333366',	'#FFFFFF',		'#FFFFFF',
//	mouseover_background_color	border_color	separator_color	top_is_permanent	top_is_horizontal
	'#336699',			'#333366',	'#333366',	0, 			0,
//	tree_is_horizontal	position_under	top_more_images_visible	tree_more_images_visible
	0,			1,		0,			0,
//	evaluate_upon_tree_show		evaluate_upon_tree_hide		right-to-left
	0,				0,				0
]
,["Why&nbsp;EAP?","/eng/sfo/index.html",1,0,0]
,["Corporate&nbsp;Solutions","/eng/sfo/corporatesolutions",1,0,1]
,["Program&nbsp;Management","/eng/sfo/programmanagement",1,0,1]
]
//num = getNextMenuNum();
//eval('HM_Array'+num+' = Temp_HM_Array');
menuNumMap[menuNumMap.length] = [ '5', '2' ];

HM_Array2_2 = [
[
//	menu width	left_position	top_position	font_color	mouseover_font_color	background_color
	170,		0,		0,		'#333366',	'#FFFFFF',		'#FFFFFF',
//	mouseover_background_color	border_color	separator_color	top_is_permanent	top_is_horizontal
	'#336699',			'#333366',	'#333366',	0, 			0,
//	tree_is_horizontal	position_under	top_more_images_visible	tree_more_images_visible
	0,			1,		0,			0,
//	evaluate_upon_tree_show		evaluate_upon_tree_hide		right-to-left
	0,				0,				0
]
,["Organizational&nbsp;Consultation","/eng/sfo/corporatesolutions/organizationalconsultation.html",1,0,0]
,["Leadership&nbsp;Training","/eng/sfo/corporatesolutions/leadershiptraining.html",1,0,0]
,["CISM&nbsp;Services","/eng/sfo/corporatesolutions/cism.html",1,0,0]
,["Health&nbsp;&&nbsp;Wellness&nbsp;Seminars","/eng/sfo/corporatesolutions/healthandwellness",1,0,1]
,["Workplace&nbsp;Conflict&nbsp;Resolution","/eng/sfo/corporatesolutions/workplacemediation.html",1,0,0]
,["Return&nbsp;to&nbsp;Work&nbsp;Services","/eng/sfo/corporatesolutions/disability_management.html",1,0,0]
]
//num = getNextMenuNum();
//eval('HM_Array'+num+' = Temp_HM_Array');
menuNumMap[menuNumMap.length] = [ '10', '2_2' ];

HM_Array2_3 = [
[
//	menu width	left_position	top_position	font_color	mouseover_font_color	background_color
	170,		0,		0,		'#333366',	'#FFFFFF',		'#FFFFFF',
//	mouseover_background_color	border_color	separator_color	top_is_permanent	top_is_horizontal
	'#336699',			'#333366',	'#333366',	0, 			0,
//	tree_is_horizontal	position_under	top_more_images_visible	tree_more_images_visible
	0,			1,		0,			0,
//	evaluate_upon_tree_show		evaluate_upon_tree_hide		right-to-left
	0,				0,				0
]
,["Statistics","/eng/sfo/programmanagement/stats.html",1,0,0]
,["Quality&nbsp;Assurance","/eng/sfo/programmanagement/qa.html",1,0,0]
]
//num = getNextMenuNum();
//eval('HM_Array'+num+' = Temp_HM_Array');
menuNumMap[menuNumMap.length] = [ '11', '2_3' ];

HM_Array3 = [
[
//	menu width	left_position	top_position	font_color	mouseover_font_color	background_color
	170,		0,		0,		'#333366',	'#FFFFFF',		'#FFFFFF',
//	mouseover_background_color	border_color	separator_color	top_is_permanent	top_is_horizontal
	'#336699',			'#333366',	'#333366',	0, 			0,
//	tree_is_horizontal	position_under	top_more_images_visible	tree_more_images_visible
	0,			1,		0,			0,
//	evaluate_upon_tree_show		evaluate_upon_tree_hide		right-to-left
	0,				0,				0
]
,["What&nbsp;is&nbsp;EAP?","/eng/sfe/index.html",1,0,0]
,["Confidentiality","/eng/sfe/confidentiality.html",1,0,0]
,["How&nbsp;Much&nbsp;Does&nbsp;It&nbsp;Cost?","/eng/sfe/howmuchdoesitcost.html",1,0,0]
,["Counselling&nbsp;Services","/eng/sfe/counsellingservices.html",1,0,0]
,["Work/Life&nbsp;Resources","/eng/sfe/wlr.html",1,0,0]
,["Accessing&nbsp;Service","/eng/sfe/accessingservice.html",1,0,0]
,["Our&nbsp;Staff","/eng/sfe/ourstaff.html",1,0,0]
,["FAQ's","/eng/sfe/faqs.html",1,0,0]
]
//num = getNextMenuNum();
//eval('HM_Array'+num+' = Temp_HM_Array');
menuNumMap[menuNumMap.length] = [ '3', '3' ];

HM_Array4 = [
[
//	menu width	left_position	top_position	font_color	mouseover_font_color	background_color
	170,		0,		0,		'#333366',	'#FFFFFF',		'#FFFFFF',
//	mouseover_background_color	border_color	separator_color	top_is_permanent	top_is_horizontal
	'#336699',			'#333366',	'#333366',	0, 			0,
//	tree_is_horizontal	position_under	top_more_images_visible	tree_more_images_visible
	0,			1,		0,			0,
//	evaluate_upon_tree_show		evaluate_upon_tree_hide		right-to-left
	0,				0,				0
]
]
//num = getNextMenuNum();
//eval('HM_Array'+num+' = Temp_HM_Array');
menuNumMap[menuNumMap.length] = [ '6', '4' ];

HM_Array5 = [
[
//	menu width	left_position	top_position	font_color	mouseover_font_color	background_color
	110,		0,		0,		'#333366',	'#FFFFFF',		'#FFFFFF',
//	mouseover_background_color	border_color	separator_color	top_is_permanent	top_is_horizontal
	'#336699',			'#333366',	'#333366',	0, 			0,
//	tree_is_horizontal	position_under	top_more_images_visible	tree_more_images_visible
	0,			1,		0,			0,
//	evaluate_upon_tree_show		evaluate_upon_tree_hide		right-to-left
	0,				0,				0
]
,["Contact","/eng/contactus/index.html",1,0,0]
,["Request&nbsp;A&nbsp;Quote","/eng/contactus/requestaquote.html",1,0,0]
,["Office&nbsp;Locations","/eng/contactus/officelocations.html",1,0,0]
,["International&nbsp;Intake","/eng/contactus/international.html",1,0,0]
]
//num = getNextMenuNum();
//eval('HM_Array'+num+' = Temp_HM_Array');
menuNumMap[menuNumMap.length] = [ '7', '5' ];

