$(document).ready(function(){
	$(".sommaire-diaporama").each(function(){
		$(this).children("li.diaima").hide();
		$(this).children("li.diaima:first").addClass("diaporama-courante").show();
	});

$(".showhide-news .listagetexte").hide();
	$(".showhide-news .listagetitre, .showhide-news .listagelogo").each(function(){
		$(this).css("cursor","pointer");
		$(this).hover(
			function(){ $(this).css("color","#E2007A"); },
			function(){ $(this).css("color","#000000"); }
			);
		$(this).click(function(){
			if ($(this).siblings(".listagetexte").css("display")=="block") {
				if ($.browser.safari) {
				$(this).siblings(".listagetexte").hide();
				} else {
				$(this).siblings(".listagetexte").slideUp();
				}
			} else {
				if ($.browser.safari) {
				$(".showhide-news .listagetexte").hide();
   				$(this).siblings(".listagetexte").show();
				} else {
				$(".showhide-news .listagetexte").slideUp();
				$(this).siblings(".listagetexte").slideDown();
				}
			}
		});
	});

	var controle=$("#page-sommaire .sommaire-diaporama");
	if(controle.length){
	window.setInterval("changeslide()",8000);
	}
	
	$('.titreniveau1').siblings('.listeniveau2').hide();
	$('.titreniveau1').each(function(){
		$(this).css("cursor","pointer");
		$(this).hover(
			function(){$(this).css("color","#E2007A"); },
			function(){$(this).css("color","#000"); }
			);
		$(this).click(function(){
			$(this).siblings('.listeniveau2').show();
		});
	});
	
});

function changeslide(){
$(".sommaire-diaporama").each(function(){
		var actu=$(this).children("li.diaporama-courante").next("li");
		if(!actu.length){
		actu=$(this).children("li:first");
		}
		$(this).children("li.diaporama-courante").removeClass("diaporama-courante").hide();
		actu.addClass("diaporama-courante").show();
	});	
}