
$(document).ready(function(){

$("#itemBox02 .item:nth-child(4n+4)").each(function(){
	$(this).addClass("itemR", $(this).wrap("<div class='clearfix'></div>"));
});

	/* div要素を4つずつの組に分ける */
	var sets = [], temp = [];
	$('#itemBox .item> table.tbTx').each(function(i) {
		temp.push(this);
		if (i % 4 == 3) {
		sets.push(temp);
		temp = [];
	}
	});
	if (temp.length) sets.push(temp);
	/* 各組ごとに高さ揃え */
	$.each(sets, function() {
		$(this).flatHeights();
	});

  $("#itemBox .item table.tbTx").each(function(){
    jQuery(this).find("tr:even").addClass("odd");
  });
});
$(function() {
    $("#nav01 a").click(function() {
        $.scrollTo("#box01", { offset:-20,duration: 600});
        return false;
    });
    $("#nav02 a").click(function() {
        $.scrollTo("#box02", { offset:-20,duration: 600});
        return false;
    });
    $("#nav03 a").click(function() {
        $.scrollTo("#box03", { offset:-20,duration: 600});
        return false;
    });
    $(".gotoBox04").click(function() {
        $.scrollTo("#box04", { offset:0,duration: 600});
        return false;
    });
    $("#pagetop p a").click(function() {
        $.scrollTo("#AREA_ALL", { offset:0,duration: 600});
        return false;
    });
    $("#sideBtn01").click(function() {
        $.scrollTo("#box01", { offset:-20,duration: 600});
        return false;
    });
    $("#sideBtn02").click(function() {
        $.scrollTo("#box02", { offset:-20,duration: 600});
        return false;
    });
    $("#sideBtn03").click(function() {
        $.scrollTo("#box03", { offset:-20,duration: 600});
        return false;
    });
});
$(function(){
	$("#itemBox").hide();
	$("#itemShow span").hide();
	$("#itemShow").click(function(){
		$("#itemShow span").toggle();
		var index = $("#itemShow").index(this);
		$("#itemBox").eq(index).slideToggle("normal");
		}).css("cursor","pointer");
});


/* -----------------------------------------------------------------------*/
// imageOpacity
/* -----------------------------------------------------------------------*/
$(function() {
	$(".fade_btn").hover(function() {
		$(this).fadeTo(360, 0.8)
	},function() {
		$(this).fadeTo(360, 1.0)
	});
	$("#RecipeBox .box02 .fBox .colImg a").hover(function() {
		$(this).fadeTo(360, 0.8)
	},function() {
		$(this).fadeTo(360, 1.0)
	});
});


$(function() {
	var offset = $('#pagetop').offset();
	var topPadding = 50;
	$(window).scroll(function() {
		if ($(window).scrollTop() > offset.top) {
			$('#pagetop').stop().animate({
				marginTop: $(window).scrollTop() - offset.top + topPadding
			});
		} else {
			$('#pagetop').stop().animate({
				marginTop: 0
			});
		};
	});
});



