/* Author: 

*/



/* jwplayer setup */

/* jwplayer("jwplayer").setup({
	file: "/assets/video.mp4",
	provider: "rtmp",
	streamer:"rtmp://example.com/app/"
});
*/



/*** 
    Simple jQuery Slideshow Script
    Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc.  Please link out to me if you like it :)
***/

function slideSwitch(switchSpeed) {
    var $active = $('#slideshow IMG.active');
    
    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

    var $next =  $active.next('IMG').length ? $active.next('IMG')
       : $('#slideshow IMG:first');

    /*
    var $sibs  = $active.siblings();
    var rndNum = Math.floor(Math.random() * $sibs.length );
    var $next  = $( $sibs[ rndNum ] );
    */
    
    $active.addClass('last-active');
    
    
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, switchSpeed, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval ( "slideSwitch(1000)", 10000 );    
});



/*** 
    Simple jQuery Slideshow Script - THIS ONE'S FOR PHOTO GALLERY
    Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc.  Please link out to me if you like it :)
***/

function slideSwitchGallery(switchSpeed) {
    var $active = $('#photogallery IMG.active');
    
    if ( $active.length == 0 ) $active = $('#photogallery IMG:last');

    var $next =  $active.next('IMG').length ? $active.next('IMG')
       : $('#photogallery IMG:first');

    /*
    var $sibs  = $active.siblings();
    var rndNum = Math.floor(Math.random() * $sibs.length );
    var $next  = $( $sibs[ rndNum ] );
    */
    
    $active.addClass('last-active');
    
    
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, switchSpeed, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval ( "slideSwitchGallery(1000)", 5000 );    
});
