(function($) {
	
  $.fn.animateMenu = function() {
	
    this.each(function() {
    
      //var height = $(this).first('a').height(); height sie nie zgadza    

      var $subMenus = $(this).find('dd');//.not(currentMenu);
      $subMenus.hide();
      
      var $currentMenu = $(this).find('.current-menu');
      if ($currentMenu.get(0).tagName == 'DD'){
        $currentMenu = $currentMenu.prevAll('dt:first');
      }
      $currentMenu.nextUntil('dt').show();
      
      $(this).find('dt').mouseenter(function(){
        
        //if ($(this).parent()[0] == currentMenu) { 
          $subMenus.delay(1000).slideUp();
          $(this).nextUntil("dt").stop(true, false).css('height', '20px').slideDown();
          //currentMenu = $(this).parent()[0];
        //}
      });
      
    });
	}
})(jQuery);
