﻿$(document).ready(function() {		
    slideShow();
});

function slideShow() {
    $('#slideshow img').css({opacity: 0.0});
    $('#slideshow img:first').css({opacity: 1.0});
    setInterval('gallery()',5000);	
}

function gallery() {
    var current = ($('#slideshow img.show')?  $('#slideshow img.show') : $('#slideshow img:first'));
    var next = ((current.next().length) ? (current.next()) : $('#slideshow img:first'));		
    next.css({opacity: 0.0})
    .addClass('show')
    .animate({opacity: 1.0}, 1000);
    current.animate({opacity: 0.0}, 1000)
    .removeClass('show');	
}