function slideShow() {
	$('#gallery a').css({opacity: 0.0});
	$('#gallery a:first').css({opacity: 1.0});
	$('#gallery .caption').css({width: $('#gallery a').find('img').css('width')});
	$('#gallery .title').html($('#gallery a:first').find('img').attr('alt')).animate({opacity: 1.0}, 500);	
	$('#gallery .content').html($('#gallery a:first').find('img').attr('rel')).animate({opacity: 1.0}, 500);
	$('#gallery .link').html($('#gallery a:first').find('img').attr('class')).animate({opacity: 1.0}, 500);
	setInterval('gallery()', 8000); // pause (ms) per slide
}
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'));	
	var title = next.find('img').attr('alt');
	var caption = next.find('img').attr('rel');	
	var link = next.find('img').attr('class');	

	// Fade in/out image
	next.css({opacity: 0.0}).addClass('show').animate({opacity: 1.0}, 1000);
	current.animate({opacity: 0.0}, 1000).removeClass('show');

	// Display the title
	$('#gallery .title').html(title);
	Cufon.replace('#gallery .caption .title');

	// Display the content
	$('#gallery .content').html(caption);
	Cufon.replace('#gallery .caption .content');
	
	$('#gallery .link').html(link);
}

