(function($){
  $.fn.extend({ 
    //plugin name - animatemenu
    animateMenu: function(options) {

      //Settings list and the default values
      var defaults = {
        speed: 50
      };
      
      var options = $.extend(defaults, options);
    
        return this.each(function() {
        var o =options;
        
        //Assign current element to variable, in this case is UL element
        var obj = $(this);
        var defaultHeight = obj.height();
        var extendedHeight = obj.height()+$(this).find("div").height()+1;
          
        //Attach mouseover and mouseout event to the LI  
        obj.bind('mouseenter', function() {
          $(this).animate({height: extendedHeight}, o.speed);
          
        }).bind('mouseleave', function() {
          $(this).animate({height: defaultHeight}, o.speed);
        });
        
        });
      }
  });
})(jQuery);
