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

function slideShow() {
	$('#gallery a').css({opacity: 0.0});	
	$('#gallery a:first').css({opacity: 1.0});
	//intervallo di tempo della transizione adesso sono 4 secondi
	setInterval('gallery()',4000);
}

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