// JavaScript Document
function slideShow() {
	$('#top_slide a').css({opacity: 0.0});
	$('#top_slide a:first').css({opacity: 1.0});
	$('#top_slide .caption').css({opacity: 0.7});
	$('#top_slide .caption').css({width: $('#top_slide a').find('img').css('width')});
	setInterval('gallery()',10000);
	
}

function gallery() {
	var current = ($('#top_slide a.show')?  $('#top_slide a.show') : $('#top_slide a:first'));
	var next = ((current.next().length) ? ((current.next().hasClass('caption'))? $('#top_slide a:first') :current.next()) : $('#top_slide a:first'));	
	var caption = next.find('img').attr('rel');	
	next.css({opacity: 0.0})
	.addClass('show')
	.animate({opacity: 1.0}, 1000);
	current.animate({opacity: 0.0}, 1000)
	.removeClass('show');
	$('#top_slide .caption').animate({opacity: 0.0}, { queue:false, duration:0 }).animate({height: '1px'}, { queue:true, duration:300 });	
	$('#top_slide .caption').animate({opacity: 0.7},100 ).animate({height: '100px'},500 );
	$('#top_slide .content').html(caption);
}

