﻿
function slideShow() {
    //Set the opacity of all images to 0
    $('#gallery a:gt(1)').css({opacity: 0.0});
	
    //Call the gallery function to run the slideshow, 6000 = change to next image after 6 seconds
    setInterval('gallery()', 5000);
}



function gallery() {
    var current = $('#gallery a.show').length ? $('#gallery a.show') : $('#gallery a:first-child');
    var next = current.next().length ? current.next() : $('#gallery a:first-child');
	
    //Hide the current image
    current.animate({opacity: 0.0}, 1000).removeClass('show');

    //Set the fade in effect for the next image, show class has higher z-index
    next.css({opacity: 0.0}).addClass('show').animate({opacity: 1.0}, 1000);
}


