function slideSwitch(id) {
    var $active = $('#slideshow_' + id + ' img.active');

    if ( $active.length == 0 ) $active = $('#slideshow_' + id + ' img:last');

    var $next =  $active.next().length ? $active.next()
        : $('#slideshow_' + id + ' img:first');

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

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

$(document).ready(function() {
	$('#slideshow_1').click(function() { document.location.href = 'realisations-armoire-design-plus.php'; });
	$('#slideshow_2').click(function() { document.location.href = 'realisations-armoire-design-plus.php?category=3'; });
	$('#slideshow_3').click(function() { document.location.href = 'realisations-armoire-design-plus.php?category=2'; });
		
	setInterval("slideSwitch(1)", 4000);
	setInterval("slideSwitch(2)", 4000);
	setInterval("slideSwitch(3)", 4000);
});
