
/*** 
    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() {
    var zoomaactive = zooma('#slideshow DIV.active');

    if ( zoomaactive.length == 0 ) zoomaactive = zooma('#slideshow DIV:last');

    // use this to pull the divs in the order they appear in the markup
    var zoomanext =  zoomaactive.next().length ? zoomaactive.next()
        : zooma('#slideshow DIV:first');

    // uncomment below to pull the divs randomly
    // var zoomasibs  = zoomaactive.siblings();
    // var rndNum = Math.floor(Math.random() * zoomasibs.length );
    // var zoomanext  = zooma( zoomasibs[ rndNum ] );


    zoomaactive.addClass('last-active');

    zoomanext.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            zoomaactive.removeClass('active last-active');
        });
}

zooma(function() {
    setInterval( "slideSwitch()", 5000 );
});

function slideSwitch1() {
    var zoomaactive = zooma('#slideshow1 DIV.active');

    if ( zoomaactive.length == 0 ) zoomaactive = zooma('#slideshow1 DIV:last');
    var zoomanext =  zoomaactive.next().length ? zoomaactive.next()
        : zooma('#slideshow1 DIV:first');
    zoomaactive.addClass('last-active');

    zoomanext.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            zoomaactive.removeClass('active last-active');
        });
}
zooma(function() {
    setInterval( "slideSwitch1()", 5000 );
});

