$(document).ready(function() {
    $(window).scroll(function(){
        if($(window).scrollTop()>=200){
            $('#back-to-top').fadeIn();
        }
        else {
            $('#back-to-top').fadeOut();
        };
    });
    $('#back-to-top').unbind('click').live('click', function() {
        var time = $(window).height() + $(window).scrollTop() * 0.3;
        $("html, body").animate({ scrollTop: 0 }, (time > 1000) ? 1000 : time, function(x, t, b, c, d) { return c * ((t = t / d - 1) * t * t * t * t + 1) + b; });
        return false;
    });
    
    $('a.launch').hide();
    $('#this_is_my_work .container').hover(
        function() {
            $(this).children('.launch').fadeIn('fast');
        },
        function() {
            $(this).children('.launch').fadeOut('fast');
        }
    );
})
