function afficheId(baliseId){ //AFFICHER ou CACHER UNE DIV avec + OU -
	if (document.getElementById && document.getElementById(baliseId) != null){
		if (document.getElementById(baliseId).style.display == 'block'){
			document.getElementById(baliseId).style.display='none';
			if(document.getElementById(baliseId+"_lien")){document.getElementById(baliseId+"_lien").style.background = "url(../images/cross.gif) no-repeat 0 3px";}
		}else{
			document.getElementById(baliseId).style.display='block';
			if(document.getElementById(baliseId+"_lien")){document.getElementById(baliseId+"_lien").style.background = "url(../images/cross_minus.gif) no-repeat 0 3px";}
		}
		setFooter();
	}
}

var current = ($('#home-right img.show')? $('#home-right img.show') : $('#home-right img:first'));
var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('#home-right img:first') :current.next()) : $('#home-right img:first'));
/*
function theshoEsq() {
    $('#home-right img').css({opacity: 0.0});
    $('#home-right img:first').css({opacity: 1.0});
    setInterval('rotate()',5000);
}

function rotate() {
    current = ($('#home-right img.show')? $('#home-right img.show') : $('#home-right img:first'));
    var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('#home-right img:first') :current.next()) : $('#home-right img:first'));
    next.css({opacity: 0.0}).addClass('show').animate({opacity: 1.0}, 2500);
    current.animate({opacity: 0.0}, 2500).removeClass('show');
    current.addClass('hide');
};
*/

var DCI_SlideShow_zIndex = $('#home-right img').length;
var slideshowIntervalId = false;

function DCI_SlideShow(first) {
	$('#home-right img').each(function(){
		$(this).css({'opacity': 0.0, 'z-index': $(this).index(), 'position': 'absolute'});
	});
	if (!first) {
		$('#home-right img:first').css({opacity: 1.0}).addClass('show');
	} else {
		$(first).css({opacity: 1.0}).addClass('show');
	}
	slideshowIntervalId = setInterval('DCI_SlideShow_Rotate()', 5000);
}

function DCI_SlideShow_Rotate() {
    current = ($('#home-right img.show')? $('#home-right img.show') : $('#home-right img:first'));
    next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('#home-right img:first') :current.next()) : $('#home-right img:first'));

    next.css({'z-index': DCI_SlideShow_zIndex, 'display': 'block'});
    current.css({'z-index': DCI_SlideShow_zIndex, 'display': 'block'});

    next.css({'opacity': 0.0}).addClass('show').animate({'opacity': 1.0}, 3000);
    current.animate({'opacity': 0.0}, 3000).removeClass('show');
    current.addClass('hide');

    next.css({'z-index': next.index()});
    current.css({'z-index': current.index()});
}

$(document).ready(function() {
	//theshoEsq();
	if (DCI_SlideShow_zIndex > 1) {
		DCI_SlideShow();
	} else {
		$('#home-right img').css({'opacity': 0.0}).addClass('show').animate({'opacity': 1.0}, 3000);
	}
});
