//SLIDER HEADER
function slideSwitch() {
    var $active = $('#slider_header DIV.active');

    if ( $active.length == 0 ) $active = $('#slider_header DIV:last');

    // use this to pull the divs in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
	: $('#slider_header DIV:first');

    // uncomment below to pull the divs randomly
    // 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}, 1000, function() {
	    $active.removeClass('active last-active');
	});
}

$(function() {
    setInterval( "slideSwitch()", 5000 );
});


//SLIDER BODY_CONTENT
function f_slider_body_content() {
    var $active = $('#slider_body_content DIV.active');

    if ( $active.length == 0 ) $active = $('#slider_body_content DIV:last');

    // use this to pull the divs in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
	: $('#slider_body_content DIV:first');

    // uncomment below to pull the divs randomly
    // 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}, 1000, function() {
	    $active.removeClass('active last-active');
	});
}

$(function() {
    setInterval( "f_slider_body_content()", 5500 );
});


//SLIDER BODY_BANNER_HOME 
function f_slider_banner_home() {
    var $active = $('#slider_banner_home DIV.active');

    if ( $active.length == 0 ) $active = $('#slider_banner_home DIV:last');

    // use this to pull the divs in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
	: $('#slider_banner_home DIV:first');

    // uncomment below to pull the divs randomly
    // 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}, 1000, function() {
	    $active.removeClass('active last-active');
	});
}

$(function() {
    setInterval( "f_slider_banner_home()", 3200 );
});



