function slideShow() {
	var delay = 5000;	//intervallo slideshow

	//Hidden all images Banner alto
	$('#galleryS1 a').hide();
	//Hidden all images Banner basso
	$('#galleryS2 a').hide();

	//Get the first image and display it Banenr alto
	$('#galleryS1 a:first').show();
	//Get the first image and display it Banenr basso
	$('#galleryS2 a:first').show();

	//Call the gallery function to run the slideshow, 6000 = change to next image after 6 seconds
	setInterval('gallery()', delay);
}

function gallery() {
	var fade = 1000;	//durata fade 200=hight 600=slow 100==superslow

	//if no IMGs have the show class, grab the first image banner alto
	var current = ($('#galleryS1 a.show')?  $('#galleryS1 a.show') : $('#galleryS1 a:first'));
	//if no IMGs have the show class, grab the first image banner basso
	var current2 = ($('#galleryS2 a.show')?  $('#galleryS2 a.show') : $('#galleryS2 a:first'));

	//Get next image, if it reached the end of the slideshow, rotate it back to the first image banner alto
	var next = ((current.next().length) ? ((current.next().hasClass('caption'))? $('#galleryS1 a:first') :current.next()) : $('#galleryS1 a:first'));
	//Get next image, if it reached the end of the slideshow, rotate it back to the first image banner basso
	var next2 = ((current2.next().length) ? ((current2.next().hasClass('caption'))? $('#galleryS2 a:first') :current2.next()) : $('#galleryS2 a:first'));

	//View next with fadeIn banner alto
	next.fadeIn(fade)
	.addClass('show');
	//View next with fadeIn banner basso
	next2.fadeIn(fade)
	.addClass('show');

	//Hide the current image with fade out banner alto
	current.fadeOut(1000)
	.removeClass('show');
	//Hide the current image with fade out banner basso
	current2.fadeOut(1000)
	.removeClass('show');
}
