//イージング関数
jQuery.easing.quart = function (x, t, b, c, d) {
    return -c * ((t=t/d-1)*t*t*t - 1) + b;
};  

//セレクタ設定(ここではすべてのアンカー
//「a[href^=#]」ここをクラス名に変えればそれがついたアンカーのみスムーズスクロールになる)
$(document).ready(function(){
    $('a[href^=#]').click(function(){
        var target;
        target = $( $(this).attr('href') );
        if (target.length == 0) {
            return;
        }
        $($.browser.opera ? document.compatMode == 'BackCompat' ? 'body' : 'html' :'html,body').animate({scrollTop: target.offset().top}, 800, 'quart');
        return false;
    });
});

