// Name of the function must be significant
function toggleMenu(id){

    // Using prototype, we replace document.getElementById('') => $('')
    var active = $(id);
    var menu = "";
    
    for (var i = 1; i <= 10; i++) {
        menu = $('smenu' + i);
        if ($(menu)) {
            if (menu.style.display != 'none') {
                // Close the currently open menu					
               new Effect.SlideUp(menu);
            }
        }        
    }
    
    if (active) {
        if (active.style.display == 'none') {
            // Open the menu if its closed
            new Effect.SlideDown(id);
			active.style.height = "";
        }
    }
}
