function slideSwitch() {
    var jQueryactive = jQuery('#feature_image_container > div.active');

    // if there is no active image, the last image is set to the active image 
    if ( jQueryactive.length == 0 ) jQueryactive = jQuery('#feature_image_container > div:last');

    // if there is a next image, use the next image, otherwise use the first image
    // use this to pull the images in the order they appear in the markup
    var jQuerynext =  jQueryactive.next().length ? jQueryactive.next()
        : jQuery('#feature_image_container > div:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var jQuerysibs  = jQueryactive.siblings();
    // var rndNum = Math.floor(Math.random() * jQuerysibs.length );
    // var jQuerynext  = jQuery( jQuerysibs[ rndNum ] );

	// (1) make the current active image the last-active image and (2) animate its opacity to 0
    jQueryactive.addClass('last-active').animate({opacity: 0.0}, 100);

    // (1) make the next image's opacity 0, (2) make it the active image, (3) animate its opacity to 1, and (4) take the old active image and remove the active and last-active classes from it.
    jQuerynext.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            jQueryactive.removeClass('active last-active');
        });
}

jQuery(function() {
    setInterval( "slideSwitch()", 10000 );
});


