﻿///////////////////////////////////////////////////////////////////////
// Info: ヘッドナビゲーションのメニューを表示する。
///////////////////////////////////////////////////////////////////////

// ブラウザ別による幅の調整
var menu_width;

if (navigator.userAgent.indexOf("MSIE ") != -1) {
	var s = navigator.userAgent.indexOf("MSIE ",0) + 5;
	var e = navigator.userAgent.indexOf(";",s);
	var ver = eval(navigator.userAgent.substring(s,e));
	if(ver < 7)	menu_width = 106;							// IE7.0未満の時の横幅
	else		menu_width = 103;							// IE7.0以上の時の横幅
} else	{
	menu_width = 103;										// その他の時の横幅
}
var sub_style = ' style="width: ' + menu_width + 'px" ';

// メインカテゴリー選択の判定
menu_width = ' style="width: ' + menu_width + 'px';
var color_s = "#cdcdcd";									// 選択時の文字色
var color_o = "#1a4185";									// 非選択時の文字色
var color_h = "#fefefe";									// ホバー時の文字色

var back_color_s = "#2383e2";								// 選択時の背景色
var border_top_color_s = "#155595";							// 選択時の上線色
var border_bottom_color_s = "#2383e2";						// 選択時の下線色
var border_right_color_s = "#2383e2";						// 選択時の右線色
var border_left_color_s = "#155595";						// 選択時の左線色

var select_col = menu_width + '; color: ' + color_s + '; background-color: ' + back_color_s + '; border-top-color: ' + border_top_color_s + '; border-bottom-color: ' + border_bottom_color_s + '; border-right-color: ' + border_right_color_s + '; border-left-color: ' + border_left_color_s + '" ';
var no_col = menu_width + '; color: ' + color_o + '" ';
var hover_col = " this.style.color='" + color_h + "'";
var out_col = " this.style.color='" + color_o + "'";

var home_over = hover_col; technology_over = hover_col; company_over = hover_col; event_over = hover_col; magazine_over = hover_col; job_over = hover_col; business_over = hover_col;
var home_out = out_col; technology_out = out_col; company_out = out_col; event_out = out_col; magazine_out = out_col; job_out = out_col; business_out = out_col;
var home, technology, company, event, magazine, job, business;

if(document.URL.indexOf("page_") == -1) {
	home = select_col;
	home_out = " this.style.color='" + color_s + "'";
	technology = no_col; company = no_col; event = no_col; magazine = no_col; job = no_col; business = no_col;
} else if(document.URL.indexOf("page_company") != -1) {
	company = select_col;
	company_out = " this.style.color='" + color_s + "'";
	home = no_col; technology = no_col; event = no_col; magazine = no_col; job = no_col; business = no_col;
} else if(document.URL.indexOf("page_technology") != -1) {
	technology = select_col;
	technology_out = " this.style.color='" + color_s + "'";
	home = no_col; company = no_col; event = no_col; magazine = no_col; job = no_col; business = no_col;
} else if(document.URL.indexOf("page_job_offer") != -1) {
	job = select_col;
	job_out = " this.style.color='" + color_s + "'";
	home = no_col; technology = no_col; company = no_col; event = no_col; magazine = no_col; business = no_col;
} else if(document.URL.indexOf("page_event") != -1) {
	event = select_col;
	event_out = " this.style.color='" + color_s + "'";
	home = no_col; technology = no_col; company = no_col; magazine = no_col; job = no_col; business = no_col;
} else if(document.URL.indexOf("page_magazine") != -1) {
	magazine = select_col;
	magazine_out = " this.style.color='" + color_s + "'";
	home = no_col; technology = no_col; company = no_col; event = no_col; job = no_col; business = no_col;
} else if(document.URL.indexOf("page_business") != -1) {
	business = select_col;
	business_out = " this.style.color='" + color_s + "'";
	home = no_col; technology = no_col; company = no_col; event = no_col; magazine = no_col; job = no_col;
} else {
	home = no_col; technology = no_col; company = no_col; event = no_col; magazine = no_col; job = no_col; business = no_col;
}

document.write('<ul>',
'<li><a' + company + 'class="top_menu" href="' + URL_TOP + 'page_company/index.html" onmouseover="' + company_over + '" onmouseout="' + company_out + '" title="">会社情報</a></li>',
'<li><a' + technology + 'class="top_menu" href="' + URL_TOP + 'page_technology/index.html" onmouseover="' + technology_over + '" onmouseout="' + technology_out + '" title="">技術情報</a></li>',
'<li><a' + event + 'class="top_menu" href="' + URL_TOP + 'page_event/index.html" onmouseover="' + event_over + '" onmouseout="' + event_out + '" title="">社内行事</a></li>',
'<li><a' + magazine + 'class="top_menu" href="' + URL_TOP + 'page_magazine/index.html" onmouseover="' + magazine_over + '" onmouseout="' + magazine_out + '" title="">社内報</a></li>',
'<li><a' + job + 'class="top_menu" href="' + URL_TOP + 'page_job_offer/index.html" onmouseover="' + job_over + '" onmouseout="' + job_out + '" title="">求人案内</a></li>',
'<li><a' + business + 'class="top_menu" href="' + URL_TOP + 'page_business/index.html" onmouseover="' + business_over + '" onmouseout="' + business_out + '" title="">ご商談窓口</a></li>',
'<li><a' + home + 'class="top_menu" href="' + URL_TOP + 'index.html" onmouseover="' + home_over + '" onmouseout="' + home_out + '" title="">ホーム</a></li>',
'</ul>');

