function $(id) { return document.getelementbyid(id); } function showmenu (baseid, divid) { baseid = $(baseid); divid = $(divid); if (showmenu.timer) cleartimeout(showmenu.timer); hidecur(); divid.style.display = 'block'; showmenu.cur = divid; if (! divid.iscreate) { divid.iscreate = true; //divid.timer = 0; divid.onmouseover = function () { if (showmenu.timer) cleartimeout(showmenu.timer); hidecur(); divid.style.display = 'block'; }; function hide () { showmenu.timer = settimeout(function () {divid.style.display = 'none';}, 1000); } divid.onmouseout = hide; baseid.onmouseout = hide; } function hidecur () { showmenu.cur && (showmenu.cur.style.display = 'none'); } }