var DropdownMenu = new Class({
    Implements: Options,

    options: {
        'element': null
    },

    initialize: function(options) {
        this.setOptions(options);
        
        if (!this.options.element) {
            return;
        }

        this.options.element.getChildren('li').each(function(li) {
            li.getChildren('ul').each(function(ul) {
                ul.hide = function() {
                    return this.setStyle('display', 'none');
                };

                ul.show = function() {
                    return this.setStyle('display', 'block');
                };    

                li.addEvent('mouseenter', function(e) {
                    ul.show();
                    li.addClass('valhallaNavbarItemFocused');
                });

                li.addEvent('mouseleave', function(e) {
                    ul.hide();
                    li.removeClass('valhallaNavbarItemFocused');
                });

                new DropdownMenu({'element': ul});
            });
        });
    }
});

