var $j = jQuery.noConflict();
jQuery(document).ready(function($j){ 

// SLIDESHOW
$j('#slide').innerfade({
speed: 750,
timeout: 4000,
type: 'random_start',
containerheight: '250px'
});

// LIGHTBOX
$j(function() {
$j('#news a[href*=assets/images/]').lightBox({
									 fixedNavigation:true,
									 overlayBgColor:'#fff',
									 overlayOpacity:0.8,
									 imageLoading: 'assets/images/loading.gif', 
									 imageBtnClose: 'assets/images/close.gif',
									 imageBtnNext: 'assets/images/next.gif',
									 imageBtnPrev: 'assets/images/prev.gif',
									 containerResizeSpeed:400
									 });
});

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


function onBefore() {
    $j('#output').html("Scrolling image:<br>" + this.src);
    //window.console.log(  $(this).parent().children().index(this) );
}
function onAfter() {
    $j('#output').html("Scroll complete for:<br>" + this.src)
        .append('<h3>' + this.alt + '</h3>');
}
});
});