jQuery.extend({shingakuHeader:{
	overwrite : function(divId, actionUrl){
		$.ajax({
			url: actionUrl,
			type: "get",
			cache: false,
			data: {},
			success: function(html){
				if(html.length > 0){
					$(divId).empty().append(html);

					// EventHandler.bindを使用すると、ajaxの通信タイミングによって、
					// hoverイベントが２重に登録される可能性があるので、
					// 独自セレクタを使用して、hoverGifを実現する
					$(divId + " .hoverGifShingakuHeaderImg").hover(
						function(){src = $(this).attr('src').replace(/\.(gif|jpg)$/,"_r.$1"); $(this).attr('src',src)},
						function(){;src = $(this).attr('src').replace(/_r\.(gif|jpg)$/,".$1"); $(this).attr('src',src)}
					);
				}
				$(divId).show();
				var parent = $(divId).parent();
				if(parent.height() < $(divId).attr("offsetHeight")) {
					parent.height($(divId).attr("offsetHeight"));
				}
			},
			error : function(XMLHttpRequest, textStatus, errorThrown){
				// とりあえず、なんかエラーのとき
				$(divId).show();
			}
		});
	}
}});
