/*
** function that replacing sLmenu
** instal:
** 1) specify main UL id
** 2) uncomment / comment the proper line
** PS. not working with nested dropdowns
*/
window.addEvent('domready',function(){
    var menu = $('menu-main'); // main ul id
    if (menu){
        var mpos = menu.getPosition();
        menu.getChildren().each(function(li){
            var ul = li.getLast();
            if ( ul.getTag()=='ul'){
                li.addEvent('mouseover',function(){
                    var position = li.getPosition();
                    var size = li.getSize().size;
                    var left = position.x - mpos.x;
                    var top  = position.y+size.y-mpos.y;
                    var width = Math.max(size.x,241);
                    ul.setStyles({
                    'display':'block',
                    'width': width+'px',
                    'left': left+'px',
                    'top': top+'px',
                    'z-index':'999'
                    }).addClass('shown');
                });
                li.addEvent('mouseout',function(){
                    ul.setStyle('display','none').removeClass('shown');
                });
            }
        });
    }
});