/**include
//_javascript/js-wrapper.js;
*/

/**
 * Modal window control
 */
_wrapper.createStyle("#menu_main_left .menu_div", "display: none;");
var stroyobzorMenuControl = {
    winWr : null,
    div   : [],
	aId   : [],
	
	timer : null,

    init : function(aId, curId, winWr)
    {
		
        winWr = winWr ? winWr : _wrapper;
		this.winWr = winWr;
		this.aId = aId;
		
		for (var i in this.aId) {
			var id = this.aId[i]
			dr = winWr.getElement("so_mnLnk_"+id);
			dr.addListener(this, "onclick").sw = winWr.getElement("so_mnDiv_" + id);
		}
		
		if (curId > -1) {
			var dirBlock = this.winWr.getElement("so_mnDiv_" + curId );
			dirBlock.show();
		}
		
		
    },

    onclick : function(evtWr, dt)
    {
        evtWr.eventDrop();
        //evtWr.elmWr.elm.blur();
		dt.sw.invDisplay();
    },

    setTimer : function(set)
    {
        if(this.timer) {
            clearTimeout(this.timer);
        }
		this.timer = set ? this.winWr.setTimeout(this.config.delay, this, "hideMenu") : null;
    },

    config : {
        "delay"   : 1500
    }

};
