// メインビジュアル 画像切替
function slideSwitch(){

	$active = $("#mainPhoto img.active");
//	if($active.length == 0){
//		$active = $("#mainPhoto img:last");
//	}

	$next = $active.next().length ? $active.next() : $("#mainPhoto img:first");

	$active.addClass("lastActive");

	$next.css("opacity", "0").addClass("active").animate({opacity: 1}, 2000, function(){
		$active.removeClass("active lastActive");
	});
}

$(function(){

	var length = $("#mainPhoto img").length;
	var ran = Math.floor(Math.random()*length) + 1;
	$("#mainPhoto img:nth-child(" + ran + ")").fadeIn(100, function(){
		$(this).addClass("active");
		$("#mainPhoto img:hidden").show();
		setInterval("slideSwitch()", 6000);
	});


// 柿安のおすすめ　レイアウト調整
	$(".recommend ul li:first").css("width", "200px");
	$(".recommend ul li a").hover(function(){
		$("img", this).css("opacity", "0.6");
	},
	function(){
		$("img", this).css("opacity", "1");
	});

// 料理から選ぶ・こだわりから選ぶ　レイアウト調整
	$(".fromMenu ul li:nth-child(3n)").css("margin-right", "0");
	$(".fromTaste ul li:nth-child(2n)").css("margin-right", "0");

});
