jQuery(document).ready(function() {

   	jQuery('#slideshow .images').cycle({
   	    fx:       'fade',
   	    timeout:   10000,
   	    after:     onAfter,
   	    next:	   '.next',
   	    prev:	   '.prev'
   	});
    	
   	// caption show/hide
	jQuery('#slideshow').hover(
		function () {
    	    jQuery(this).children('.caption').animate({height: 35}, 500);    
    	}, 
    	function () {
    		 jQuery(this).children('.caption').animate({height: 0}, 500);	
		}
	);
		
	// slideshow caption function
	function onAfter(curr,next,opts) {
		var caption = 'Image ' + (opts.currSlide + 1) + ' of ' + opts.slideCount;
		jQuery('.caption span').html(caption);
		jQuery('.caption div').html(this.title);
	}  
});

