
var DELAY = 7000;  // Delay between images
var PHOTOS = 2;    // Total number of images

$(function() {
        window.setTimeout( nextImage, DELAY/2 )
        $("#splash-nav a").hover(
            function() {
                $(this).animate( { height: 140 } );
            },
            function() {
                $(this).animate( { height: 120 } );
            }
        );
});

var _currentIndex = 0;  
function nextImage() {
    var curr = splashImage( _currentIndex );
    _currentIndex++;
    _currentIndex = _currentIndex%2;
    var next = splashImage( _currentIndex );
    curr.fadeOut( function() { next.fadeIn(); } );
    window.setTimeout( nextImage, DELAY );
}

function splashImage( index ) {
    return $("#splash-photo-"+index);
}

