// Instant Messenger // im_menu_action.js var im_menu_action = { "delay_hide" : 500, "delayhide" : false, "menu" : function() { try { var pElement = arguments[0]; delete arguments[0]; var pMenu = ( func.isString(arguments[1]) ) ? arguments[1] : arguments; if ( document.getElementById(pElement).innerHTML == "" ) { func.confEl(pElement, 'style', 'display:block;'); this.layout(pMenu, pElement); } else { func.confEl(pElement, 'style', 'display:none;'); this.del_innerHTML(pElement); this.clear_delayhide(); } } catch(e) { } }, "layout" : function(pHtml, pElement) { var _this = this; var el_dest_ = ( func.isString(pElement) ) ? func.byId(pElement) : pElement; var div_menu = func.newEl("div"); func.confEl(div_menu, 'style', 'padding:0px;border:1px solid #809aa9'); div_menu.onmouseover = function(){_this.clear_delayhide();}; div_menu.onmouseout = function(){_this.resetit(pElement);}; if ( func.isString(pHtml) ) div_menu.innerHTML = pHtml; else for ( i = 1; i < pHtml.length; i++ ) func.insEl(pHtml[i], div_menu); func.insEl(div_menu, el_dest_); this.delayhide = setTimeout("im_menu_action.del_innerHTML('"+pElement+"')", 2000); }, "del_innerHTML": function(pElement) { func.confEl(pElement, 'style', 'display:none;'); func.byId(pElement).innerHTML = ""; document.oncontextmenu = new Function("return true"); }, "resetit": function(pElement) { this.delayhide = setTimeout("im_menu_action.del_innerHTML('"+pElement+"')",this.delay_hide); }, "clear_delayhide" : function() { if ( this.delayhide ) clearTimeout(this.delayhide); } }