$(document).ready(function(){

	/**********************************
	 * 共通
	 **********************************/
	//マウスオーバー処理
	$("img.roll,input[type='image'].roll").mouseover(function(){
		$(this).attr("src", $(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_on$2"));
	}).mouseout(function(){
		$(this).attr("src", $(this).attr("src").replace(/^(.+)_on(\.[a-z]+)$/, "$1$2"));
	}).focus(function(){
		$(this).attr("src", $(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_on$2"));
	}).blur(function(){
		$(this).attr("src", $(this).attr("src").replace(/^(.+)_on(\.[a-z]+)$/, "$1$2"));
	}).each(function(){
		$("<img>").attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_on$2"));
	});

	//ボックス３パーツ構成用
	$("div.box > img").css({display:"block", margin:"0"});

	//サイドバー用設定
	$("#bloc_sidebar").each(function(){
		$("dl:last",this).css("margin-bottom","0");
		$("ul",this).each(function(){
			$("li:last",this).css("border","0");
		});
	});

	/**********************************
	 * フォーム
	 **********************************/
	var max = 0;
	$("form#form1 label.name1").each(function(){
		if ($(this).width() > max)
			max = $(this).width();
	});
	$("form#form1 label.name1").width(max);

	var max = 0;
	$("form#form1 label.name2").each(function(){
		if ($(this).width() > max)
			max = $(this).width();
	});
	$("form#form1 label.name2").width(max);

	/**********************************
	 * テーブルの一覧パターン
	 **********************************/
	/* マウスオーバー時 */
	$("table.disp .onmouse").each(function(){
		$("tr",this).mouseover(function(){
			$("th,td",this).css("background-color","#f6f9f2");
		}).mouseout(function(){
			$("th,td",this).css("background-color","transparent");
		}).each(function(){
			$("th,td",this).css("background-color","transparent");
		});
	});

	/* under02column_shopping */
	$("div#under02column_shopping .onclick tr").each(function(){
		$(this).click(function(){
			$("input[type='radio']",this).attr("checked","checked");
		});
	});

	/* 買い物カゴの中身 */
	$("div#under02column_cart tbody").each(function(){
		//マウスオーバー時
		$("tr",this).mouseover(function(){
			$("td",this).css("background-color","#f6f9f2");
		}).mouseout(function(){
			$("td",this).css("background-color","transparent");
		}).each(function(){
			$("td",this).css("background-color","transparent");
		});
	});

});
