$(document).ready(function () {

    $('#slideshow-blog').hover(

    function () {
        $('#controls').fadeIn();
    }, function () {
        $('#controls').fadeOut();
    });

    $('#slideshow, #slideshow-work').hover(

    function () {
        $('#controls, #slides-title').fadeIn();
    }, function () {
        $('#controls, #slides-title').fadeOut();
    });

    $('#slides').cycle({
        fx: 'scrollHorz',
        speed: 1000,
        timeout: 6000,
        next: '#next',
        prev: '#previous',
        pause: 1,
        after: onAfter,
        before: function () {
            $('#slides-title').html(this.title);
            $('#box-quote').hide().html(this.title).fadeIn(1500);
            $('#box-source').hide().html(this.title).fadeIn(1500);
        }
    });

    function onAfter(curr, next, opts) {
        var caption = (opts.currSlide + 1) + ' / ' + opts.slideCount;
        $('#slideshowCurrent').html(caption);
    }


    $('.calendar-hover', this).hide();

    $('#backstage li', this).hover(

    function () {
        $('.calendar-hover', this).fadeIn();
    }, function () {
        $('.calendar-hover', this).fadeOut();
    });


});
