$.fn.cycle.defaults.timeout = 6000;
$(function() {
    // run the code in the markup!
    $('table pre code').not('#skip,#skip2').each(function() {
        eval($(this).text());
    });
    
 
    $('#s1').cycle({
    fx:     'fade',
    timeout: 3500,
    delay: 0,
    speed: 900
    });

    $('#s2').cycle({
    fx:     'fade',
    speed:  900,
    prev:   '#n2',
    timeout: 0
    });

    $('#s3').cycle({
    fx:     'fade',
    speed:  900,
    prev:   '#n3',
    timeout: 0
    });

    $('#s4').cycle({
    fx:     'fade',
    speed:  900,
    prev:   '#n4',
    timeout: 0
    });

    $('#s5').cycle({
    fx:     'fade',
    speed:  900,
    prev:   '#n5',
    timeout: 0
    });

    $('#s6').cycle({
    fx:     'fade',
    speed:  900,
    prev:   '#n6',
    timeout: 0
    });

    $('#s7').cycle({
    fx:     'fade',
    speed:  900,
    prev:   '#n7',
    timeout: 0
    });

    $('#s8').cycle({
    fx:     'fade',
    speed:  900,
    prev:   '#n8',
    timeout: 0
    });

    $('#s9').cycle({
    fx:     'fade',
    speed:  900,
    prev:   '#n9',
    timeout: 0
    });

    $('#s10').cycle({
    fx:     'fade',
    speed:  900,
    prev:   '#n10',
    timeout: 0
    });


    $('#s11').cycle({
    fx:     'fade',
    speed:  900,
    prev:   '#n11',
    timeout: 0
    });

    $('#s12').cycle({
    fx:     'fade',
    speed:  900,
    prev:   '#n12',
    timeout: 0
    });

    $('#s13').cycle({
    fx:     'fade',
    speed:  900,
    prev:   '#n13',
    timeout: 0
    });

    $('#s14').cycle({
    fx:     'fade',
    speed:  900,
    prev:   '#n14',
    timeout: 0
    });

    $('#s15').cycle({
    fx:     'fade',
    speed:  900,
    prev:   '#n15',
    timeout: 0
    });

    $('#s16').cycle({
    fx:     'fade',
    speed:  900,
    prev:   '#n16',
    timeout: 0
    });

    $('#s17').cycle({
    fx:     'fade',
    speed:  900,
    prev:   '#n17',
    timeout: 0
    });

    $('#s18').cycle({
    fx:     'fade',
    speed:  900,
    prev:   '#n18',
    timeout: 0
    });

    $('#s19').cycle({
    fx:     'fade',
    speed:  900,
    prev:   '#n19',
    timeout: 0
    });

    $('#s20').cycle({
    fx:     'fade',
    speed:  900,
    prev:   '#n20',
    timeout: 0
    });
});

function onBefore() {
    $('#output').html("Scrolling image:<br>" + this.src);
    //window.console.log(  $(this).parent().children().index(this) );
}
function onAfter() {
    $('#output').html("Scroll complete for:<br>" + this.src)
        .append('<h3>' + this.alt + '</h3>');
}