var clicdiapo=true;
var cptphotos=1; //compteur de photos 
var cptvideos=1; //compteur de videos 
var nbrphotos=1; //init nombre photos
var nbrvideos=1; //init nombre videos
var navphotos=true; //navigation active
var navvideos=true; //navigation active

var idn="";
var encoursplay=false;

function stopperPod()
{
//alert("stop");	
encoursplay=false;
}

function jouerPod()
{
//alert("play");	
encoursplay=true;
}


function deconnexionAnnuaire()
{
 $.ajax({
   type: "GET",
   url: "squelettes/deconnexion_annuaire.php",
  
   success: function(msg){
  location.reload();
		//zoomPhotosAcc();
   }
 });		
}


function fermerPopup()
{
$.fn.fancybox.close();
}

//Fonction des popups
function fenetrePopup(url)
{

 window.open(url,"WebRadio_Africa_N1","menubar=no, status=no, scrollbars=no, menubar=no, width=710, height=390");
//testwindow.moveTo(0,0);
}

//Fonction Zoom photos

function zoomPhotos()
{

$('#console-photos a.fancyzoom').fancyzoom(); //initialisation du zoom

}

//Fonction Zoom photos

function zoomPhotosAcc()
{

//$('#rub-daily #lecteur a.fancyzoom:first').fancyzoom(); //initialisation du zoom

}
//Fonction Diapo
function diapoSuivant()
{
	
	if($("#zone_texte a.selected").next("a:first").length>0)
	$("#zone_texte a.selected").next("a:first").click();
	else
	$("#zone_texte a:first").click();
	
	
	}
//Fonction click des sorties accueil
	function changerSortie(id)
	{
	$("#rub-sortie div.hbox a[id!="+id+"]").removeClass('selected');
	$("#"+id+"").addClass('selected');
	
	$("#rub-sortie div.sortiesaj[name!="+id+"]").fadeOut("fast",function(){
																		 
$("#rub-sortie div.sortiesaj[name="+id+"]").fadeIn("slow");
																		});
	
		
		}
		
//Fonction click des radio
	function changerRadio1(url,id)
	{
		//alert("test");
		$("#conteneur_webradio div.hbox a[id!="+id+"]").removeClass("selected");
		$("#conteneur_webradio div.hbox #"+id+"").addClass("selected");
		
			
	 $.ajax({
   type: "GET",
   url: "spip.php?page="+url+"",
  
   success: function(msg){
    $("#encart_radio").html(msg);
		//zoomPhotosAcc();
   }
 });	
	 }
		

//Fonction click des photos accueil
	function changerPhoto(img,imgg,id)
	{
		
		$("#conteneur_daily a.selected img").animate({opacity: 1},200,function(){
		$("#conteneur_daily a.selected img").css("border-color","#ffffff");	
		$("#conteneur_daily a[id!="+id+"]").removeClass("selected");
	
	$("#conteneur_daily #"+id+"").addClass("selected");
		$("#conteneur_daily #"+id+" img:first").css("border-color","#FF7F7F");		
	});
	
	 $.ajax({
   type: "GET",
   url: "squelettes/photos_accueil.php",
   data: "img="+img+"&imgg="+imgg,
   success: function(msg){
    $("#lecteur").html(msg);
		//zoomPhotosAcc();
   }
 });
		
		}

//Fonction click des dailymotion
function changerVideo(video,id)
{
		$("#conteneur_daily a.selected img").animate({opacity: 1},200,function(){
		$("#conteneur_daily a.selected img").css("border-color","#ffffff");	
		$("#conteneur_daily a[id!="+id+"]").removeClass("selected");
	
	$("#conteneur_daily #"+id+"").addClass("selected");
		$("#conteneur_daily #"+id+" img:first").css("border-color","#FF7F7F");		
	});
	
	 $.ajax({
   type: "GET",
   url: "squelettes/videos_accueil.php",
    data: "video="+video,
   success: function(msg){
    $("#lecteur").html(msg);
		//zoomPhotosAcc();
   }
 });
		
		
	
	
	}
$(document).ready(function(){
	
//ajax recherche
$("#recherchebt").live("click",function(){ 
									 
 
									 
	 $.ajax({
   type: "GET",
   url: "squelettes/derniers_inscrit.php",
   data: "r=1&nom_i="+$("#nom_i").val()+"&prenom_i="+$("#prenom_i").val()+"&pays_i="+$("#pays_i").val()+"",
  
   success: function(msg){
	  
    $("div.boxafricain_recherche").html(msg);
		//zoomPhotosAcc();
   }
 });						 
									 
									 
									 });	
	
						   
//ajax de livres dor
$("#bt_livre").live("click",function(){ 
									 
 
									 
	 $.ajax({
   type: "POST",
   url: "squelettes/ajoutlivre.php",
   data: "message="+$("#msg_livre").val()+"&idi="+$("#idi").val()+"",
  
   success: function(msg){
	  
    $("#erreur_livre").fadeIn("fast");
	$("#msg_livre").val("");
	$("#msg_livre").html("");
	
	
		//zoomPhotosAcc();
   }
 });						 
									 
									 
									 });
						   
if($("area.fancyboxvideo").length>0)
$("area.fancyboxvideo,a.fancyboxvideo").fancybox({ 'hideOnContentClick': true,
		   					'frameWidth': 640,
		   					'frameHeight': 710
							 });
$("area.fancyboxconnexion").fancybox({ 'hideOnContentClick': true,
		   					'frameWidth': 640,
		   					'frameHeight': 220,
							'callbackOnClose': function(){location.reload();}
							 });

$("area.fancyboxpasse").fancybox({ 'hideOnContentClick': true,
		   					'frameWidth': 640,
		   					'frameHeight': 220
							 });	
						   
	zoomPhotosAcc();
// page video debut de page
var lavideo="";
lavideo=$("#video_principale").attr("rel");

if(lavideo!=="")
$(window).load(function(){
						
						
$("#"+lavideo+"").click();
// allongement des fiche artistes

if($("#encart_detail.long").height()>$("#encart_photos.long").height())
$("#encart_photos.long").height($("#encart_detail.long").height());

						   

});



//select des animateurs

//clic contecatez animateurs

$("a.canimateur").click(function(){
								  
								 
								 $(this).next("div.formulaire_animateur:first").slideDown("fast");
								$("div.formulaire_animateur").not($(this).next("div.formulaire_animateur:first")).slideUp("fast");
								$("div.formulaire_animateur option:contains('"+$(this).prevAll("span:first").text()+"')").attr("selected", true);
								
								 
								 });
	
	
/************************** click des vpp****************************************/	

$("#rub-daily #bande a.videos").click(function(){
											   $(this).addClass('selected');
											   $("#rub-daily #bande a.selected").not($(this)).removeClass('selected');
											    $.ajax({
   type: "GET",
   url: "spip.php?page=encart_videos",
   data: "video=1",
   success: function(msg){
    $("#cadre_c").html(msg);
   }
 });
											   
											   });


$("#rub-daily #bande a.photos").click(function(){
																		 
		$(this).addClass('selected');
	    $("#rub-daily #bande a.selected").not($(this)).removeClass('selected');
		$.ajax({
   type: "GET",
   url: "spip.php?page=encart_photos",
   data: "video=1",
   success: function(msg){
    $("#cadre_c").html(msg);
   }
 });
											   });
$("#rub-daily #bande a.podcasts").click(function(){
												 
												 
$(this).addClass('selected');
	    $("#rub-daily #bande a.selected").not($(this)).removeClass('selected');
		$.ajax({
   type: "GET",
   cache: false,
   url: "spip.php?page=encart_podcasts",
   data: "video=1",
   success: function(msg){
    $("#cadre_c").html(msg);
   }
 });
												 
												 });
						   
						   
/************************ switcher podcast video **************************************/	
$("div.back_video").click(function(){
								   
								 
								   
									 $("div.back_video").removeClass('back_video_selected');
									$(this).addClass('back_video_selected');
									 //chargement videos
									 $.ajax({
									   type: "POST",
									   url: "loader_podcast_video.php",
									   data: "video="+$(this).children("a:first").attr('rel'),
									   success: function(msg){
										$("#console_pvideo").html(msg);
										 $('html,body').animate({scrollTop: 0}, 500);
										
									   }  });
									 
									 })
						   
/************************ effet scroller **************************************/

// switch podcast
$("#podcast_switch a.precedent").live("click",function(){
											  
											var position = $("#podcast_switch ul").position();
											var rposition=position.top;
											//alert("tests "+$("#podcast_switch ul").height()); 
											//alert("top "+position.top);
											//alert(rposition);
											if(rposition<0)
											$("#podcast_switch ul").not(":animated").animate({ top: ""+(position.top+212)+"px"}, 500 ); 
											  });
$("#podcast_switch a.suivant").live("click",function(){
											var position = $("#podcast_switch ul").position();
											var rposition=$("#podcast_switch ul").height()+position.top;
											//alert("tests "+$("#podcast_switch ul").height()); 
											//alert("top "+position.top);
											//alert(rposition);
											if(rposition>232)
											$("#podcast_switch ul").not(":animated").animate({ top: ""+(position.top-212)+"px"}, 500 ); 
											});

// rub onair
if($("#rub-onair ul li.encours").length > 0)
{
var position = $("#rub-onair ul li.encours").position();
var rposition=position.top;
}

$("#rub-onair ul").not(":animated").animate({ top: "-"+rposition+"px"}, 500 );

$("#rub-onair a.precedent").click(function(){
											  
											var position = $("#rub-onair ul").position();
											var rposition=position.top;
											//alert("tests "+$("#rub-onair ul").height()); 
											//alert("top "+position.top);
											//alert(rposition);
											if(rposition<0)
											{
												if((position.top+190)>0)
											$("#rub-onair ul").not(":animated").animate({ top: "0px"}, 500 );
											else
											$("#rub-onair ul").not(":animated").animate({ top: ""+(position.top+190)+"px"}, 500 );
											}
											  });
$("#rub-onair a.suivant").click(function(){
											var position = $("#rub-onair ul").position();
											var rposition=$("#rub-onair ul").height()+position.top;
											//alert("tests "+$("#rub-onair ul").height()); 
											//alert("top "+position.top);
											//alert(rposition);
											if(rposition>210)
											$("#rub-onair ul").not(":animated").animate({ top: ""+(position.top-190)+"px"}, 500 ); 
											});
// rub actuprod
$("#conteneur_actupod a.precedent").click(function(){
											  
											var position = $("#conteneur_actupod ul").position();
											var rposition=position.top;
											//alert("tests "+$("#conteneur_actupod ul").height()); 
											//alert("top "+position.top);
											//alert(rposition);
											if(rposition<0)
											$("#conteneur_actupod ul").not(":animated").animate({ top: ""+(position.top+275)+"px"}, 500 ); 
											  });
$("#conteneur_actupod a.suivant").click(function(){
											var position = $("#conteneur_actupod ul").position();
											var rposition=$("#conteneur_actupod ul").height()+position.top;
											//alert("tests "+$("#conteneur_actupod ul").height()); 
											//alert("top "+position.top);
											//alert(rposition);
											if(rposition>295)
											$("#conteneur_actupod ul").not(":animated").animate({ top: ""+(position.top-275)+"px"}, 500 ); 
											});



// rub playlist
$("#rub-playlist[name!=plv] a.precedent").click(function(){
											  
											var position = $("#rub-playlist ul").position();
											var rposition=position.top;
											//alert("tests "+$("#rub-playlist ul").height()); 
											//alert("top "+position.top);
											//alert(rposition);
											if(rposition<0)
											$("#rub-playlist ul").not(":animated").animate({ top: ""+(position.top+245)+"px"}, 500 ); 
											  });
$("#rub-playlist[name!=plv] a.suivant").click(function(){
											var position = $("#rub-playlist ul").position();
											var rposition=$("#rub-playlist ul").height()+position.top;
											//alert("tests "+$("#rub-playlist ul").height()); 
											//alert("top "+position.top);
											//alert(rposition);
											if(rposition>265)
											$("#rub-playlist ul").not(":animated").animate({ top: ""+(position.top-245)+"px"}, 500 ); 
											});
// rub playlist violet
$("#rub-playlist.violet a.precedent").click(function(){
											  
											var position = $("#rub-playlist.violet ul").position();
											var rposition=position.top;
											//alert("tests "+$("#rub-playlist ul").height()); 
											//alert("top "+position.top);
											//alert(rposition);
										
											if(rposition<0)
											$("#rub-playlist.violet ul").not(":animated").animate({ top: ""+(position.top+295)+"px"}, 500 ); 
											  });
$("#rub-playlist.violet a.suivant").click(function(){
											var position = $("#rub-playlist.violet ul").position();
											var rposition=$("#rub-playlist.violet ul").height()+position.top;
											//alert("tests "+$("#rub-playlist ul").height()); 
											//alert("top "+position.top);
											//alert(rposition);
											
											if(rposition>315)
											$("#rub-playlist.violet ul").not(":animated").animate({ top: ""+(position.top-295)+"px"}, 500 ); 
											});

// Agenda culturel
$("#agenda_culturel a.precedent").click(function(){
											  //alert ('test p');
											var position = $("#agenda_culturel #agendadef").position();
											var rposition=position.top;
											//alert("tests "+$("#agenda_culturel ul").height()); 
											//alert("top "+position.top);
											//alert(rposition);
											if(rposition<0)
											$("#agenda_culturel #agendadef").not(":animated").animate({ top: ""+(position.top+329)+"px"}, 500 ); 
											  });
$("#agenda_culturel a.suivant").click(function(){
											    //alert ('test s');
											var position = $("#agenda_culturel #agendadef").position();
											var rposition=$("#agenda_culturel #agendadef").height()+position.top;
											//alert("tests "+$("#agenda_culturel ul").height()); 
											//alert("top "+position.top);
											//alert(rposition);
											if(rposition>344)
											$("#agenda_culturel #agendadef").not(":animated").animate({ top: ""+(position.top-329)+"px"}, 500 ); 
											});
// rub daily (photos)
$("#pagination_daily a.hautviolet").live("click",function(){
											  
											var position = $("#conteneur_daily").position();
											var rposition=position.top;
																						//alert("tests "+$("#podcast_switch ul").height()); 
											//alert("top "+position.top);
											//alert(rposition);
											 
											
											if(rposition<0)
											$("#conteneur_daily").not(":animated").animate({ top: ""+(position.top+237)+"px"}, 500 ); 
											  });
$("#pagination_daily a.basviolet").live("click",function(){
										
											var position = $("#conteneur_daily").position();
											var rposition=$("#conteneur_daily").height()+position.top;
											//alert("tests "+$("#podcast_switch ul").height()); 
											//alert("top "+position.top);
											//alert(rposition);
											
											if(rposition>257)
											$("#conteneur_daily").not(":animated").animate({ top: ""+(position.top-237)+"px"}, 500 ); 
											});
// rub podcasts
$("#podcast_switch a.precedent").click(function(){
											  
											var position = $("#podcast_switch ul").position();
											var rposition=position.top;
											//alert("tests "+$("#podcast_switch ul").height()); 
											//alert("top "+position.top);
											//alert(rposition);
											if(rposition<0)
											$("#podcast_switch ul").not(":animated").animate({ top: ""+(position.top+245)+"px"}, 500 ); 
											  });
$("#podcast_switch a.suivant").click(function(){
											var position = $("#podcast_switch ul").position();
											var rposition=$("#podcast_switch ul").height()+position.top;
											//alert("tests "+$("#podcast_switch ul").height()); 
											//alert("top "+position.top);
											//alert(rposition);
											if(rposition>265)
											$("#podcast_switch ul").not(":animated").animate({ top: ""+(position.top-245)+"px"}, 500 ); 
											});
						   
/******************* evenement console photos ******************************/

$("#icozoom").click(function(){ $("#cimage img:first").click();})
zoomPhotos();
//initialisation des barres
nbrphotos=$("#console-photos a.cp").length;

$("#lphotos").animate({ width: ""+(cptphotos*100/nbrphotos)+"%"}, 500 );
$("#sphotos").animate({ left: ""+(cptphotos*100/nbrphotos)+"%",marginLeft:"-12px"}, 500 );
$("#console-photos p:first").fadeIn("fast");

$("#console-photos a.next" ).click(function(){/* $("#console-photos a.selected").next("a.cp").click();*/
											//$("#console-photos a.selected:first").next("a.cp:first").click();
											var ancimg=$("#console-photos a.selected:first");
											
											if(ancimg.next("a.cp:first").attr("rel") && navphotos)
                                      { navphotos=false;
										  cptphotos++;
										  $("#sphotos").html(""+cptphotos);
											ancimg.removeClass("selected");
									ancimg.next("a.cp:first").addClass("selected");
									//alert("passe"+ancimg.next("a.cp:first").attr("rel"));
									$("#lphotos").animate({ width: ""+(cptphotos*100/nbrphotos)+"%"}, 500 );
									$("#sphotos").animate({ left: ""+(cptphotos*100/nbrphotos)+"%"}, 500 );
									//$("#cimage").attr('src', ''+ancimg.next("a.cp:first").attr("rel")+'');
									$("#console-photos #p"+(cptphotos-1)+"").fadeOut("fast",function(){$("#console-photos #p"+cptphotos+"").fadeIn("fast"); });
									
									$("#cimage img:first").fadeOut("fast",function(){
									//chargement photos
									 $.ajax({
									   type: "POST",
									   url: "loader_images.php",
									   data: "img="+ancimg.next("a.cp:first").attr("rel")+"&imgg="+ancimg.next("a.cp:first").attr("rev"),
									   success: function(msg){
										$("#cimage").html(msg);
										
										zoomPhotos();
										
									//$("#icozoom").attr({href:''+ancimg.next("a.cp:first").attr("rev")+''});
									navphotos=true;	
									   }
									 });
																				   
																				   });
									
									}	});

$("#console-photos a.prev" ).click(function(){/* $("#console-photos a.selected").next("a.cp").click();*/
											//$("#console-photos a.selected:first").next("a.cp:first").click();
											var ancimg=$("#console-photos a.selected:first");
											
												if(ancimg.prev("a.cp:first").attr("rel")&& navphotos)
                                      {navphotos=false;     
									  cptphotos--;
									   $("#sphotos").html(""+cptphotos);
											ancimg.removeClass("selected");
									ancimg.prev("a.cp:first").addClass("selected");
									$("#lphotos").animate({ width: ""+(cptphotos*100/nbrphotos)+"%"}, 500 );
									$("#sphotos").animate({ left: ""+(cptphotos*100/nbrphotos)+"%"}, 500 );
									//$("#cimage").attr('src', ''+ancimg.prev("a.cp:first").attr("rel")+'');
									$("#console-photos #p"+(cptphotos+1)+"").fadeOut("fast",function(){$("#console-photos #p"+cptphotos+"").fadeIn("fast"); });
									
									$("#cimage img:first").fadeOut("fast",function(){
									//chargement photos
									 $.ajax({
									   type: "POST",
									   url: "loader_images.php",
									   data: "img="+ancimg.prev("a.cp:first").attr("rel")+"&imgg="+ancimg.prev("a.cp:first").attr("rev"),
									   success: function(msg){
										$("#cimage").html(msg);
										zoomPhotos();
										//$("#icozoom").attr({href:''+ancimg.prev("a.cp:first").attr("rev")+''});
										navphotos=true;
									   }
									 });
																				   
																				   });
									 }	});
						   						   
/******************* evenement console videos ******************************/	

//initialisation des barres
nbrvideos=$("#console-videos a.cv").length;;

$("#lvideos").animate({ width: ""+(cptvideos*100/nbrvideos)+"%"}, 500 );
$("#svideos").animate({ left: ""+(cptvideos*100/nbrvideos)+"%",marginLeft:"-12px"}, 500 );
$("#console-videos p:first").fadeIn("fast");

$("#console-videos a.next" ).click(function(){/* $("#console-videos a.selected").next("a.cv").click();*/
											//$("#console-videos a.selected:first").next("a.cv:first").click();
											var ancimg=$("#console-videos a.selected:first");
											
											if(ancimg.next("a.cv:first").attr("rel") && navvideos)
                                      { navvideos=false;
										  cptvideos++;
										  $("#svideos").html(""+cptvideos);
											ancimg.removeClass("selected");
									ancimg.next("a.cv:first").addClass("selected");
									//alert("passe"+ancimg.next("a.cv:first").attr("rel"));
									$("#lvideos").animate({ width: ""+(cptvideos*100/nbrvideos)+"%"}, 500 );
									$("#svideos").animate({ left: ""+(cptvideos*100/nbrvideos)+"%"}, 500 );
									//$("#cimage").attr('src', ''+ancimg.next("a.cv:first").attr("rel")+'');
									$("#console-videos #v"+(cptvideos-1)+"").fadeOut("fast",function(){$("#console-videos #v"+cptvideos+"").fadeIn("fast"); });
									
									
									//chargement videos
									 $.ajax({
									   type: "POST",
									   url: "loader_videos.php",
									   data: "video="+ancimg.next("a.cv:first").attr("rel"),
									   success: function(msg){
										$("#cvideo").html(msg);
										navvideos=true;
									   }
									
																				   
																				   });
									
									}	});

$("#console-videos a.prev" ).click(function(){/* $("#console-videos a.selected").next("a.cv").click();*/
											//$("#console-videos a.selected:first").next("a.cv:first").click();
											var ancimg=$("#console-videos a.selected:first");
											
												if(ancimg.prev("a.cv:first").attr("rel")&& navvideos)
                                      {navvideos=false;     
									  cptvideos--;
									   $("#svideos").html(""+cptvideos);
											ancimg.removeClass("selected");
									ancimg.prev("a.cv:first").addClass("selected");
									$("#lvideos").animate({ width: ""+(cptvideos*100/nbrvideos)+"%"}, 500 );
									$("#svideos").animate({ left: ""+(cptvideos*100/nbrvideos)+"%"}, 500 );
									//$("#cimage").attr('src', ''+ancimg.prev("a.cv:first").attr("rel")+'');
									$("#console-videos #v"+(cptvideos+1)+"").fadeOut("fast",function(){$("#console-videos #v"+cptvideos+"").fadeIn("fast"); });
									
									
									//chargement videos
									 $.ajax({
									   type: "POST",
									   url: "loader_videos.php",
									   data: "video="+ancimg.prev("a.cv:first").attr("rel"),
									   success: function(msg){
										$("#cvideo").html(msg);
										navvideos=true;
									   }
									
																				   
																				   });
									 }	});
						   						   
						   
	/******************* validation formulaire contact *************************/						   
	$("#form_contact" ).validate({ 
onfocusout: true,
onkeyup: true, 
showErrors: function(errorMap, errorList) { 
if (errorList.length > 0) {
jQuery('#ereur_form').html( errorList[0].message);        }    }
});					   
/******************* validation formulaire cadeaux *************************/						   
						   
						   	$("#form_cadeaux" ).validate({ 
onfocusout: true,
onkeyup: true, 
showErrors: function(errorMap, errorList) { 
if (errorList.length > 0) {
jQuery('#ereur_form').html( errorList[0].message);        }    }
});
/******************* style des scrolls shoutbox *************************/
$("#chatroom").jScrollPane();
$("#chatroom1").jScrollPane();
						   
/******************* Formatage des border dernier *************************/
$("#rub-playlist div.ligne_contenu:last").addClass("npborder");
$("#conteneur_actupod div.ligneactupod:last").addClass("npborder");
$("#rub-onair div.ligne_contenu:last").addClass("npborder");

// menu
$("#menu ul li a.rub").mouseenter(function(){$(this).next(".rub").addClass("sb");});
$("#menu ul li a.rub").mouseleave(function(){$(this).next(".rub").removeClass("sb");});

						   
						   
/****************** Deb Dailymotion**************************/		

$("#conteneur_daily a.selected img").animate({opacity: 0.4},200);
						 //hover des dailymotion
						$("#conteneur_daily img").live("mouseover",function(){
							if($(this).parent("a").attr("class")!=="selected")
							{$(this).css("border-color","#FF7F7F");									 
							$(this).animate({opacity: 0.4},200);/* alert("test");*/
							}  }) ;
						
						
						$("#conteneur_daily img").live("mouseout",function(){
			if($(this).parent("a").attr("class")!=="selected")
					{	$(this).css("border-color","#ffffff");	
						$(this).animate({opacity: 1},200);/* alert("test");*/ }  }) ;
						
						
						
						
/****************** fin Dailymotion**************************/	

/******************debut select WEBRADIO**************A activer************/		
$("#bt_web_radio div.select").click(function(){ $("#select_wr").slideDown("fast");});
$("#bt_web_radio").mouseleave(function(){ $("#select_wr").slideUp("fast");});

/******************fin select WEBRADIO**************************/	

/******************debut diapo**************************/	

//initilisation
$("#zone_texte a:first").addClass("selected");
$("#zone_image img:first").addClass("selected");
$("#zone_image div.desc_flashactu:first").addClass("selected");




$(window).everyTime(12000, 'timerd', function(){diapoSuivant();});


$("#zone_image.stopper").mouseenter(function(){$(window).stopTime('timerd');});
$("#zone_image.stopper").mouseleave(function(){if(!encoursplay){$(window).everyTime(12000, 'timerd', function(){diapoSuivant();});}});

$("#zone_image img:first").show();
$("#zone_image div.desc_flashactu:first").animate({top: 264},500);

$("#zone_texte a").click(function(){ 
				if(clicdiapo)
				{   //$(this).delay(5000,function(){diapoSuivant()});
					clicdiapo=false;
					
					$(window).stopTime('timerd');					
					$(window).everyTime(12000, 'timerd', function(){diapoSuivant();});
					
				 idn=$(this).attr("id");
	
	$("#zone_texte a.selected").removeClass("selected");
	$(this).addClass("selected");
	
	$("#zone_image div.selected").animate({top: 354},200,function(){ 																  
	//$("#zone_image div.selected").removeClass("selected");
//alert("test"+idn);	
	$("#zone_image div.desc_flashactu[name='"+idn+"']:first").animate({top: 264},500,function(){
							//alert("ok");											   
			$(this).addClass("selected");
			clicdiapo=true;	
		
			});
	}); 
															 
			
	         $("#zone_image img.selected").fadeOut("fast",function(){$(this).removeClass("selected");});
			  $("#zone_image img[name="+idn+"]").addClass("selected");
	         $("#zone_image img[name="+idn+"]").fadeIn("slow",function(){});
														  
				}});




/******************fin diapo**************************/	
  //
 });

 
 /* Modif akli */
 $(document).ready(function(){
    $('#nav1 a').click( function(){
		$('#titre1').css("display","block");
		$('#contenu1').css("display","block");
		/* masquer */
		$('#titre2').css("display","none");
		$('#contenu2').css("display","none");
		$('#titre3').css("display","none");
		$('#contenu3').css("display","none");
	});
	
	$('#nav2 a').click( function(){
		$('#titre2').css("display","block");
		$('#contenu2').css("display","block");
		/* masquer */
		$('#titre1').css("display","none");
		$('#contenu1').css("display","none");
		$('#titre3').css("display","none");
		$('#contenu3').css("display","none");
	});
	
	$('#nav3 a').click( function(){
		$('#titre3').css("display","block");
		$('#contenu3').css("display","block");
		/* masquer */
		$('#titre1').css("display","none");
		$('#contenu1').css("display","none");
		$('#titre2').css("display","none");
		$('#contenu2').css("display","none");
	});
	
	
	
	


});


 







/* ------- Debut Script slideUp --------- */

$(document).ready( function () {

	// On cache les sous-menus

	// sauf celui qui porte la classe "open_at_load" :

	$("ul.subMenu:not('.open_at_load')").hide();

	// On selectionne tous les items de liste portant la classe "toggleSubMenu"

		

	// et on remplace l'element span qu'ils contiennent par un lien :

	$("li.toggleSubMenu span").each( function () {

	// On stocke le contenu du span :

	var TexteSpan = $(this).text();

	$(this).replaceWith('<a href="" title="Afficher le sous-menu">' + TexteSpan + '</a>') ;

	} ) ;

		

	// On modifie l'evenement "click" sur les liens dans les items de liste

	// qui portent la classe "toggleSubMenu" :

	$("li.toggleSubMenu > a").click( function () {

	// Si le sous-menu etait deja ouvert, on le referme :

	if ($(this).next("ul.subMenu:visible").length != 0) {

	$(this).next("ul.subMenu").slideUp("normal", function () { $(this).parent().removeClass("open") } );

	}

	// Si le sous-menu est cache, on ferme les autres et on l'affiche :

	else {

	$("ul.subMenu").slideUp("normal", function () { $(this).parent().removeClass("open") } );

	$(this).next("ul.subMenu").slideDown("normal", function () { $(this).parent().addClass("open") } );

	}

	// On empêche le navigateur de suivre le lien :

	return false;

});	

} ) ;

/* ------- Fin Script slideUp --------- */















