function slideSwitch() {
    var $active = $('#bannerWrapper IMG.active');

    if ( $active.length == 0 ) $active = $('#bannerWrapper IMG:last');

    var $next =  $active.next().length ? $active.next()
        : $('#bannerWrapper IMG:first');

    $active.addClass('last-active');
	
    $next.css({opacity: 0.0})
		.removeClass('hidden_banner')
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
$(document).ready(function() {
	var _images = [
		"/images/homepage_banner_humane.jpg", 
		"/images/homepage_banner-computer.jpg",
		"/images/homepage_banner-spice.jpg"
	];
	var gotime = _images.length;

	$.each(_images,function(e) {
		$(new Image()).load(function() {
			if (--gotime < 1) begin();
		}).attr('src',this);
	});
	function begin() {
		$.each(_images,function(e) {
			$("#bannerWrapper IMG:last").after("<img src=\"" + this + "\" alt=\"Making a Difference!\" class=\"hidden_banner\" width=\"950\" height=\"498\" />");
		});
		setInterval( "slideSwitch()", 3000 );
		
	}
});

