$(function () {
    jQuery.event.add(window, "load", backgroundResize);
    jQuery.event.add(window, "resize", backgroundResize);

    function backgroundResize() {
        h = $(window).height();
        w = $(window).width();
		g = (h / 8);
        $(".windowArea").css("height", h).css("width", w);
		$(".gear8Line").css("margin-top", -g).css("margin-bottom", -g);
		
		for (p = 1; p <= 2; p++) { $("#profileRoll_" + p).css("left", w * p).css("height", h).css("width", w) }
		for (v = 1; v <= 9; v++) { $("#valueRoll_" + v).css("left", w * v).css("height", h).css("width", w) }
		for (l = 1; l <= 4; l++) { $("#styleRoll_" + l).css("left", w * l).css("height", h).css("width", w) }
        for (s = 1; s <= 5; s++) { $("#staffRoll_" + s).css("left", w * s).css("height", h).css("width", w) }
		for (r = 1; r <= 5; r++) { $("#recruitRoll_" + r).css("left", w * r).css("height", h).css("width", w) }
		
	}
	
	contentLoad();
});



function contentLoad() {
	
	
	
	


	$("#profile .slide_btn").click(function (){
       profileCurNum = $(this).attr("href").split("_")[1];
            var profilePosX = -w * profileCurNum;
			$("#profile").stop().animate({ marginLeft: profilePosX },{ easing: "easeOutExpo", duration: 1600 });
		});
		$("a:not(#profile .slide_btn)").click(function () {
            $("#profile").stop().animate({ marginLeft: 0 },{ easing: "easeOutExpo", duration: 1600 });
    });
	
	$("#style .slide_btn").click(function (){
       styleCurNum = $(this).attr("href").split("_")[1];
            var stylePosX = -w * styleCurNum;
			$("#style").stop().animate({ marginLeft: stylePosX },{ easing: "easeOutExpo", duration: 1600 });
		});
		
		$("a:not(#style .slide_btn)").click(function () {
            $("#style").stop().animate({ marginLeft: 0 },{ easing: "easeOutExpo", duration: 1600 });
    });
	
	
		
	$("#flow .flow_btn a").click(function (){
		flowCurNum = $(this).attr("href").split("0")[1];
		flow_in = "'#flow0' + flowCurNum"
			
		
			
			
			/*
			
   				 $(".animalList dl").hover(function () {
      			  $("dd", this).fadeTo(200, 1)
  			  }, function () {
  	      			$("dd:not(.now)", this).fadeTo(200, 0)
  			  });
				*/
			
			
			
			
			
	});
	

	$("#value .slide_btn").click(function (){
        valueCurNum = $(this).attr("href").split("_")[1];
            var valuePosX = -w * valueCurNum;
			$("#value").stop().animate({ marginLeft: valuePosX },{ easing: "easeOutExpo", duration: 1600 });
		});
		$("a:not(#value .slide_btn)").click(function () {
            $("#value").stop().animate({ marginLeft: 0 },{ easing: "easeOutExpo", duration: 1600 });
    });
	
	
	$("#staff .slide_btn").click(function (){
        staffCurNum = $(this).attr("href").split("_")[1];
            var staffPosX = -w * staffCurNum;
			$("#staff").stop().animate({ marginLeft: staffPosX },{ easing: "easeOutExpo", duration: 1600 });
		});
		$("a:not(#staff .slide_btn)").click(function () {
            $("#staff").stop().animate({ marginLeft: 0 },{ easing: "easeOutExpo", duration: 1600 });
    });
	
	$("#recruit .slide_btn").click(function (){
        recruitCurNum = $(this).attr("href").split("_")[1];
            var recruitPosX = -w * recruitCurNum;
			$("#recruit").stop().animate({ marginLeft: recruitPosX },{ easing: "easeOutExpo", duration: 1600 });
		});
		$("a:not(#recruit .slide_btn)").click(function () {
            $("#recruit").stop().animate({ marginLeft: 0 },{ easing: "easeOutExpo", duration: 1600 });
    });
	
	 $(".animalList dd:not(.now)").fadeTo(0, 0);
    $(".animalList dl").hover(function () {
        $("dd", this).fadeTo(200, 1)
    }, function () {
        $("dd:not(.now)", this).fadeTo(200, 0)
    });
	
	
	
	$("a[href*='#']").easingScroll({
        easing: "easeOutExpo",
        duration: 1600
	});
};
$(function() {
	$('#profileLoad').one('click',function() {
		 $("#profileRoll_1").load("profile/company.html", function(){contentLoad();});
	});
});

$(function() {
	$('a.styleLoad').one('click',function() {
/*		 $("#styleRoll_1").load("style/flow.html");*/
		 $("#styleRoll_2").load("style/reason.html");
		 $("#styleRoll_3").load("style/price.html", function(){contentLoad();});
	});
});

$(function() {
	$('a.staffLoad').one('click',function() {
		 $("#staffRoll_1").load("staff/mizuno.html");
		 $("#staffRoll_2").load("staff/wakasa.html");
		 $("#staffRoll_3").load("staff/fukumi.html");
		 $("#staffRoll_4").load("staff/maekoya.html", function(){contentLoad();});
	});
});

$(function() {
	$('a.recruitLoad').one('click',function() {
		 $("#recruitRoll_1").load("recruit/panda.html");
		 $("#recruitRoll_2").load("recruit/falcon.html");
		 $("#recruitRoll_3").load("recruit/deer.html");
		 $("#recruitRoll_4").load("recruit/wolf.html", function(){contentLoad();});
	});
});

$(function() {
	$('a.valueLoad').one('click',function() {
		 $("#valueRoll_1").load("value/num01.html");
		 $("#valueRoll_2").load("value/num02.html");
		 $("#valueRoll_3").load("value/num03.html");
		 $("#valueRoll_4").load("value/num04.html");
		 $("#valueRoll_5").load("value/num05.html");
		 $("#valueRoll_6").load("value/num06.html");
		 $("#valueRoll_7").load("value/num07.html");
		 $("#valueRoll_8").load("value/num08.html", function(){contentLoad();});
	});
});


		


