$(document).ready(function() {


$('.menu li').mouseenter(function() {
		if ($(this).attr('class') == 'first') {
			$(this).children('ul').animate({height:"180px"}, { queue:false, duration:500 });
		}
		else if($(this).attr('class') == 'second') {
			$(this).children('ul').animate({height:"50px"}, { queue:false, duration:500 });

		}
                else if($(this).attr('class') == 'third') {
			$(this).children('ul').animate({height:"50px"}, { queue:false, duration:500 });

		}
		else if($(this).attr('class') == 'last') {
			$(this).children('ul').animate({height:"50px"}, { queue:false, duration:500 });
		}


    });

	$('.menu li.first').mouseleave(function() {
			$('.page .menu li.first ul').animate({height:"0px"}, { queue:false, duration:500 });
	});
	$('.menu li.second').mouseleave(function() {
			$(this).children('ul').animate({height:"0px"}, { queue:false, duration:500 });


	});
	$('.menu li.third').mouseleave(function() {
			$(this).children('ul').animate({height:"0px"}, { queue:false, duration:500 });


	});
	$('.menu li.last').mouseleave(function() {
			$(this).children('ul').animate({height:"0px"}, { queue:false, duration:500 });


	});





//$(window).resize(resizeContent);
//resizeContent();





/*effect on search form*/
$('#primary-menu > li').each(function(indice){
    $ul = $(this).children('ul');
    $(this).remove('ul');
    $(this).html('<span>'+$(this).html()+'</span>');
    $(this).append($ul);
    if(indice == ($('#primary-menu > li').size()-1)){
        Cufon.now();
    };
});



 $("li.clicli").mouseover(function () {
   $(this).children(".picture").fadeTo('slow', 0.6, function() {
      // Animation complete.
    });
  });

$("li.clicli").mouseout(function () {
 $(this).children(".picture").fadeTo('slow', 1, function() {
      // Animation complete.
    });
  });

});

/*
function resizeContent(){

	heightInter = $(window).height();
	heightSite = $(".contenuDroit").height()+279;
	if(heightInter > heightSite){
		$(".contenuDroit").height(heightInter-279);
        }else{
            $(".contenuDroit").height('auto');
        }
}*/
