//Controls the Leftside Home box called "Residental"
function slideSwitch() {
    var $active = $('#slideshow DIV.active');
    if ( $active.length == 0 ) $active = $('#slideshow DIV:last');
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow DIV:first');

    $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 );
});




//Controls the Rightside Home box called "Commercial"
function slideSwitch1() {
    var $active = $('#slideshow1 DIV.active1');
    if ( $active.length == 0 ) $active = $('#slideshow1 DIV:last');
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow1 DIV:first');

    $active.addClass('last-active1');
    $next.css({opacity: 0.0})
        .addClass('active1')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active1 last-active1');
        });
}
$(function() {
    setInterval( "slideSwitch1()", 8000 );
});




//Controls the Rightside Home box called "Commercial"
function slideSwitch2() {
    var $active = $('#comslideshow DIV.active');
    if ( $active.length == 0 ) $active = $('#comslideshow DIV:last');
    var $next =  $active.next().length ? $active.next()
        : $('#comslideshow DIV:first');

    $active.addClass('last-active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
$(function() {
    setInterval( "slideSwitch2()", 5000 );
});
