function closeModal(){
	$.nyroModalRemove();
}
function nyromodalManualQuizz(){
	$.nyroModalManual({
		width:658,
		height:227,
		type:'swf',
		url: 'swf/Quizz.swf', 
		swf: {
			allowscriptaccess:'always',
    		wmode: 'transparent'
  		},css:{
  			wrapper:{
  				background:'transparent'
  			}
  		}
	});
}

function ajoutSelection(id){
		nb = $('#nbParticipants').val();
		sess =  $('#ajoutListeDate').val();
		//alert(sess);
	
		$.ajax({
   			type: "POST",
   			url: "php/actions/aj.ajout-selection.php",
   			data: "id="+id+"&sess="+sess+"&nb="+nb+"",
   			success: function(data){
     			$("#pushSelection").fadeOut("fast");
     			$("#lienSlection").replaceWith(data);
     			$("#pushSelection").fadeIn("fast");
     			
     			$.nyroModalRemove();
     			
   			}
   		});
   		
}

function suppSelection(id){
	$.ajax({
   			type: "POST",
   			url: "php/actions/aj.supp-selection.php",
   			data: "id="+id+"",
   			success: function(data){
     			$("#pushSelection").fadeOut("fast");
     			$("#lienSlection").replaceWith(data);
     			$("#pushSelection").fadeIn("fast");
     			
     			$(".ligneSelection"+id+"").hide();
     			
     			//alert(data);
   			}
   		});
	
}

$(document).ready(function(){
	
	var finished = true;

	$('.ssMenuA').each(function(){

		if($('a.active').length > 0){

			if(!$(this).hasClass('active')){
				$(this).hover(function(){
					//console.log("on");
					$(this).children('.ssMenuHovered').stop(true,true).fadeOut("fast");
				}, function(){
					//console.log("quit");
					$(this).children('.ssMenuHovered').stop(true,true).fadeIn("fast");
				});
			}

		}else{
			
			$(this).children('.ssMenuHovered').hide();
			
			function makeTall(){
				$(this).addClass("menuAccueilOn");
				$("a:not(.menuAccueilOn) .ssMenuHovered").stop(true,true).fadeIn("slow");
			}
			
			function makeShort(){
				$("a:not(.menuAccueilOn) .ssMenuHovered").stop(true,true).fadeOut("slow");
				$(this).removeClass("menuAccueilOn");
			}
			
			$(this).hoverIntent( makeTall, makeShort );
		}
		
	});



});

