var n4 = (document.layers)? true : false ;
var e4 = (document.all)? true : false ;
function popupmenu_show(layername,code,no,lname,email,homepage) {
    var obj = document.all[layername];
    var layermenu='';
    var _tmpx,_tmpy, marginx, marginy;
    _tmpx = event.clientX + parseInt(obj.offsetWidth);
    _tmpy = event.clientY + parseInt(obj.offsetHeight);
    _marginx = document.body.clientWidth - _tmpx;
    _marginy = document.body.clientHeight - _tmpy ;
    if(_marginx < 0) _tmpx = event.clientX + document.body.scrollLeft + _marginx ;
    else _tmpx = event.clientX + document.body.scrollLeft ;
    if(_marginy < 0) _tmpy = event.clientY + document.body.scrollTop + _marginy + 20;
    else _tmpy = event.clientY + document.body.scrollTop ;
    obj.style.posLeft = _tmpx - 5;
    obj.style.posTop  = _tmpy;

    if(email) layermenu ="<tr style=cursor:pointer height=20><td onmouseover=\"this.style.background='#4680B3';this.style.color='#FFFFFF'\" onmouseout=\"this.style.background='#FFFFFF';this.style.color='#000000'\" onmousedown=\"window.open('sendmailer.php?code="+code+"&no="+no+"','smail','width=400,height=400,statusbar=no,scrollbars=yes,toolbar=no')\">&nbsp;<img src=img/ico_mail.gif align=absmiddle> ¸ÞÀÏº¸³»±â </td></tr>";
		if(homepage) layermenu +="<tr style=cursor:pointer height=20><td onmouseover=\"this.style.background='#4680B3';this.style.color='#FFFFFF'\" onmouseout=\"this.style.background='#FFFFFF';this.style.color='#000000'\" onmousedown=\"window.open('"+homepage+"','','')\">&nbsp;<img src=img/ico_home.gif align=absmiddle> È¨ÆäÀÌÁö </td></tr>";
		if(lname) layermenu +="<tr style=cursor:pointer height=20><td onmouseover=\"this.style.background='#4680B3';this.style.color='#FFFFFF'\" onmouseout=\"this.style.background='#FFFFFF';this.style.color='#000000'\" onmousedown=\"location.href='box.php?code="+code+"&skey=4&sword="+lname+"'\">&nbsp;<img src=img/ico_name.gif align=absmiddle> ¼º¸íÀ¸·ÎÃ£±â </td></tr>";
    if(layermenu) layermenu="<table bgcolor='cccccc' width=100% cellpadding='0' cellspacing='1' onMouseOver=\"clearTimeout(mytimer);\" onMouseOut=\"hideMenu('"+layername+"');\" ><tr><td bgcolor='$CCCCCC'><table border=0 bgcolor='#FFFFFF' width='100%' cellpadding='0' cellspacing='1'>"+layermenu+"</table></td></tr></table></div>";
    if(n4 == true) obj.document.write(layermenu);
     else obj.innerHTML=layermenu;
    layer_set_visible(obj, true);
    layer_set_pos(obj, event.clientX, event.clientY);

}

function layer_set_visible(obj, flag) {
  if (navigator.appName.indexOf('Netscape', 0) != -1) {
        obj.visibility = flag ? 'show' : 'hide';
  } else {
    obj.style.visibility = flag ? 'visible' : 'hidden';
  }
}
function layer_set_pos(obj, x, y)
{
  if (navigator.appName.indexOf('Netscape', 0) != -1) {
    obj.left = x;
    obj.top  = y;
  } else {
    obj.style.pixelLeft = x + document.body.scrollLeft;
    obj.style.pixelTop  = y + document.body.scrollTop;
  }
}

function popupmenu_off(layername) {
    obj = document.all[layername];
    layer_set_visible(obj, false);
}

function hideMenu(layername){
    obj = document.all[layername];
  	clearTimeout(2000);
		mytimer = setTimeout("obj.style.visibility='hidden'", 200) ;
}


