$(function(){
	$("[class*=expand]").find("button")
	.click(function(){
		//ボタン全てに対してbackgroundを戻す処理を行うので注意。
		var buttons = document.getElementsByTagName("button");
		for( var i = 0; i < buttons.length; i++){
			buttons[i].style.backgroundImage = 'url("../image/button_gra1.png")';
			buttons[i].selected = 0;
		}
		this.selected = 1;
		this.style.backgroundImage = 'url("../image/button_gra2.png")';
	})
	.mouseover(function() {
		if( this.selected != 1 ){
			this.style.backgroundImage = 'url("../image/button_gra3.png")';
		}
	})
	.mouseout(function() {
		if( this.selected != 1 ){
			this.style.backgroundImage = 'url("../image/button_gra1.png")';
		}
	});
});

function onLoadChange( gamenId ){
	var selected_button = document.getElementById(gamenId);
	if( selected_button != null){
		selected_button.selected = 1;
		selected_button.style.backgroundImage = 'url("../image/button_gra2.png")';
	}
}