/*
 * encode phrase  : 男は傷の拳で美しく印刷された一冊の書を持ち憎い相手の笑いに応じた
 * encode phrase  : 牀前看月光/疑是地上霜/擧頭望山月/低頭思故郷
 * encode phrase  : 茨菰葉爛別西灣/蓮子花開猶未還/妾夢不離江上水/人傳郎在鳳凰山
 * encode phrase  : 上記の文はエディタにエンコード判定させるためのダミー文です。
 */


$( document ).ready( function() { PEPS.rollover.init(); } );
PEPS = {};
PEPS.rollover = {
init: function()
{
	this.preload();
	$( ".ro" ).hover(
		function () { $(this).attr( 'src', PEPS.rollover.newimage($(this).attr('src')) ); },
		function () { $(this).attr( 'src', PEPS.rollover.oldimage($(this).attr('src')) ); }
	);
},
preload: function()
{
	$(window).bind('load', function() {
	$('.ro').each( function( key, elm ) { $('<img>').attr( 'src', PEPS.rollover.newimage( $(this).attr('src') ) ); });
});
},
newimage: function( src )
{
	return src.substring( 0, src.search(/(\.[a-z]+)$/) ) + '_s' + src.match(/(\.[a-z]+)$/)[0];
},
oldimage: function( src )
{
	return src.replace(/_s\./, '.');
}
};

window.onload = function(){
	var col_menu_height     = 230;
	var col_contents_height = 230;
	col_menu_height = document.getElementById( 'col_menu' ).offsetHeight;
	col_contents_height = document.getElementById( 'col_contents' ).offsetHeight;
	if ( col_menu_height > col_contents_height ) {
		document.getElementById( 'col_contents' ).style.height = col_menu_height - ( col_menu_height - col_contents_height + 30 ) + "px";
	} else {
		document.getElementById( 'col_menu' ).style.height = col_contents_height - 60 + "px";
	}
}
