/* =============================================================================
 * menu.js
 * Code for the dropdown menus (firms and designations)
 * Copyright (c) 2010-2011 Queen's Accounting Association
 * Written by Siyuan Tang, Aug 15, 2010
 * ========================================================================== */

(function(){

/*
 * buttonhook() function
 * Links the container of the menu button with the menu that it is supposed
 * to show when the mouse hovers over it
 * @container_id The id of the container element (eg a <td> or a <li>)
 * @menu_id The id of the menu element (eg the enclosing <div> of the dropdown)
 */
var buttonhook = function(container_id, menu_id) {
    var container = document.getElementById(container_id);
    var menu = document.getElementById(menu_id);

    container.onmouseover = function(){
        menu.style.display = "block";
    }
    container.onmouseout = function(){
        menu.style.display = "none";
    }
}

//Link buttons with menus here...
buttonhook("button_firms", "menu_firms");
buttonhook("button_designations", "menu_designations");
buttonhook("button_courses", "menu_courses");

})();
