jQuery(function(){
    $(".stuList .fadeInUp").each(function (index, element) {
        $(this).attr("data-wow-delay",index*3/10+"s");
    });
    $(".row .fadeInUp").each(function (index, element) {
        $(this).attr("data-wow-delay", index * 3 / 10 + "s");
    });
    $(".yjhl1 .fadeInUp").each(function (index, element) {
        $(this).attr("data-wow-delay", index * 3 / 10 + "s");
    });
    $(".yjhl5 .fadeInUp").each(function (index, element) {
        $(this).attr("data-wow-delay", index * 3 / 10 + "s");
    });
    $(".rollIn").each(function (index, element) {
        $(this).attr("data-wow-delay", index * 3 / 10 + "s");
    });

    $(".a_js").click(
        function () {
            $(".a_txt").stop(true, false).delay(0).animate({ width: "100%", height: "100%" }, 0);
            $(".a_txt").find(".div1").stop(true, false).delay(0).animate({ opacity: "0.9" }, 500);
            $(".a_txt").find(".div2").stop(true, false).delay(0).animate({ opacity: "1" }, 500);
            $(".a_txt").find(".div3").stop(true, false).delay(0).animate({ right: "0" }, 500);
        }
    )
    $(".a_closed").click(
        function () {
            $(".a_txt").stop(true, false).delay(500).animate({ width: "0", height: "0" }, 0);
            $(".a_txt").find(".div1").stop(true, false).delay(0).animate({ opacity: "0" }, 500);
            $(".a_txt").find(".div2").stop(true, false).delay(0).animate({ opacity: "0" }, 500);
            $(".a_txt").find(".div3").stop(true, false).delay(0).animate({ right: "-80%" }, 500);
        }
    )

    // Fixed header
    //-----------------------------------------------
    var headerHeight = $("header").outerHeight();
    $(window).scroll(function () {
        if (($(".header").length > 0)) {
            if (($(this).scrollTop() > headerHeight) && ($(window).width() > 767)) {
                $("body").addClass("fixed-header-on");
                $(".top2").addClass('animated object-visible fadeInDown');
            } else {
                $("body").removeClass("fixed-header-on");
                $(".top2").removeClass('animated object-visible fadeInDown');
            }
        };

    });

})