$(function () {
        // PageTopヘッダ分ずらす
        var headH = 10;

        $('a[href^=#], area[href^=#]').not('a[href=#], area[href=#]').each(function () {
                if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname && this.hash.replace(/#/, '')) {
                        var $targetId = $(this.hash),
                                $targetAnchor = $('[name=' + this.hash.slice(1) + ']');
                        var $target = $targetId.length ? $targetId : $targetAnchor.length ? $targetAnchor : false;
                        if ($target) {
                                var targetOffset = $target.offset().top - headH;
                                $(this).click(function () {
                                        jQuery.easing.quart = function (x, t, b, c, d) {
                                                return -c * ((t = t / d - 1) * t * t * t - 1) + b;
                                        };
                                        $('html, body').animate({
                                                scrollTop: targetOffset
                                        }, 500, 'quart');
                                        return false;
                                });
                        }
                }
        });
});
