﻿
function slideSwitch1() {
    var $active = $('#SlideShow1 IMG.active');

    if ($active.length == 0) $active = $('#SlideShow1 IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next = $active.next().length ? $active.next()
        : $('#SlideShow1 IMG:first');

    // uncomment the 3 lines below to pull the images in random order

    // 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 }, 3000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval("slideSwitch1()", 60000);
});

/* ---------- */

function slideSwitch2() {
    var $active = $('#SlideShow2 IMG.active');

    if ($active.length == 0) $active = $('#SlideShow2 IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next = $active.next().length ? $active.next()
        : $('#SlideShow2 IMG:first');

    // uncomment the 3 lines below to pull the images in random order

    // 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 }, 3000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval("slideSwitch2()", 10000);
});

/* ---------- */

function slideSwitch3() {
    var $active = $('#SlideShow3 IMG.active');

    if ($active.length == 0) $active = $('#SlideShow3 IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next = $active.next().length ? $active.next()
        : $('#SlideShow3 IMG:first');

    // uncomment the 3 lines below to pull the images in random order

    // 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 }, 3000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval("slideSwitch3()", 40000);
});

/* ---------- */

function slideSwitch4() {
    var $active = $('#SlideShow4 IMG.active');

    if ($active.length == 0) $active = $('#SlideShow4 IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next = $active.next().length ? $active.next()
        : $('#SlideShow4 IMG:first');

    // uncomment the 3 lines below to pull the images in random order

    // 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 }, 3000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval("slideSwitch4()", 20000);
});

/* ---------- */

function slideSwitch5() {
    var $active = $('#SlideShow5 IMG.active');

    if ($active.length == 0) $active = $('#SlideShow5 IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next = $active.next().length ? $active.next()
        : $('#SlideShow5 IMG:first');

    // uncomment the 3 lines below to pull the images in random order

    // 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 }, 3000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval("slideSwitch5()", 30000);
});

/* ---------- */

function slideSwitch6() {
    var $active = $('#SlideShow6 IMG.active');

    if ($active.length == 0) $active = $('#SlideShow6 IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next = $active.next().length ? $active.next()
        : $('#SlideShow6 IMG:first');

    // uncomment the 3 lines below to pull the images in random order

    // 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 }, 3000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval("slideSwitch6()", 50000);
});
