function Item(content, link) {
    this.content = content;
    this.link = link;
}

function Menu(name, link) {
    this.name = name;
    this.link = link;
    this.item = new Array();

    this.add_item = add_item;
    this.item_count = item_count;
    this.get_menu_name = get_menu_name;
    this.get_menu_link = get_menu_link;
    this.show_item = show_item;
}

Menu.width = 158;
Menu.height = 24;

function add_item(content, link) {
    this.item.push(new Item(content, link));
}

function item_count() {
    return this.item.length;    
}

function get_menu_name() {
    return this.name;
}

function get_menu_link() {
    return this.link;
}

function show_item(id) {
    document.write('<div class="item" id="menu' + id + '" style="visibility: hidden; left: ' + (id * Menu.width) + '; height: ' + (this.item_count() * Menu.height) + '">');
    for (var i = 0; i != this.item_count(); ++i) {
        document.write('<span class="itemtext"><a href=' + level() + this.item[i].link + '>' + this.item[i].content + '</a></span><br />');
    }
    document.write('</div>');
}

