var topimage = new Array();
var topbutton = new Array();
var topbutton_hover = new Array();

topimage[0] = new Image();
topimage[1] = new Image();
topimage[2] = new Image();
topimage[3] = new Image();

topbutton[0] = new Image();
topbutton[1] = new Image();
topbutton[2] = new Image();
topbutton[3] = new Image();

topbutton_hover[0] = new Image();
topbutton_hover[1] = new Image();
topbutton_hover[2] = new Image();
topbutton_hover[3] = new Image();

// トップ画像
topimage[0].src = "./images/topimage_joho.jpg";
topimage[1].src = "./images/topimage_tusin.jpg";
topimage[2].src = "./images/topimage_shogai.jpg";
topimage[3].src = "./images/topimage_std.jpg";

// トップボタン画像
topbutton[0].src = "./images/topbutton_joho.jpg";
topbutton[1].src = "./images/topbutton_tusin.jpg";
topbutton[2].src = "./images/topbutton_shogai.jpg";
topbutton[3].src = "./images/topbutton_futu.jpg";

topbutton_hover[0].src = "./images/topbutton_joho_hover.jpg";
topbutton_hover[1].src = "./images/topbutton_tusin_hover.jpg";
topbutton_hover[2].src = "./images/topbutton_shogai_hover.jpg";
topbutton_hover[3].src = "./images/topbutton_futu_hover.jpg";

//-------------------------------------
// 背景画像の変更
//-------------------------------------
function BGChange(id, image) {

	$("#" + id).css("background-image","url(" + image + ")");
}
//-------------------------------------
// トップボタンマウスアウト時の処理
//-------------------------------------
function topbutton_out() {

	BGChange("topimage", topimage[3].src);
	BGChange("topbutton_joho", topbutton[0].src);
	BGChange("topbutton_tusin", topbutton[1].src);
	BGChange("topbutton_shogai", topbutton[2].src);
	BGChange("topbutton_futu", topbutton[3].src);

}
//-------------------------------------
// トップボタンマウスオーバー時の処理
//-------------------------------------
function topbutton_over(subject) {
	
	if(subject == "joho") n=0;
	else if(subject == "tusin") n=1;
	else if(subject == "shogai") n=2;
	else n=3;

	BGChange("topimage", topimage[n].src);
	BGChange("topbutton_" + subject, topbutton_hover[n].src);
}
