gMenu = new Array();
gMenu["gm"] = new Array(
	0,"/","HOME",
	1,"/treatment/","診療案内",
	2,"/clinic/","クリニック紹介",
	3,"/staff/","スタッフ紹介",
	4,"/access/","アクセスマップ",
	5,"/cost/","料金案内",
	6,"/question/","お問い合わせ",

"");
gMenu["gm0"] = new Array(
"");
gMenu["gm1"] = new Array(
"");
gMenu["gm2"] = new Array(
	0,"/clinic/institut/","施設紹介",
	1,"/clinic/facility/","設備紹介",
"");
gMenu["gm3"] = new Array(
	0,"/staff/director/","院長紹介",
	1,"/staff/staff/","スタッフ",
"");
gMenu["gm4"] = new Array(
"");
gMenu["gm5"] = new Array(
"");
gMenu["gm6"] = new Array(
"");


if (document.images) {
	gmImg = new Array(); gmImgSel = new Image();
	for (i = 0; i < Math.floor(gMenu['gm'].length / 3); i++) {
		gmImg[i] = new Image(); gmImg[i].src = '/image/header/g_menu_' + i + 'a.jpg';
	}
}

function init(n1, n2) {
	gm2 = 'gm' + n1 + '-' + n2;
	if (!document.getElementById || !document.getElementById("gSubmenu0")) return;
	if (n1 >= 0) document.images['gMenuImg' + n1].src = gmImg[n1].src;
	for (i = 0; i < Math.floor(gMenu['gm'].length / 3); i++) {
		id = new Array(); num = new Array(); url = new Array(); str = new Array();
		for (j = 0; j < gMenu["gm" + i].length;) {
			n = gMenu["gm" + i][j];
			id[n] = j / 3;
			num[n] = gMenu["gm" + i][j++];
			url[n] = gMenu["gm" + i][j++];
			str[n] = gMenu["gm" + i][j++];
		}
		s = '<table width=106 border=0 cellspacing=0 cellpadding=0 class=gSubmenu>';
		for (j = 0; j < num.length; j++) {
			sel2 = gm2.indexOf('gm' + i + '-' + id[j]) != -1 && n2 == id[j];
			s += '<tr>';
			s += '<td bgcolor="#FFFFFF" nowrap class=gsMenuContent'
			s += ' onMouseOver="gsMenuIn(this, \'' + url[j] + '\')"';
			s += ' onMouseOut="gsMenuOut(this, \'' + url[j] + '\')"';
			if (url[j].indexOf("+") == 0) {
				url[j] = url[j].substring(1);
				tar = '_blank';
			} else { tar = ''; }
			if (tar == '') {
				s += ' onClick="location.href=\'' + url[j] + '\'">';
			} else {
				s += ' onClick="window.open(\'' + url[j] + '\')">';
			}
			s += '<img src="h/image/a_green_r.gif" width=10 height=9 alt="">';
			if (sel2) s += '<span style="color:#005FA9">';
			s += str[j];
			if (sel2) s += '</span>';
			s += '</td></tr>';
		}
		s += '</table>\n';
		document.getElementById("gSubmenu" + i).style.display = "none";
		document.getElementById("gSubmenu" + i).innerHTML = s;
	}
	headerLink(); footerLink();
}

lmImg = 0;
lmImgSel = new Image();
function leftMenu(path, leftMenuLength) {
	pathURI = path;
	if (document.images) {
		lmImg = new Array();
		for (i = 0; i <= leftMenuLength; i++) {
			lmImg[i] = new Image(); lmImg[i].src = pathURI + 'image/lm' + i + 'a.jpg';
		}
	}
}

lsmImg =0;
lsmImgSel = new Image();
function leftSubMenu(n1, leftSubMenuLength) {
	if (document.images) {
		lsmImg = new Array();
		for (i = 0; i <= leftSubMenuLength; i++) {
			lsmImg[i] = new Image(); lsmImg[i].src = pathURI + 'image/lm' + n1 + '-' + i + 'a.jpg';
		}
	}
}

headerLinkLength = 2;
hlImg = 0;
hlImgSel = new Image();
function headerLink() {
	if (document.images) {
		hlImg = new Array();
		for (i = 0; i <= headerLinkLength; i++) {
			hlImg[i] = new Image(); hlImg[i].src = '/image/header/h_link' + i + 'a.jpg';
		}
	}
}

footerLinkLength = 1;
flImg = 0;
flImgSel = new Image();
function footerLink() {
	if (document.images) {
		flImg = new Array();
		for (i = 0; i <= footerLinkLength; i++) {
			flImg[i] = new Image(); flImg[i].src = '/image/footer/f_link' + i + 'a.jpg';
		}
	}
}

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 = 104 * n + n;
		document.getElementById("gSubmenu" + n).style.top = 84;
		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) {
	obj.style.color = "#444444";
	obj.style.backgroundColor = "#CCCCCC";
	window.status = (url.charAt(0) != "+") ? location.protocol + '//' + location.host + url : url.substring(1);
}

function gsMenuOut(obj, url) {
	obj.style.color = "#666666";
	obj.style.backgroundColor = "#FFFFFF";
	window.status = '';
}

function LMI(n) {
	if (!lmImg) return;
	lmImgSel.src = document.images['lmImg' + n].src;
	document.images['lmImg' + n].src = lmImg[n].src;
}

function LMO(n) {
	if (!lmImg || !lmImgSel.src) return;
	document.images['lmImg' + n].src = lmImgSel.src;
}


function LSMI(n, m) {
	if (!lsmImg) return;
	lsmImgSel.src = document.images['lsmImg' + n + '-' + m].src;
	document.images['lsmImg' + n + '-' + m].src = lsmImg[m].src;
}

function LSMO(n, m) {
	if (!lsmImg || !lsmImgSel.src) return;
	document.images['lsmImg' + n + '-' + m].src = lsmImgSel.src;
}

function HLI(n) {
	if (!hlImg) return;
	hlImgSel.src = document.images['hlImg' + n].src;
	document.images['hlImg' + n].src = hlImg[n].src;
}

function HLO(n) {
	if (!hlImg || !hlImgSel.src) return;
	document.images['hlImg' + n].src = hlImgSel.src;
}

function FLI(n) {
	if (!flImg) return;
	flImgSel.src = document.images['flImg' + n].src;
	document.images['flImg' + n].src = flImg[n].src;
}

function FLO(n) {
	if (!flImg || !flImgSel.src) return;
	document.images['flImg' + n].src = flImgSel.src;
}


