// JavaScript Document

//スクロール
$(function(){
$("li.menu01 a").click(function(){
$("html,body").animate({
scrollTop:"740px",
scrollLeft:"0px"
},{
easing:"easeInOutCubic",
duration:1200
});
});
$("li.menu02 a").click(function(){
$("html,body").animate({
scrollTop:"1308px",
scrollLeft:"0px"
},{
easing:"easeInOutCubic",
duration:1200
});
});
$("li.menu03 a").click(function(){
$("html,body").animate({
scrollTop:"1821px",
scrollLeft:"0px"
},{
easing:"easeInOutCubic",
duration:1200
});
});
$("#header .logo a").click(function(){
$("html,body").animate({
scrollTop:"0px",
scrollLeft:"0px"
},{
easing:"easeInOutCubic",
duration:1200
});
});
});

//リサイズ時
$(function(){
bgsize();
function resizeContainer(e){
bgsize();
}
$(window).bind("resize", resizeContainer);
});

//背景サイズ
function bgsize(){
bodyWidth = $("#bodyWrap").width();
bodyHeight = $("#bodyWrap").height();
$("#bgWrap01").css("width",bodyWidth + "px");
$("#bgWrap01").css("height",bodyHeight + "px");
$("#bgWrap02").css("width",bodyWidth + "px");
$("#bgWrap02").css("height",bodyHeight + "px");
$("#bgWrap03").css("width",bodyWidth + "px");
$("#bgWrap03").css("height",bodyHeight + "px");
}

//パララックス
$(function(){
$(window).scroll(function(){
var y = $(this).scrollTop();
$("#bgWrap01").css("background-position","center " + parseInt(-y/8) + "px");
$("#bgWrap02").css("background-position","center " + parseInt(-y/2) + "px");
$("#bgWrap03").css("background-position","center " + parseInt(-y) + "px");
$("#topWrap .img01").css("top", 188 - parseInt(y/7) + "px");
$("#topWrap .img02").css("top", 408 - parseInt(y/4) + "px");
$("#topWrap .img03").css("top", 550 - parseInt(y/9) + "px");
$("#topWrap .img04").css("top", 257 - parseInt(y/6) + "px");
$("#topWrap .img05").css("top", 415 - parseInt(y/8) + "px");
$("#topWrap .img06").css("top", 632 - parseInt(y/5) + "px");
$("#topWrap .txt01").css("top", 404 - parseInt(y/4) + "px");
$("#topWrap .txt02").css("top", 560 - parseInt(y/3) + "px");
$("#topWrap .txt03").css("top", 215 - parseInt(y/2) + "px");
$("#topWrap .txt04").css("top", 554 - parseInt(y/5) + "px");
$("#topWrap .txt05").css("top", 746 - parseInt(y/2) + "px");
$("#aboutWrap .img01").css("top", 322 - parseInt(y/2) + "px");
$("#aboutWrap .img02").css("top", 799 - parseInt(y/8) + "px");
$("#aboutWrap .txt01").css("top", 1360 - parseInt(y/2) + "px");
});
});
