function toggleMenu(event){
    //If menu expanded and not the clicked inside the menu: collapse
    if($("links-container").visible() == true && Event.element(event).descendantOf('foundation-menu') == false && Event.element(event) != $('foundation-menu')){
        Effect.toggle($("links-container"),"blind",{duration: 0.2});
    }
    //If clicked the menu link: toggle
    if(Event.element(event) == $('foundation-menu-link')){
        Effect.toggle($("links-container"),"blind",{duration: 0.2});
    }
}
document.observe('click', toggleMenu);
