

$(document).ready(function () {
							

	$('#slideshow .slideset').each(function(){

	    var slides = $(this).find('.slide');
		var width  = $(this).width(), height = $(this).height();

		slides.css({
		    'width'  : width,
		    'height' : height
	    }).first().addClass('active');

	    slides.each(function() {

                    $(this).closest('.slide').not('.active').css('opacity', 0); 
        });

		setInterval(function () {

            var slides = $('#slideshow').find('.slide');

            var active = slides.filter('.active');

            if (active.length == 0) active = slides.filter(':first');

            var next = active.next().length ? active.next() : slides.filter(':first');

           next.css('opacity', 1);	   
		   active.animate({opacity: 0.0}, 1000, function() {
                
				active.removeClass('active');
				next.addClass('active');
				
			});
		   /* active.removeClass('active').animate({opacity: 0.0}, 500, function() {
                next.show().addClass('active').animate({opacity: 1.0}, 500);
            });*/

        }, 7000);

	});

	
	
});
