window.onload = SetImage_current;

var root_path="http://www.comsoft.co.jp/"; //httpとhttpsはここを切り替えること

var Btn_images = new Array();
for (var i=0;i<26;i++) { Btn_images[i] = new Image();}

Btn_images[0].src = root_path + "images/menu_btn_news4.gif";
Btn_images[1].src = root_path + "images/menu_btn_news4o.gif";
Btn_images[2].src = root_path + "images/menu_btn_president4.gif";
Btn_images[3].src = root_path + "images/menu_btn_president4o.gif";
Btn_images[4].src = root_path + "images/menu_btn_company4.gif";
Btn_images[5].src = root_path + "images/menu_btn_company4o.gif";
Btn_images[6].src = root_path + "images/menu_btn_history4.gif";
Btn_images[7].src = root_path + "images/menu_btn_history4o.gif";
Btn_images[8].src = root_path + "images/menu_btn_result4.gif";
Btn_images[9].src = root_path + "images/menu_btn_result4o.gif";
Btn_images[10].src = root_path + "images/menu_btn_achievement4.gif";
Btn_images[11].src = root_path + "images/menu_btn_achievement4o.gif";
Btn_images[12].src = root_path + "images/menu_btn_activity4.gif";
Btn_images[13].src = root_path + "images/menu_btn_activity4o.gif";
Btn_images[14].src = root_path + "images/menu_btn_recruit4.gif";
Btn_images[15].src = root_path + "images/menu_btn_recruit4o.gif";
Btn_images[16].src = root_path + "images/menu_btn_adopt4.gif";
Btn_images[17].src = root_path + "images/menu_btn_adopt4o.gif";
Btn_images[18].src = root_path + "images/menu_btn_partner4.gif";
Btn_images[19].src = root_path + "images/menu_btn_partner4o.gif";
Btn_images[20].src = root_path + "images/menu_btn_map4.gif";
Btn_images[21].src = root_path + "images/menu_btn_map4o.gif";
Btn_images[22].src = root_path + "images/btn_top04.gif";
Btn_images[23].src = root_path + "images/btn_top04o.gif";
Btn_images[24].src = root_path + "images/btn_sitemap04.gif";
Btn_images[25].src = root_path + "images/btn_sitemap04o.gif";

//ロールオーバー(onmouseover)用
function SetImage_menu(flag,index){
	document.images["menu"+flag].src = Btn_images[index].src;
}
//ロールアウト(onmouseout)用
function SetOutImage_menu(flag,index){
	document.images["menu"+flag].src = Btn_images[index].src;
	SetImage_current();
}

//カレントメニュー表示用
function SetImage_current(){
var aryFile=(window.parent.location.href).split("/").reverse().slice(0,1);
var sFile=aryFile[0];
var index=0;
var strImageSrc="";

sFile = sFile.replace(/#.*/,""); //ページ内リンク対策

//ニュースリリース
if (sFile=="news.html") {
index=0;strImageSrc= root_path + "images/menu_btn_news4r.gif";}
//社長
else if (sFile=="message.html") {
index=1;strImageSrc= root_path + "images/menu_btn_president4r.gif";}
//会社概要
else if (sFile=="company.html") {
index=2;strImageSrc= root_path + "images/menu_btn_company4r.gif";}
//沿革
else if (sFile=="history.html") {
index=3;strImageSrc= root_path + "images/menu_btn_history4r.gif";}
//実績
else if (sFile=="result.html") {
index=4;strImageSrc= root_path + "images/menu_btn_result4r.gif";}
//業績
else if ((sFile=="achievement.html") || (sFile=="p_achievement.html")) {
index=5;strImageSrc= root_path + "images/menu_btn_achievement4r.gif";}
//社内活動
else if ((sFile=="activity.html") || (sFile=="r_event.html") || (sFile=="club.html")) {
index=6;strImageSrc= root_path + "images/menu_btn_activity4r.gif";}
//新卒
else if ((sFile=="recruit.html") || (sFile=="r_information.html") || 
(sFile=="r_message.html") || (sFile=="r_staff.html") || (sFile=="r_training.html") || 
(sFile=="r_form.html") || (sFile=="r_thanks.html") ) {
index=7;strImageSrc= root_path + "images/menu_btn_recruit4r.gif";}
//中途
else if ((sFile=="adopt.html") || (sFile=="adopt_form.html") || (sFile=="a_thanks.html") ) {
index=8;strImageSrc= root_path + "images/menu_btn_adopt4r.gif";}
//パートナー
else if ((sFile=="partner.html") || (sFile=="partner_form_co.html") || 
(sFile=="partner_form_sole.html") || (sFile=="p_thanks.html") ) {
index=9;strImageSrc= root_path + "images/menu_btn_partner4r.gif";}
//案内図
else if (sFile=="map.html") {
index=10;strImageSrc= root_path + "images/menu_btn_map4r.gif";}
//TOP
else if ((sFile=="index.html") || (sFile.indexOf("html")==-1)) {
index=20;strImageSrc= root_path + "images/btn_top04r.gif";}
//サイトマップ
else if (sFile=="sitemap.html") {
index=21;strImageSrc= root_path + "images/btn_sitemap04r.gif";}

document.images["menu"+index].src = strImageSrc;
}

