﻿// JScript File

function MenuObject()
{
    this.items = new Object();
    this.GetItem = function(id){
        var item
        item = this.items['i' + id]
        if (!item)
        {
            item = new this.MenuItem(id)
            this.items['i' + id] = item
        }
        return item;    
    }
}

MenuObject.prototype.ShowSubMenu = function (topicID){
    var item = this.GetItem(topicID);
    if(item)
    {
        item.ShowSubMenu();
    }
}

MenuObject.prototype.HideSubMenu = function (topicID,timeOut){
    var item = this.GetItem(topicID);
    if(item)
    {
        item.HideSubMenu();
    }
}



MenuObject.prototype.MenuItem = function (topicID){
    this.TopicID = topicID;
    this.SubMenuDiv = document.getElementById('d' + topicID);
    this.ShowSubMenu = function(){
        if (this.SubMenuDiv){
            this.SubMenuDiv.style.display = 'block';
        }
    }
    this.HideSubMenu = function(){
        if (this.SubMenuDiv){
            this.SubMenuDiv.style.display = 'none';
        }
    }
    
}
