
jQuery.easing.easeOutQuart = function(x, t, b, c, d) {
    return -c * ((t = t / d - 1) * t * t * t - 1) + b;
};

function pager(p, s) {
    $(document).ready(function() {
        setPage(0, p);
        var sel = p + " a";
        $(sel).each(function(i) {
            $(this).click(function() {
                go(i, s, p);
                return false;
            });
        });
        $(s).click(function() {
            $(this).trigger('next');
            return false;
        });
    });
}

function setPage(i, p) {
    var sel = p + " a";
    $(sel).each(function(c) {
        if (i == c) {
            $(this).attr("class", "current");
        }
        else {
            $(this).removeAttr("class");
        }
    });
}

function go(i, s, p) {
    setPage(i, p);
    $(s).trigger('goto', [i]);
}
