window.addEvent('domready',function(){
    //    new AQMenu();

    $$('#menu a').each(function(item){
        // Leave admin and presenters
        if (item.hasClass('admin') || item.hasClass('presenters')) {
            return;
        }
        // Empty text from link
        item.empty();

        if (Browser.Engine.trident && Browser.Engine.version <= 4) {
            return;
        }

        // Position active item in front of content div
        if (item.getParent().hasClass('active')) {
            var pos = item.getPosition($('container'));
            var styles = item.getStyles('width','height','text-transform','background-image','position','display');
            //alert(JSON.encode(pos));
            var active = item.dispose();
            active.setStyles(styles);

            var test = active.inject($('container'),'top');
            test.setStyle('left',pos.x);
            test.setStyle('top',pos.y);
            test.setStyle('z-index',50);
            return;
        }
        // Animate all inactive items on mouseover
        item.set('morph',{
            duration: 'normal',
            transition: 'elastic:out'
        });
        item.addEvent('mouseenter',function(){
            //    var top = item.getStyle('margin-top');
            //    alert(top);
            item.morph({
                'margin-top': -5
            });
        });
        item.addEvent('mouseleave',function(){
            item.morph({
                'margin-top': 0
            });
        });
    });
});