(function($) {  
$(document).ready(function() {            
    slideShow();
});
})(jQuery)
function slideShow() {
    $('#slideshow div').css({opacity: 0.0});
    $('#slideshow div:first').css({opacity: 1.0});
    $('#slideshow .caption').css({opacity: 0.5});
    //$('#slideshow .caption').css({width: $('#slideshow div').find('img').css('width')});
    $('#slideshow .content1').html($('#slideshow div:first').find('img').attr('title'))
    .animate({opacity: 1}, 400);
    setInterval('gallery()',6000);  
}

function gallery() {
    var current = ($('#slideshow div.show')?  $('#slideshow div.show') : $('#slideshow div:first'));
    var next = ((current.next().length) ? ((current.next().hasClass('caption'))? $('#slideshow div:first') :current.next()) : $('#slideshow div:first'));    
    var caption = next.find('img').attr('title');    
    next.css({opacity: 0.0})
    .addClass('show')
    .animate({opacity: 1.0}, 1000);

    current.animate({opacity: 0.0}, 1000)
    .removeClass('show');
    
    $('#slideshow .caption').animate({opacity: 0.0}, { queue:false, duration:0 }).animate({height: '1px'}, { queue:true, duration:300 });    
    $('#slideshow .caption').animate({opacity: 0.5},100 ).animate({height: '35px'},500 );
    $('#slideshow .content1').html(caption);  
}