$(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 effect2(var1,target,ouske){
		if(var1==1){
			$("#sous"+target).stop(true).animate({'width':280+'px', 'opacity':0.9, 'borderWidth':5+'px'},300);
		}
		else{
			$("#sous"+target).stop(true).animate({'width':0+'px', 'opacity':0.1, 'borderWidth':0+'px'},300,function() {
				if(ouske)  {
					effect(0,target.substr(5,5));
				}
			});			
		}
	}
	
	$(".shownextrange").hover(
      function () {
		effect2(1,$(this).attr('id').substr(0,11),false)       
      }, function () {
		effect2(0,$(this).attr('id').substr(0,11),false)
      }
    );
	$(".sousSousMenu").hover(
      function () {
		effect2(1,$(this).attr('id').substr(4,11),true)        
      }, function () {
		effect2(0,$(this).attr('id').substr(4,11),true)
      }
    );
	
	function effect3(var1){
		if(var1==1){
			$("#honomenu").stop(true).animate({'height':100+'px', 'opacity':0.95},300);
		}
		else
			$("#honomenu").stop(true).animate({'height':0+'px', 'opacity':0.1},300);
	}
	
	$("#hono").hover(
      function () {
		effect3(1)
      }, function () {
		effect3(0)
      }
    );	
	$("#honomenu").hover(
      function () {
		effect3(1)        
      }, function () {
		effect3(0)
      }
    );
	
	function effect4(var1){
		if(var1==1){
			$("#avocatmenu").stop(true).animate({'height':100+'px', 'opacity':0.95},300);
		}
		else
			$("#avocatmenu").stop(true).animate({'height':0+'px', 'opacity':0.1},300);
	}
	
	$("#avocat").hover(
      function () {
		effect4(1)
      }, function () {
		effect4(0)
      }
    );	
	$("#avocatmenu").hover(
      function () {
		effect4(1)        
      }, function () {
		effect4(0)
      }
    );
	
	
	// Nous cachons d'abord tous les sous-menus
	$('#Menu2 ul ul:not(".selected")').hide();
	// Lors du survol d'un menu disposant d'un sous-menu,
	// nous rendons le sous-menu visible.
	$('#Menu2 ul li').hover(function() {// Fonction à exécuter lors du survol
		$(this).find('ul:not(".selected")').stop(1,1).slideToggle();
	},function(){ // Fonction à exécuter lors de la fin du survol
		$(this).find('ul:not(".selected")').stop(1,1).slideToggle();
	});
	
	
	
	
	
});

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