// Easing equation, borrowed from jQuery easing plugin
// http://gsgd.co.uk/sandbox/jquery/easing/
jQuery.easing.easeOutQuart = function (x, t, b, c, d) {
    return -c * ((t=t/d-1)*t*t*t - 1) + b;
};

$(function(){

    $('#prev').fadeTo('slow', 0.1);

    $('#header').serialScroll({
        items: 'li',
        prev: '#gallery-container a#prev',
        next: '#gallery-container a#next',
        offset: 0,
        start: 0,
        duration: 1200,
        force: true,
        stop: true,
        lock: false,
        cycle: false,
        easing: 'easeOutQuart',
        jump: false,
        onBefore: function( e, elem, $pane, $items, pos ){
            $('#prev, #next').fadeTo('slow', 1);
            if(pos == 0)
                $('#prev').fadeTo('slow', 0.1);
            else if(pos == $items.length - 1)
                $('#next').fadeTo('slow', 0.1);
           }
    });

    //$('a.gallery-navigation').hoverIntent(fadeOut, fadeIn);
    //
    //function fadeOut(){
    //    $(this).fadeTo('slow', 0.5);
    //}
    //
    //function fadeIn() {
    //    $(this).fadeTo('slow', 1);
    //}
});