$(document).ready(function() {
		$("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			 
			});
		}
		
	function effect(var1,id){
		if(var1==1){
			var lgth = $("#sousMenu"+id+" > li").length*27;
			$("#sousMenu"+id).stop(true).animate({'height':lgth+'px', 'opacity':0.95},300);
		}
		else{
			$("#sousMenu"+id).stop(true).animate({'height':0+'px', 'opacity':0.1},300);
		}
	}
	
	$("#menu li").hover(
      function () {
		var id=$(this).attr('class').substr(7,1);
		effect(1,id);
      }, function () {
		var id=$(this).attr('class').substr(7,1);
		effect(0,id);
      }
    );	
	$(".sousMenu").hover(
      function () {
		var id=$(this).attr('id').substr(8,1);
		effect(1,id);       
      }, function () {
		var id=$(this).attr('id').substr(8,1);
		effect(0,id); 
      }
    );
});

$(function(){
   $('.clic').hover(function() { //mouse in
   		$(this).stop().animate({ opacity: '0.75' }, 250);
   }, function() { //mouse out
    	$(this).stop().animate({ opacity: '1' }, 250);
   });   
});

$(function(){
   $('#logo').hover(function() { //mouse in
   		$(this).find('img').stop().animate({ opacity: '0' }, 1000);
   }, function() { //mouse out
    	$(this).find('img').stop().animate({ opacity: '1' }, 1000);
   });   
});

$(function(){
   $('#menu2 a').hover(function() { //mouse in
   		$(this).stop().animate({ opacity: '0' }, 333);
   }, function() { //mouse out
    	$(this).stop().animate({ opacity: '1' }, 333);
   });   
});
