$( document ).ready( function () {
    $('#wrapper').css('opacity',"0");
});

$( window ).load( function () {
    $('#wrapper').animate({ opacity: 1}, 1500, 'easeInOutQuart' , function() {
        $('#top-img > ul').innerfade({
            speed: 1000,
            timeout: 6000,
            type: 'sequence',
            containerheight: '704px'
        });
        
        $('#navi').animate({ opacity: 1}, 2000, 'easeOutCubic' , function() {
            $(this).scrollFollow({
                speed: 1000,
                killSwitch: 'exampleLink',
                easing: 'easeOutQuint',
                onText: 'Disable Follow',
                offText: 'Enable Follow'
            });
        });
    });
    

    jQuery.easing.quart = function (x, t, b, c, d) { return -c * ((t=t/d-1)*t*t*t - 1) + b; };
    
    $('a[href*=#]').click(function() {
        if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
        && location.hostname == this.hostname) {
            var $target = $(this.hash);
            $target = $target.length && $target
            || $('[name=' + this.hash.slice(1) +']');
            if ($target.length) {
                var targetOffset = $target.offset().top;
                $('html,body')
                .animate({scrollTop: targetOffset}, 500);
                return false;
            }
        }
    });
    
    
    $('#menu a').click(function(){
        $('#menu a').removeClass('active');
        $(this).addClass('active');
    });
    
    $('#header a, .content_footer>p>a>img').click(function(){
        $('#menu a').removeClass('active');
    });
    
    $('.content img').fadeTo(1000, 1, function() {
        //$('#menu ul li a').css("background-color","#000");
    });

    
    $('#header > h1 > a').hover(function(){
        $(this).fadeTo(200, 0.4);
    }, function() {
        $(this).fadeTo(800, 1);
    
    });
    
    $("#takumi_area a").blend(500);
    $("#menu a").blend(800);
    
});



