var Menus = [
	{
		name:		"company",
		left:		"231",
		submenu:	[
			{
				link:	"/company/index.html",
				target:	"",
				text:	"ご挨拶"
			}, {
				link:	"/company/about.html",
				target:	"",
				text:	"会社概要"
			}, {
				link:	"/company/concept.html",
				target:	"",
				text:	"経営理念"
			}, {
				link:	"/company/offshore.html",
				target:	"",
				text:	"海外拠点・関係会社"
			}, {
				link:	"/company/domestic.html",
				target:	"",
				text:	"国内拠点・関係会社"
			}, {
				link:	"/company/technology.html",
				target:	"",
				text:	"カルソニックカンセイの技術"
			}, {
				link:	"/company/history.html",
				target:	"",
				text:	"カルソニックカンセイの歴史"
			}, {
				link:	"/ecology/index.html",
				target:	"",
				text:	"環境情報"
			}
		]
	}, {
		name:		"products",
		left:		"332",
		width:		"160",
		submenu:	[
			{
				link:	"/products/synergy.html",
				target:	"",
				text:	"相乗効果を、追求する"
			}, {
				link:	"/products/about_module.html",
				target:	"",
				text:	"モジュールとは"
			}, {
				link:	"/products/cp_module.html",
				target:	"",
				text:	"コックピットモジュール"
			}, {
				link:	"/products/fe_module.html",
				target:	"",
				text:	"フロントエンドモジュール"
			}, {
				link:	"/products/ac_system.html",
				target:	"",
				text:	"エアコンシステム"
			}, {
				link:	"/products/ex_system.html",
				target:	"",
				text:	"エキゾーストシステム"
			}, {
				link:	"/products/component.html",
				target:	"",
				text:	"単体（コンポーネント）製品"
			}, {
				link:	"/products/accessory.html",
				target:	"",
				text:	"純正カー用品"
			}, {
				link:	"http://www.calsonic.jp/",
				target:	"_blank",
				text:	"市販カー用品（シーケー販売）"
			}
		]
	}, {
		name:		"ir",
		left:		"428",
		width:		"105",
		submenu:	[
			 {
				link:	"/ir/finance/index.html",
				target:	"",
				text:	"財務情報"
			}, {
				link:	"/ir/event/index.html",
				target:	"",
				text:	"IRイベント"
			}, {
				link:	"/ir/stock/index.html",
				target:	"",
				text:	"株式情報"
			}, {
				link:	"/ir/faq.html",
				target:	"",
				text:	"IRについてよくある質問"
			}
		]
	}, {
		name:		"recruit",
		left:		"540",
		width:		"110",
		submenu:	[
		]
	}, {
		name:		"race",
		left:		"655",
		width:		"25",
		submenu:	[
		]
	}
];

var TimeoutMsec=100;
var TimerID;

var ImageCache=new Array();
for(var i=0; i<Menus.length; i++) {
	ImageCache[Menus[i].name]=new Image();
	ImageCache[Menus[i].name].src="/images_common/gm_"+Menus[i].name+".gif";
	ImageCache[Menus[i].name+"-on"]=new Image();
	ImageCache[Menus[i].name+"-on"].src="/images_common/gm_"+Menus[i].name+"-on.gif";
/*
	for(var j=0; j<Menus[i].submenu.length; j++) {
		ImageCache[Menus[i].submenu[j].image]=new Image();
		ImageCache[Menus[i].submenu[j].image].src="/images_common/"+Menus[i].submenu[j].image+".gif";
		ImageCache[Menus[i].submenu[j].image+"-on"]=new Image();
		ImageCache[Menus[i].submenu[j].image+"-on"].src="/images_common/"+Menus[i].submenu[j].image+"-on.gif";
	}
*/
}

function ChangeImage(iname) {
	var imgObj=null;
	if(document.images[iname]) imgObj=document.images[iname];
	if(!imgObj) return;
	if(imgObj.src == ImageCache[iname].src) {
		imgObj.src=ImageCache[iname+"-on"].src;
	} else {
		imgObj.src=ImageCache[iname].src;
	}
}

function GlobalMenu(menuname) {
	if(document.images[menuname].src==ImageCache[menuname].src) {
		document.images[menuname].src=ImageCache[menuname+"-on"].src;
		Show(menuname);
	} else {
		document.images[menuname].src=ImageCache[menuname].src;
		TimerID=setTimeout("Hide('"+menuname+"')", TimeoutMsec);
	}
}

function Show(lname) {
	if(TimerID) clearTimeout(TimerID);
	for(var i=0; i<Menus.length; i++) {
		if(lname!=Menus[i].name) Hide(Menus[i].name);
	}
	if(document.getElementById(lname+"Layer")) document.getElementById(lname+"Layer").style.visibility="visible";
}

function Hide(lname) {
	if(document.images[lname].src.indexOf("-on")!=-1) return;
	if(document.getElementById(lname+"Layer")) document.getElementById(lname+"Layer").style.visibility="hidden";
}

document.write("<div id=\"header\">");
document.write("<table cellspacing=\"0\">");
document.write("<tr>");
document.write("<td rowspan=\"2\"><a href=\"/index.html\" name=\"pagetop\"><img src=\"/images_common/logo.gif\" width=\"231\" height=\"60\" alt=\"Calsonic Kansei\"></a></td>");
document.write("<td colspan=\"5\" class=\"help\"><a href=\"/news/index.html\">プレスリリース</a>｜<a href=\"/faq/index.html\">よくあるご質問</a>｜<a href=\"/sitemap.html\">サイトマップ</a>｜<a href=\"/english/index.html\">English</a></td>");
document.write("</tr>");
document.write("<tr>");
document.write("<td class=\"company\"><a href=\"/company/index.html\" onmouseover=\"GlobalMenu('company');\" onmouseout=\"GlobalMenu('company');\"><img name=\"company\" src=\"/images_common/gm_company.gif\" width=\"101\" height=\"40\" alt=\"会社情報\"></a></td>");
document.write("<td class=\"products\"><a href=\"/products/index.html\" onmouseover=\"GlobalMenu('products');\" onmouseout=\"GlobalMenu('products');\"><img name=\"products\" src=\"/images_common/gm_products.gif\" width=\"96\" height=\"40\" alt=\"製品情報\"></a></td>");
document.write("<td class=\"ir\"><a href=\"/ir/index.html\" onmouseover=\"GlobalMenu('ir');\" onmouseout=\"GlobalMenu('ir');\"><img name=\"ir\" src=\"/images_common/gm_ir.gif\" width=\"112\" height=\"40\" alt=\"投資家の皆様へ\"></a></td>");
document.write("<td class=\"recruit\"><a href=\"/recruit/index.html\" onmouseover=\"GlobalMenu('recruit');\" onmouseout=\"GlobalMenu('recruit');\"><img name=\"recruit\" src=\"/images_common/gm_recruit.gif\" width=\"115\" height=\"40\" alt=\"採用情報\"></a></td>");
document.write("<td class=\"race\"><a href=\"/race/index.html\" onmouseover=\"GlobalMenu('race');\" onmouseout=\"GlobalMenu('race');\"><img name=\"race\" src=\"/images_common/gm_race.gif\" width=\"120\" height=\"40\" alt=\"モータースポーツ\"></a></td>");
document.write("</tr>");
document.write("</table>");
document.write("</div>");

function MakeSubmenu() {
	for(var i=0; i<Menus.length; i++) {
		document.write("<div id=\""+Menus[i].name+"Layer\" class=\"dlayer\" style=\"left:"+Menus[i].left+"px\"");
		document.write(" onmouseover=\"Show('"+Menus[i].name+"')\" onmouseout='TimerID=setTimeout(\"Hide(\\\""+Menus[i].name+"\\\")\", TimeoutMsec);'>");
		
		document.write('<table border="0" cellpadding="0" cellspacing="1">');
		for(var j=0; j<Menus[i].submenu.length; j++) {
			document.write('<tr><td nowrap>');
			if(Menus[i].submenu[j].target != "") {
				document.write("<a href=\""+Menus[i].submenu[j].link+"\" target=\""+Menus[i].submenu[j].target+"\" onmouseover=\"ChangeImage('"+Menus[i].submenu[j].image+"');\" onmouseout=\"ChangeImage('"+Menus[i].submenu[j].image+"');\">");
			} else {
				document.write("<a href=\""+Menus[i].submenu[j].link+"\" onmouseover=\"ChangeImage('"+Menus[i].submenu[j].image+"');\" onmouseout=\"ChangeImage('"+Menus[i].submenu[j].image+"');\">");
			}
			document.write(Menus[i].submenu[j].text+'</td></tr>');
			document.write('</a>');
			document.write('</td></tr>');
		}
		document.write('</table>');
		
		document.write("</div>");
	}
}
MakeSubmenu();
