function clickmenu(no) { createCookie('selectedmenu', no,100); }
function checkMouse(e) { var openmenu = document.getElementById('menuarea'); if (openmenu) { if (!e) var e = window.event; var tg = (window.event) ? e.srcElement : e.target; var obj = openmenu; while (tg && tg != obj && tg.nodeName != 'BODY') { tg= tg.parentNode; } if (tg == obj) { return; } else { hidemenu(); } } }
function initMenu() { var cookieValue = readCookie('selectedmenu'); if(cookieValue && cookieValue.length>0 && cookieValue<=totalmenu){ showmenu(cookieValue); } else { showmenu(1); } }
function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; }
function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; }
<DIV align=left>
<BUTTON onclick="Engine_DIV.style.visibility='visible'">OPEN</BUTTON>
</DIV>
<DIV id=Engine_DIV style="VISIBILITY: visible; width: 550px; height: 200px; BORDER-RIGHT: #E8E8E8 1px solid; BORDER-TOP: #E8E8E8 1px solid; BORDER-LEFT: #E8E8E8 1px solid; BORDER-BOTTOM: #E8E8E8 1px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; PADDING-TOP: 5px; PADDING-BOTTOM: 5px">
<br><br><br><br><br><br><br><br><br>
<DIV align=right>
<BUTTON onclick="Engine_DIV.style.visibility='hidden'">CLOSE</BUTTON>
</DIV>
</DIV>
CLOSE
감추기(hidden) 형