$(document).ready(function() {

		$("a#box_candidature").fancybox({ 
			hideOnContentClick: false,
			hideOnOverlayClick: false,
			frameWidth : 500,
			frameHeight : 400			 
		});	
		
		$("a.thickbox, a[rel='lightbox']").fancybox({
			'hideOnContentClick': false,
			imageScale : true
		}); 

		$("a#box_ami").fancybox({
			frameWidth : 300,
			frameHeight : 200
		}); 

		if(document.all){
			$("a#box_fav").click(function(){
				window.external.AddFavorite(location.href, document.title);
			});
		}else{

			$("a#box_fav").fancybox({ 
				'hideOnContentClick': true,
				frameWidth : 400,
				frameHeight : 100			 
			});
		}

// SOUS-MENU		   
		$('.menuHorizontal ul').css('display','none');
		$('.menuHorizontal li').hover(
			function(){
				$(this).find('ul').stop(true,true).slideDown();
			},
			function(){
			   $(this).find('ul').stop(true,true).slideUp();
			}
		);

					   
// FOOTER 01
		$("#btn_show").click(function(){
			$(".footer").animate({height: "410px"});
			$(".panel_button").toggle();
		});		
		$("#btn_hide").click(function(){
			$(".footer").animate({height: "33px"});
			$(".panel_button").toggle();
		});		

// FOOTER 02
		$("#btn2_show").click(function(){
			$(".footer2").animate({height: "390px"});
			$(".panel_button2").toggle();
		});		
		$("#btn2_hide").click(function(){
			$(".footer2").animate({height: "116px"});
			$(".panel_button2").toggle();
		});	
		
// LIEN OVER
		$(".lien").hover(
			function(){
				$(this).stop(true,true).animate({backgroundPosition: '0px 0px'});
			},
			function(){
				$(this).stop(true,true).animate({backgroundPosition: '-350px 0px'});
			}
		);
		
		$(".lien2").hover(
			function(){
				$(this).stop(true,true).animate({backgroundPosition: '0px 0px'});
			},
			function(){
				$(this).stop(true,true).animate({backgroundPosition: '-350px 0px'});
			}
		);
		
		$(".btn_retour").hover(
			function(){
				$(this).stop(true,true).animate({backgroundPosition: '0px 0px'});
			},
			function(){
				$(this).stop(true,true).animate({backgroundPosition: '-350px 0px'});
			}
		);


// PAGE NOS PACKS (ACCORDION)
		
		var uriCourant = document.location.href;		
		var indiceDepart = uriCourant.lastIndexOf('/')+1;
		var indiceArrivee = uriCourant.length; 	
		var nomPage = uriCourant.substring(indiceDepart, indiceArrivee);
		 
		
		
	
		$('.accordion .element div').css({'height':'0px', 'overflow':'hidden', 'marginTop':0,'marginBottom':0, 'opacity':0});
		$('.accordion h2, .element div').css({'cursor':'pointer'});

		$(function() {			
			
			
			$('.element h2').click(
				function() {
				$(this).addClass("select"); 
				var hght=$(this).parent().find('div').css('height');
				var letsgo=false;
				var size=$(this).parent().parent().attr("class");
				size=size.substr(11,3);
				$('.element div').stop().animate({'height':0,'opacity':0,'paddingTop':'0px','paddingLeft':'0px','paddingRight':'0px'},150);
				if((hght<'10px')? letsgo=true:letsgo=false)
					$(this).parent().find('div').stop().animate({'height':size+'px','opacity':1,'paddingTop':'25px','paddingLeft':'10px','paddingRight':'10px'},225);		  
			});
			
			$('.element div').click(function() {
				$('.element div').stop().animate({'height':0,'opacity':0,'paddingTop':'0px','paddingLeft':'0px','paddingRight':'0px'},250);	
				$('.accordion h2').removeClass("select"); 
			});
			
		});
		

// ACTUALITES (montage a l'envers)

//		var imagesActu = document.getElementById("images-actu");
//		var contenuActu = document.getElementById("contenu-actu");
//		var hauteurActu = imagesActu.offsetHeight;
//		contenuActu.style.paddingTop = hauteurActu+"px";


		
		



});
