$(document).ready(function() {        
    slideShow(10);
});  
function slideShow(speed) {  
  
  	speed *= 1000;
  
    //append a LI item to the UL list for displaying caption  
    $('ul.slideshow').parent().append('<div id="slideshow-caption" class="caption alpha"><div class="slideshow-caption-container"><h2 style="color: #C3BA9B"></h2><p></p></div></div><a id="prev" class="ssnav">prev</a><a id="next" class="ssnav">next</a>');  
    $('ul.slideshow').cycle({ prev: '#prev', next: '#next', timeout: speed, before: onBefore, after: onAfter, pause: true});

    function onBefore() {
        var c = $('#slideshow-caption');
        c.animate({bottom: - (c.height()), opacity: 0}, 300);
    }

    function onAfter() {
        $('#slideshow-caption h2').html( $(this).find('img').attr('title') );
        $('#slideshow-caption p').html( $(this).find('p').html() );
        $('#slideshow-caption').animate({ bottom: 0, opacity: 1 }, 500);
    }
      
}