$(function() {
    jQuery.extend(jQuery.easing, {
        easeOutQuart: function (x, t, b, c, d) {
            return -c * ((t = t / d - 1) * t * t * t - 1) + b;
        }
    });

    $('#pagetop, .pagetop').click(function(event) {
        $('html,body').stop().animate({scrollTop:0}, 500, 'easeOutQuart');
        event.preventDefault();
    });
});

