 //<![CDATA[
$(document).ready(function(){


/* Home page attach slide show */
$("#home #content").prepend("<div id=\"loader\" class=\"loading\">");
$(".welcome_image").css({opacity: 0});
 $(".welcome_image").load("/slideshows/home.html", function(){
 
 $("#home #content").children('#loader').animate({opacity: 0.0}, 2000, function() {
 $(this).remove();
 			$(".welcome_image").animate({opacity: 1.0}, 2000);
        });
 });
 
 
/* About page attach slide show */
 $("#about #content").prepend("<div id=\"loader\" class=\"loading\">");
$(".about_image").css({opacity: 0});
 $(".about_image").load("/slideshows/about.html", function(){
 
 $("#about #content").children('#loader').animate({opacity: 0.0}, 2000, function() {
 $(this).remove();
 			$(".about_image").animate({opacity: 1.0}, 2000);
        });
 });
 
 
});

/* Home page Slide show */
function home_slideSwitch() {
    var $active = $('.welcome_image img.active');

    if ( $active.length == 0 ) $active = $('.welcome_image img:last');

    var $next =  $active.next().length ? $active.next()
        : $('.welcome_image img:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 3000, function() {
            $active.removeClass('active last-active');
        });
};

$(function() {
    setInterval( "home_slideSwitch()", 6000 );
});


/* About page Slide show */
function about_slideSwitch() {
    var $active = $('.about_image img.active');

    if ( $active.length == 0 ) $active = $('.about_image img:last');

    var $next =  $active.next().length ? $active.next()
        : $('.about_image img:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 3000, function() {
            $active.removeClass('active last-active');
        });
};

$(function() {
    setInterval( "about_slideSwitch()", 6000 );
});

//]]>
