/**include
//_javascript/js-wrapper.js;
//_javascript/debug.js;
*/
/**
 * Menu control
 */
var menuControl = newObject({
    id    : null,
    timer : null,
    curEl : -1,
    menuLnk : null,
    subMenu : null,

    init : function (id, isOpen) {
        this.id = "#" + id;
        if (!isOpen) {
            this.$w0.createStyle(this.id + " .lev2", "display: none;");
        }
    },
    onready : function (a, b) {
        this.subMenu = {};
        this.menuLnk = this.$$(this.id + " a#mnLnk*");
        for(var i = 0; i < this.menuLnk.length; i++) {
            this.menuLnk[i].addListener(this, "onclick").i = i;
            this.subMenu[i] = this.menuLnk[i].getNextSibling();
        }
    },
    onclick : function(evtWr, dt)
    {
        evtWr.elmWr.elm.blur();

        if (this.subMenu[dt.i]) {
            //evtWr.eventDrop();
            evtWr.stopBubbling();
            this.subMenu[dt.i].invDisplay();
        }
    }
});