function slideShow() {

 $('#gallery span').css({opacity: 0.0});

 $('#gallery span:first').css({opacity: 1.0});

 $('#gallery .caption').css({opacity: 0.7});

 $('#gallery .caption').css({width: $('#gallery span').find('img').css('width')});

 $('#gallery .content').html($('#gallery span:first').find('img').attr('rel')).animate({opacity: 0.7}, 400);

 setInterval('gallery()',6000);

}

function gallery() {

 var current = ($('#gallery span.show')? $('#gallery span.show') : $('#gallery span:first'));
 next = ((current.next().length) ? ((current.next().hasClass('caption'))? $('#gallery span:first') :current.next()) : $('#gallery span:first'));

 next.css({opacity: 0.0})
 .addClass('show')
 .animate({opacity: 1.0}, 1000);

 current.animate({opacity: 0.0}, 1000)
 .removeClass('show');

 $('#gallery .caption').animate({opacity: 0.0}, { queue:false, duration:0 }).animate({height: '1px'}, { queue:true, duration:300 });

 $('#gallery .caption').animate({opacity: 0.7},100 ).animate({height: '30px'},500 );
}
