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