$(function() {
    $('.pics').each(function() {
    	var $nav = $('<div class="nav"></div>').insertAfter(this);
    	
    	
    	$(this).cycle({
	        fx:     'scrollRight',
	        speed:   300,
	        timeout: 0,
	        pager:   $nav,
	        after:   onAfter
    	});
    });
    
    function onAfter(curr, next, opts) {
        var src = '&nbsp;';
        if (next.src)
    		src = next.src.match(/([a-zA-Z0-9\.]+$)/)[1];
    	$(curr).parent().nextAll('div.caption:first').html(src);
    }
});