$(function(){

//動的アイテムにクラス付与	
	$("#topPage #leftCol #newsBox dd:last").addClass("last");
	$("#breadcrumb li:last").addClass("last");
	$("#product #rightCol #brandBox li:lt(3)").addClass("top");
	$("#corpInfo #leftCol div.section:last").addClass("last");
	$("#corpInfo #leftCol #infoDetail dd:last").addClass("last");
	$("#recipe #leftCol ul.categoryBox01 li:nth-child(3n)").addClass("r");
	$("#recipe #leftCol ul.categoryBox02 li:last-child").addClass("last");
	$("#recipe #rightCol #midArea dl:odd").addClass("odd");
	$("#recipe #rightCol #itemList li:nth-child(3n)").addClass("r");
	$("#recipe.detail #rightCol #productArea dl:lt(2)").addClass("top");
	$("#recipe.detail #rightCol #howArea ol").each(function () {
		$('li',this).each(function (i) {
			i = i+1;
			$(this).addClass("n"+i);
		});
	});
	

//TOP画像クロスフェード	
	$('#mainImg img:gt(0)').hide();
	setInterval(function(){$('#mainImg img:first-child').fadeOut(1500).next('img').fadeIn(1500).end().appendTo('#mainImg');}, 6000);



//レシピ一覧ページの検索数検出	
	var listNum = $("#itemList li").length;
	$("#itemList p").append("　"+listNum+"件");

//ロールオーバー設定
	$("img.rollover").each(function() {
		var off = this.src;
		var dot = this.src.lastIndexOf('.');
		var on = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);
		$(this).hover(
			function() { this.src = on; },
			function() { this.src = off; });
		});
	
//ローテーションバナー制御
	$("#ban .top a").mouseover(function(){
		$("#ban .top a").addClass("on");
	});
	$("#ban .bottom a").mouseover(function(){
		$("#ban .bottom a").addClass("on");
	});
	$("#ban .top a").mouseout(function(){
		$("#ban .top a").removeClass("on");
	});
	$("#ban .bottom a").mouseout(function(){
		$("#ban .bottom a").removeClass("on");
	});

});



