// JavaScript Document

/*  ================================================================================
 商品ページ
================================================================================  */
$(function() {
	/*  user_data商品ページ 一番上のタイトルにクラス
	================================ */
	$('#list_toDetail h2:first').addClass('reset');
});


/*  ================================================================================
 table
================================================================================  */
$(function() {		
	
	//1行目左寄席
	$('table.price tr').each(function(i){
		$('td',this).eq(0).addClass('alignL');
	});
	//1行目の左寄せ外す
	$('table.price.union tr').each(function(i){
		$('td',this).eq(0).removeClass('alignL');
	});
					 
	 /*  指定列にクラス(5行）
	================================ */
	$('table.price.R5 td:nth-child(4n)').addClass('priceCell');
	$('table.price.R5 td:nth-child(5n)').addClass('reset');
	
	$('table.price.R5 th:eq(4)').addClass('reset');
	
	 /*  指定列にクラス(6行）
	================================ */
	$('table.price.R6 td:nth-child(5n)').addClass('priceCell');
	$('table.price.R6 td:nth-child(6n)').addClass('reset');
	
	$('table.price.R6 th:eq(5)').addClass('reset');
	
	
		/*  指定列にクラス(7行）
	================================ */
	$('table.price.R7 td:nth-child(6n)').addClass('priceCell');
	$('table.price.R7 td:nth-child(7n)').addClass('reset');
	
	$('table.price.R7 th:eq(6)').addClass('reset');
	
	/*  指定列にクラス(8行）
	================================ */
	$('table.price.R8 td:nth-child(7n)').addClass('priceCell');
	$('table.price.R8 td:nth-child(8n)').addClass('reset');
	
	$('table.price.R8 th:eq(7)').addClass('reset');
	
		/*  指定列にクラス(9行）
	================================ */
	$('table.price.R9 td:nth-child(8n)').addClass('priceCell');
	$('table.price.R9 td:nth-child(9n)').addClass('reset');
	
	$('table.price.R9 th:eq(8)').addClass('reset');
	
		/*  指定列にクラス(10行）
	================================ */
	$('table.price.R10 td:nth-child(9n)').addClass('priceCell');
	$('table.price.R10 td:nth-child(10n)').addClass('reset');
	
	$('table.price.R10 th:eq(9)').addClass('reset');
	
	
		 /*  指定列にクラス(6行結合あり）
	================================ */
	$('table.price.R6_union td:nth-child(4n)').addClass('priceCell');
	$('table.price.R6_union td:nth-child(5n)').addClass('reset');
	
	$('table.price.R6_union th:eq(5)').addClass('reset');
	
			 /*  指定列にクラス(7行結合あり）
	================================ */
	$('table.price.R7_union td:nth-child(5n)').addClass('priceCell');
	$('table.price.R7_union td:nth-child(6n)').addClass('reset');
	
	$('table.price.R7_union th:eq(6)').addClass('reset');
	
	
			/*  指定列にクラス(7行number）
	================================ */
	$('table.price.R7_number td:nth-child(6n)').addClass('priceCell');

});


/*  ================================================================================
ロールオーバー
================================================================================  */
function fnrollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");

		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_off."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
				}
			}
		}
		
	}
}

if(window.addEventListener) { //for W3C DOM
	window.addEventListener("load", fnrollover, false);
}
else if(window.attachEvent) { //for IE
	window.attachEvent("onload", fnrollover);
};


/*  ================================================================================
 list.tpl
================================================================================  */
/*$(function(){
	$('#list_area_wrap li.list_area:nth-child(4n+1)').addClass('clear');
});*/



