//JAVASCRIPが使えるかチェックここから
b_name = navigator.appName;
b_ver = parseInt(navigator.appVersion);
js_flag = "no";
if (b_name == "Netscape" && b_ver >= 3) js_flag = "yes";
else if (b_name == "Microsoft Internet Explorer" && b_ver >= 4) js_flag = "yes";

//JAVASCRIPが使えるかチェックここまで

//サブウィンドウ生成用の共通スクリプトここから
function subwindow(url,name,winsize) {
	open_window = window.open(url, name,winsize + ",toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
	open_window.focus();
}
//サブウィンドウ生成用の共通スクリプトここまで

//ウィンドウ生成用の共通スクリプトここから
function submainwindow(url,name,winsize) {
	open_window = window.open(url, name,winsize + ",toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,resizable=yes,menubar=yes");
	open_window.focus();
}
//ウィンドウ生成用の共通スクリプトここまで

//ウィンドウcloseの共通スクリプトここから
function windowCloser(){
window.close()
}
//ウィンドウcloseの共通スクリプトここまで


//共通仕様の表示画像の準備スクリプトここから
function PreloadImages(length, path, type) {
    for(var i = 1; i<=length; i++) {
        this[i]= new Image()
        this[i].src= path + i + type
    }
    return this
}
//共通仕様の表示画像の準備スクリプトここまで


//トップメニューボタン反転051011ここから
tmbon=new PreloadImages(7, 'e/new_b/menu_b0', '_on.gif');
tmboff=new PreloadImages(7, 'e/new_b/menu_b0', '_off.gif');

function topMenuButtonOn(num){
	if (js_flag == "yes" && num>0) {
document.images["tmmb0"+num].src=tmbon[num].src;
}
}

function topMenuButtonOff(num){
	if (js_flag == "yes" && num>0) {
document.images["tmmb0"+num].src=tmboff[num].src;
}
}
//トップメニューボタン反転051011ここまで

//ボタン反転用スクリプト群 ここから

var menu = new Array(6);
var initFlg = false;
var onMenu;
var onGmenu;
function init() {
	// メニュー分
	menu[1] = new Buttons("mmb01", document.mmb01, "/e/menu_b01_on.gif", "/e/menu_b01_off.gif");
	menu[2] = new Buttons("mmb02", document.mmb02, "/e/menu_b02_on.gif", "/e/menu_b02_off.gif");
	menu[3] = new Buttons("mmb03", document.mmb03, "/e/menu_b03_on.gif", "/e/menu_b03_off.gif");
	menu[4] = new Buttons("mmb04", document.mmb04, "/e/menu_b04_on.gif", "/e/menu_b04_off.gif");
	menu[5] = new Buttons("mmb05", document.mmb05, "/e/menu_b05_on.gif", "/e/menu_b05_off.gif");
	menu[6] = new Buttons("mmb06", document.mmb06, "/e/menu_b06_on.gif", "/e/menu_b06_off.gif");
	
	initFlg = true;

	// 現在のメニュー反転用
	ButtonOn(menu[now_menu]);
	menu[0] = menu[now_menu];
}


// ボタン定義
function Buttons(name, object, onimage, offimage) {
	this.name = name;
	this.object = object;
	this.onImage = new Image();
	this.onImage.src = onimage;
	this.offImage = new Image();
	this.offImage.src = offimage;
}

// ボタンオン処理
function ButtonOn(button) {
//	alert(object);
	if(initFlg) {
		button.object.src = button.onImage.src;
	}
}

// ボタンオフ処理
function ButtonOff(button) {
//	alert(object);
	if(initFlg) {
		button.object.src = button.offImage.src;
	}
}

// ボタン全クリア処理
function ButtonClear(buttonArray) {
	if(initFlg) {
		for (i = 1; i <= buttonArray.length; i ++) {
			if (buttonArray[i] && (!buttonArray[0] || buttonArray[0].object.name != buttonArray[i].object.name)) {
				buttonArray[i].object.src = buttonArray[i].offImage.src;
			}
		}
	}
}
//ボタン反転用スクリプト群 ここまで



