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

function slideShow() {
	jQuery('#Slideshow a').css({opacity: 0.0});
	jQuery('#Slideshow a:first').css({opacity: 1.0});
	jQuery('#Slideshow .caption').css({opacity: 0.7});
	jQuery('#Slideshow .caption').css({width: jQuery('#Slideshow a').find('img').css('width')});
	jQuery('#Slideshow .content').html(jQuery('#Slideshow a:first').find('img').attr('alt'))
	.animate({opacity: 0.7}, 400);
	setInterval('gallery()',6000);	
}

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

	jQuery('#Slideshow .caption').animate({opacity: 0.0}, { queue:false, duration:50 }).animate({height: '1px'}, { queue:true, duration:300 });	
	jQuery('#Slideshow .caption').animate({opacity: 0.7},100  ).animate({height: '40px'},500 );
	jQuery('#Slideshow .content').html(caption);	
}
