  
  $(document).ready(function(){ 
    
    // menu
    $(".has-subnav").hover(function() {
//          $(".has-subnav>ul").css({display : 'none', width : 150, height: 0, 'margin-top': '-1000px'});
//        $(this).find("ul").css({'margin-top': 40});
        $(this).find("ul").stop().show().animate({ height : 94 * $(this).find("li").length  }, 750 * $(this).find("li").length );
        $(this).find("ul").css({'border-bottom-width': 0});// hack pour éviter les striures sur ie8
        $(this).find("a").css({ opacity: 1});
    },function() {
        $(this).find("ul").css({width : 150, 'border-bottom-width': 1});
        $(this).find("ul").stop().animate({ height: 0 }, 1000).hide();
  //      setTimeout( function() {
           //$(this).find("ul").css({display : 'none', width : 150, height: 0, 'margin-top': '-1000px'});
//        }, 1500);
        $(this).children("a").css({ opacity: 0.4});
    });
    
    // sous menu
    $(".has-subnav>ul>li>a").hover(function() {
        $(this).parents().find(".has-subnav>ul").css({width : 300});
        $(this).parents().find(".has-subnav>ul>li>a").css({ opacity: 0.4});
        $(this).css({ opacity: 1});
        $(this).stop().animate({ width: 300}, 500);
    },function() {
        $(this).parents().find(".has-subnav>ul").css({width : 150});
        $(this).stop().animate({ width: 150 }, 300);
    });
    
    $(".has-subnav>ul").css({display : 'none', width : 150, height: 0/*, 'margin-top': '-1000px'*/});
      
  });  
