/**include
//_javascript/js-wrapper.js;
*/

var menuControlClick = {
    idEln     : null,
    keyMenu   : null,

    init : function(id, keyMenu, winWr)
    {
        this.winWr = winWr ? winWr : _wrapper;

        this.id        = id;
        this.keyMenu = keyMenu;
        this.winWr.createStyle(".jsHide", "display:none;");
		this.winWr.setOnloadListener(this);
    },

    onload  : function(evtWr)
    {
        for (var i in this.keyMenu) {
            if (this.winWr.checkElement('topMenu_a'+this.keyMenu[i])) {
                var oMenuElm = this.winWr.getElement("topMenu_m"+this.keyMenu[i]);
                oMenuElm.addListener(this, "onclick").elm = this.keyMenu[i];
                if (this.keyMenu[i] == this.id) {
                    this.winWr.getElement("topMenu_a"+this.keyMenu[i]).removeClass("jsHide");
                }
            }
        }
    },


    onclick : function(evtWr, data)
    {
		evtWr.eventDrop();
		var oMenuElm = this.winWr.getElement("topMenu_a"+data['elm']);
        if (oMenuElm.isShow()) {
            oMenuElm.addClass("jsHide");
        } else {
            oMenuElm.removeClass("jsHide");
        }
    }
};