var focus = 0;

function InitMenuEvent() {
	$("#MenuId0").click(function() {
		menuclick(0);
	});
	$("#MenuId0").mouseover(function() {
		getMouseFocus(0);
	});
	$("#MenuId1").click(function() {
		menuclick(1);
	});
	$("#MenuId1").mouseover(function() {
		getMouseFocus(1);
	});
	$("#MenuId2").click(function() {
		menuclick(2);
	});
	$("#MenuId2").mouseover(function() {
		getMouseFocus(2);
	});
	$("#MenuId3").click(function() {
		menuclick(3);
	});
	$("#MenuId3").mouseover(function() {
		getMouseFocus(3);
	});
	$("#MenuId4").click(function() {
		menuclick(4);
	});
	$("#MenuId4").mouseover(function() {
		getMouseFocus(4);
	});
	$("#MenuId5").click(function() {
		menuclick(5);
	});
	$("#MenuId5").mouseover(function() {
		getMouseFocus(5);
	});
}

function getMenuHelp(e) {
	if(focus >= 0 && focus < numberOfMenu)
		document.getElementById('helpinfodetail').innerHTML = document.getElementById("ContentID"+e).innerHTML;
}

function menuclick(focus) {
	if(menuType == "Move")
		gotoMenu(focus);
}

function gotoMenu(focus) {
	var href = menuGotoList[focus];
	
	if(href =="")
	{
		$.blockUI({
				message : $('#construction'),
				overlayCSS : {
					backgroundColor : '#616'
				},
				css : {
					width : '500px',
					backgroundColor : '#fff',
					color : '#000'
				},
				timeout : 1000
			});
	}
	else
	{
		location.href = href;
	}
}

function getMouseFocus(id) {
	outFocus("MenuId" + focus);
	getFocus("MenuId" + id);
	focus = id;
	changeImage(focus);
	getMenuHelp(focus);
}

function getFocus(id) {
	var ele = document.getElementById(id);
	ele.style.color = "#6C3";
	ele.style.fontWeight = "bold";
	ele.style.fontSize = menuFontSizeFocus;
	ele.style.backgroundImage = "url('img/bg_nowPro.png')";
}

function outFocus(id) {
	var ele = document.getElementById(id);
	ele.style.color = "#FFFFFF";
	ele.style.fontSize = menuFontSizeBasic;
	ele.style.fontWeight = "normal";
	ele.style.backgroundImage = "none";
}
