$(document).ready(function(){

	$('a[rel*=lightbox]').lightBox();
	$("#accordion4").msAccordion({defaultid:1, vertical:true});

	// Drop Down Menu
	if ( $('#dropDownMenu').length ) {

		$('#dropDownMenu li').hover(function(){
				$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(400); },
				function(){ $(this).find('ul:first').css({visibility: "hidden"});
		});
	}

	// kwicks menu homepage
	if ( $(".kwicks").length ) {

		$(".kwicks div.bloc").css({display: 'none'});

		$(".kwicks li").bind('mouseenter', function() {

			$(".kwicks li").stop(true);
			$(".kwicks li").find('div.bloc').stop(true, true);

			// La taille de l'élément survolé est agrandie.
			$(".kwicks li").not(this).animate({ width: 270 }, 250);

			// la taille des autres colonnes est diminuée.
			$(this).animate({ width: 390 }, 250);

			// Les blocs de la colonne courante sont affichés.
			$(this).find('div.bloc').each(function(){ $(this).fadeIn(500) });

			$(this).addClass('active');

			// Les blocs des autres colonnes sont masqués.
			$('.kwicks li').not(this).find('div.bloc').each(function(){ $(this).fadeOut('slow') });
		})

		$(".kwicks li").bind('mouseleave', function(e) {
			// Les colonnes reprennent leur taille par défaut.
			$(".kwicks li").animate({ width: 310 }, 250);

			// Les blocs de chaque colonne sont masqués
			$(".kwicks li").find('div.bloc').each(function(){ $(this).fadeOut('fast') });

			$(this).removeClass('active');
		})
	}

});
