// Last Modify: 2005.03.10 15:17:30

window.onload = init;
mode = 0;
if (document.images) {
	gmImg = new Array(); gmImgSel = new Image();
	for (i = 1; i <= 6; i++) {
		gmImg[i] = new Image(); gmImg[i].src = '/img/h_menu' + i + 'a.gif';
	}
	menuArrow = new Array();
	menuArrow[0] = new Image(); menuArrow[0].src = '/img/h_menu_arrow0.gif';
	menuArrow[1] = new Image(); menuArrow[1].src = '/img/h_menu_arrow0a.gif';
}

function init() {
	subMenu = document.F1.elements['intraMenu'];
	if (subMenu) {
		subMenu.options.length = 0;
		for (i = 1; i < gMenu['gm0'].length - 1; i += 2) {
			subMenu.options[subMenu.options.length] = new Option(gMenu['gm0'][i], gMenu['gm0'][i - 1]);
		}
	}
	if (!document.getElementById || !document.getElementById("gSubmenu1")) return;
	for (i = 1; i <= 6; i++) {
		if (gMenu["gm" + i].length <= 1) continue;
		url = new Array(); str = new Array();
		for (j = 0; j < gMenu["gm" + i].length - 1;) {
			n = j / 2;
			url[n] = gMenu["gm" + i][j++];
			str[n] = gMenu["gm" + i][j++];
		}
		if (url.length <= 15) {
			s = '<table width=120 border=0 cellspacing=0 cellpadding=3 class=gMenuTbl>';
		} else {
			s =  '<table border=0 cellspacing=0 cellpadding=0 class=gMenuTbl>';
			s += '<tr valign="top"><td width="50%"><table border=0 cellspacing=0 cellpadding=3>';
		}
		for (j = 0; j < url.length; j++) {
			s += '<tr><td nowrap class=gMenuContent'
			s += (mode) ? ' bgcolor="#EBE4CE"' : ' bgcolor="#FFFFFF"';
			s += ' onMouseOver="gsMenuIn(this, \'' + url[j] + '\', \'M' + i + '-' + j + '\')"';
			s += ' onMouseOut="gsMenuOut(this, \'' + url[j] + '\', \'M' + i + '-' + j + '\')"';
			if (url[j].indexOf("+") == 0) {
				url[j] = url[j].substring(1);
				s += ' onClick="window.open(\'' + url[j] + '\')">';
			} else {
				s += ' onClick="location.href=\'' + url[j] + '\'">';
			}
			s += '<img name="M' + i + '-' + j + '" src="/img/h_menu_arrow0.gif" width=10 height=9 align=absmiddle alt="">';
			s += str[j];
			s += '</td></tr>';
			if (url.length > 15 && j == Math.floor(url.length / 2)) s += '</table></td><td width="50%"><table border=0 cellspacing=0 cellpadding=3>';
		}
		if (url.length > 15) s += '</table></td></tr>';
		s += '</table>\n';
		document.getElementById("gSubmenu" + i).style.display = "none";
		document.getElementById("gSubmenu" + i).innerHTML = s;
	}
}
gmSel = gmTO = 0;
function gMenuIn(n) {
	if (n == gmSel) {
		clearTimeout(gmTO);
	} else {
		gMenuOutT(gmSel);
	}
	gmImgSel.src = document.images['gMenuImg' + n].src;
	document.images['gMenuImg' + n].src = gmImg[n].src;
	if (document.getElementById && document.getElementById("gSubmenu" + n)) {
		document.getElementById("gSubmenu" + n).style.left = 14 + 127 * (n - 1);
		document.getElementById("gSubmenu" + n).style.top = 92;
		document.getElementById("gSubmenu" + n).style.display = "block";
	}
}
function gMenuOut(n) {
	document.images['gMenuImg' + n].src = gmImgSel.src;
	gmTO = setTimeout('gMenuOutT(' + n + ')', 50);
	gmSel = n;
}
function gMenuOutT(n) {
	if (document.getElementById && document.getElementById("gSubmenu" + n)) {
		document.getElementById("gSubmenu" + n).style.display = "none"; 
	}
}
function gsMenuIn(obj, url, img) {
	document.images[img].src = menuArrow[1].src;
	obj.style.color = "#FFFFFF";
	obj.style.backgroundColor = "#B1AC99";
//	window.status = (url.charAt(0) != "+") ? location.protocol + '//' + location.host + url : url.substring(1);
	window.status = (url.charAt(0) != "+") ? url : url.substring(1);
}
function gsMenuOut(obj, url, img) {
	document.images[img].src = menuArrow[0].src;
	obj.style.color = "#555555";
	obj.style.backgroundColor = (mode) ? '#EBE4CE' : '#FFFFFF';
	window.status = '';
}
function intraJump(n) {
	if (n) location.href = n;
}