var MenuSystem = Class.create({
    
    initialize: function(){
        this.currentMenuId;
        this.lastMenuId;
        this.hideMenuTimeOut = 0;
    },

    hideMenu: function (id){
        var menu_holder_id = 'menu-holder-'+id;
        document.getElementById(menu_holder_id).style.display='none';
        var menu_link_id = 'menu-link-'+id;
        // console.log(menu_link_id);
        document.getElementById(menu_link_id).className = '';
    },
    
    showMenu: function (id){
        var current_menu_holder_id = 'menu-holder-'+id;
        document.getElementById(current_menu_holder_id).style.display='block';
        var new_menu_link_id = 'menu-link-'+id;
        document.getElementById(new_menu_link_id).className = 'menu-active';
    },

    fadeMenu: function (id){
        var menu_holder_id = 'menu-holder-'+id;
        new Effect.Fade(menu_holder_id, {duration: 0.6});
    },

    mouseOutMenu: function (id){
    
    },

    mouseOverMenu: function (id){
        
        this.currentMenuId = id;
    
        var last_menu_holder_id = 'menu-holder-'+this.lastMenuId;
    
        if(document.getElementById(last_menu_holder_id) && this.currentMenuId != this.lastMenuId){
            this.hideMenu(this.lastMenuId);
            /* var last_menu_link_id = 'menu-link-'+this.lastMenuId;
            console.log(last_menu_link_id);
            document.getElementById(last_menu_link_id).className = ''; */
        }
        
        this.showMenu(id);
    
        this.lastMenuId = this.currentMenuId;
        
    },

    hideAllMenus: function (){
        this.hideMenu(1);
        this.hideMenu(2);
        document.getElementById('menu-link-2').className = '';
        this.hideMenu(3);
        document.getElementById('menu-link-3').className = '';
        this.hideMenu(4);
        document.getElementById('menu-link-4').className = '';
        /* this.hideMenu(5);
        document.getElementById('menu-link-5').className = ''; */
    }

});
