$.fn.cycle.defaults.timeout = 6000;
$(function() {
    // run the code in the markup!
    $('table pre code').not('#skip,#skip2').each(function() {
        eval($(this).text());
    });
    
    $('#s4').after('<div id="nav" class="nav">').cycle({
        fx:     'fade',
        speed:  'slow',
        timeout: 0, 
        pager:  '#nav',
		before:  onBefore, 
   		after:   onAfter
		
    
    });
});

function onBefore() {
    $('.output').html('<p>' + this.alt + '</p>');
    //window.console.log(  $(this).parent().children().index(this) );
}
function onAfter() {
    $('.output').html('<p>' + this.alt + '</p>');
}