var FullscreenrOptions = {  width: 1920, height: 1090, bgID: '#bgimg' };
jQuery.fn.fullscreenr(FullscreenrOptions);


$(document).ready(function() { 

    $(document).pngFix(); //Activate pngFix()
    
    ////////////////////////////////////////////////////////////////////////////////////
    // start site background slideshow 
    $('#annschools').cycle({ 
	timeout: 4250,  // milliseconds between slide transitions (0 to disable auto advance) 
    	speed:   1500,  // speed of the transition (any valid fx speed value) 
        before:   onBefore 
    }); 
 
    var totalSlideCount = 10; 
     
    function onBefore(curr, next, opts) { 
        // on the first pass, addSlide is undefined (plugin hasn't yet created the fn); 
        // when we're finshed adding slides we'll null it out again 
        if (!opts.addSlide) 
            return; 
 
        // on Before arguments: 
        //  curr == DOM element for the slide that is currently being displayed 
        //  next == DOM element for the slide that is about to be displayed 
        //  opts == slideshow options 
             
        var currentImageNum = parseInt(next.src.match(/school(\d+)/)[1]); 

        if (currentImageNum == totalSlideCount) { 
            // final slide in our slide slideshow is about to be displayed 
            // so there are no more to fetch 
            opts.addSlide = null; 
            return; 
        } 
         
        // add our next slide 
        opts.addSlide('<img src="_images/announce/school'+(currentImageNum+1)+'.png" width="200" height="225" />'); 
    }; 
}); 



