// イベントハンドルの設定
Event.observe(window, "load", setEventHandle, false);

// イベントハンドラの紐付け
function setEventHandle() {
	var imgChangeButtons = document.getElementsByClassName("img_change_button");
	imgChangeButtons.each(function(obj) {
		Event.observe(obj, "mouseover", function(){ buttonMouseOver(obj);}, false);
		Event.observe(obj, "mouseout", function(){ buttonMouseOut(obj);}, false);
	});
}

// マウスオーバーで画像を変更
function buttonMouseOver(obj) {
	if ( obj.src.indexOf("_c.") == -1) {
		obj.src = obj.src.replace(".gif", "_h.gif");
		obj.src = obj.src.replace(".png", "_h.png");
	}
}

// マウスアウトで画像を変更
function buttonMouseOut(obj) {
  obj.src = obj.src.replace("_h.gif", ".gif");
  obj.src = obj.src.replace("_h.png", ".png");
}

