var $jq = jQuery.noConflict();

$jq(document).ready(function() {
	
	$jq(".calendrier").hide();
	$jq(".calendrier").first().show();
	
	$jq(".topbourget .top").click(function(){
		
		$jq(".top").removeClass("selection");
		$jq(this).addClass("selection");
		
		var ref = $jq(this).attr("id");
		
		$jq(".bourget_2106").addClass("hidden");
		$jq(".bourget_2206").addClass("hidden");
		$jq(".bourget_2306").addClass("hidden");
		$jq(".bourget_2406").addClass("hidden");
		$jq(".bourget_2506").addClass("hidden");
		
		$jq("."+ref).removeClass("hidden");
		
	})
	
	$jq(".search a.link").hide();
	
	for (i=0; i<10; i++){
		 
		 $jq(".search a#item_"+i).show();
	
	}
	
	$jq(".search .less").click(function(){
										
		var ref= ($jq(this).html()-1)*10;
		
		$jq("a.link").hide();
		
		for (i=ref; i<ref+10; i++){
			 
			 $jq("a#item_"+i).show();
		
		}
		
	});
	
	
	
	
	

	$jq(".mois").click(function(){
							  
		$jq(".calendrier").hide();
		var id= $jq(this).attr("id");
		$jq("#m_"+id).show();
		
	});

	$jq(".show").click(function(){
							  
		$jq(".row_doc a").hide();
		var id= $jq(this).attr("id");
		$jq("#item_"+id).show();
		
	});
							 
	
	
	$jq(".nav_evt").click(function(){
								   
		$jq(this).hide()
		$jq(".nav .less").show();
		
	});

	
	$jq(".containlive a").hide();
	
	for (k=0;k<8;k++){
		$jq(".containlive a#item_"+k).show();
	}
	
	$jq(".navlive div").click(function(){
		$jq(".containlive a").hide();
		var s = $jq(this).html();
		
		for (k=(s-1)*8;k<((s-1)*8+8);k++){
			
			$jq(".containlive a#item_"+k).show();
		}
	});
	
	
	$jq(".actu strong, .actu img").click(function(){
		
		k = $jq(this).parent(".actu").find("code");
		
		
		if(k.is(':visible')){
			k.slideUp("fast");
		}else{
			k.slideDown("fast");
		}
	});
	
	
	$jq(".pages .nav").click(function(){
									  
		$jq(this).parent(".pages").children(".link").css("display", "none");
		var id= $jq(this).attr("id");
		
		$jq("."+id).css("display", "block");
		$jq("."+id).show();
		
	});

	$jq(".video .nav").click(function(){
									  
		$jq(this).parent(".pages").children("a").css("display", "none");
		var id= $jq(this).attr("id");
		
		
		id = id.substr(2);
		id = id*2;
		
		$jq("a#ps_"+id).css("display", "block");
		$jq("a#ps_"+id).show();
		
		$jq("a#ps_"+(id+1)).css("display", "block");
		$jq("a#ps_"+(id+1)).show();
		
	});

	
	if ($jq(".pop").length!=0){
		
		$jq("#FlashID1").hide();
		$jq("#FlashID2").hide();
	
		$jq(".pop").css("margin-left", ($jq(window).width()-$jq(".pop").width())/2);
		$jq(".pop").css("margin-top", ($jq(window).height()-$jq(".pop").height())/2);
		
		$jq(".black").css("height", $jq("#conteneur").height()+$jq(".footer").height()+20);
		$jq(".black").css("display", "block");
		
		survol = 0;
		
		
		$jq(".pop").mouseover(function(){
			survol = 1;
		});		
		
		$jq(".pop").mouseout(function(){
			survol = 0;
		});		
		
		
		
		
		
		$jq(".black, .close_video").click(function(){
			if( survol == 0){
				$jq(".black").hide();
				$jq("#FlashID1").show();
				$jq("#FlashID2").show();
				$jq(".pop").html("");
				$jq("#FlashID3").hide();
				
			};
			survol = 0;
		});		
	
	}
	
});
