function alterner(obj1, obj2)
	{
	var obj1 = document.getElementById(obj1);
	var obj2 = document.getElementById(obj2);
	obj1.style.display = (obj1.style.display == 'block') ? 'none' : 'block';
	obj2.style.display = (obj2.style.display == 'block') ? 'none' : 'block';
	}
function changecolor(couleur)
	{
	var couleur = document.getElementById("couleur");
	couleur.style.color = (couleur.style.color == '#49094b') ? '#ffffff' : '#49094b';
	}
function changecolor2(couleur)
	{
	var couleur = document.getElementById("couleur2");
	couleur.style.color = (couleur.style.color == '#49094b') ? '#ffffff' : '#49094b';
	}
function colorelien()
	{
		var AllLinks=document.getElementsByTagName('a');
	
		for(i=0;i<AllLinks.length;i++)
		
		{
			if (AllLinks[i].href == document.location.href)
			{
				AllLinks[i].style.color='#49094b';
			}
		} 
	}
// Execution des scripts au chargement de la page
window.onload = function() {
colorelien();
}

$(document).ready(function() {      
    slideShow();
 
});
 
function slideShow() {
    $('#diaporama a').css({opacity: 0.0});
    $('#diaporama a:first').css({opacity: 1.0});
    $('#diaporama .titre').css({opacity: 0.7});
    $('#diaporama .titre').css({width: $('#diaporama a').find('img').css('width')});
    $('#diaporama .contenu').html($('#diaporama a:first').find('img').attr('title'))
    .animate({opacity: 0.7}, 400);
    setInterval('diaporama()',5000);  
}
 
function diaporama() {
    
    //if no IMGs have the show class, grab the first image
    var current = ($('#diaporama a.show')?  $('#diaporama a.show') : $('#diaporama a:first'));
    
    //Get next image, if it reached the end of the slideshow, rotate it back to the first image
    var next = ((current.next().length) ? ((current.next().hasClass('titre'))? $('#diaporama a:first') :current.next()) : $('#diaporama a:first'));   
 
	//Set the fade in effect for the next image, show class has higher z-index
    next.css({opacity: 0.0})
    .addClass('show')
    .animate({opacity: 1.0}, 1000);
 
    //Hide the current image
    current.animate({opacity: 0.0}, 1000)
    .removeClass('show');

    //Set the opacity to 0 and height to 1px
    $('#diaporama .titre').animate({opacity: 0.0}, { queue:false, duration:50 }).animate({height: '1px'}, { queue:true, duration:300 });    
    
    //Animate the titre, opacity to 0.7 and heigth to 100px, a slide up effect
    $('#diaporama .titre').animate({opacity: 0.7},100 ).animate({height: '22px'},500 );
    
    //Get next image titre
    var titre = next.find('img').attr('title'); 
    //Display the content
    $('#diaporama .contenu').html(titre);
    
    
}
   






 





