	var layername = 'zb_layer_div'

	function zb_layer_action(name, status)
	{
		var obj = document.getElementById(name);

		if (typeof(obj) == 'undefined') {
			return;
		}

		if (status) {
			obj.style.visibility = status;
		} else {
			if(obj.style.visibility == 'visible')
				obj.style.visibility='hidden';
			else
				obj.style.visibility='visible';
		}
	}

	function _send_mail( member_no, dummy )
        {
		alert( 'ºñÈ¸¿øÀº ¸ÞÀÏÀ» º¸³¾¼ö ¾ø½À´Ï´Ù.' );
        }

	function zb_layer(homepage, mail, member_no, boardID, writer, traceID, traceType, isAdmin, isMember, isLevel, iNo, e)
	{
		var obj = document.getElementById(layername);
		var _tmpx,_tmpy, marginx, marginy;
		var x, y;
		var printHeight = 0;

		var event = e || event;

		_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.left=_tmpx-13;
		obj.style.top=_tmpy-12;

		var printMain="";
	
		if(homepage) {
			printMain = "<tr onMouseOver=this.style.backgroundColor='#bbbbbb' onMouseOut=this.style.backgroundColor='' onMousedown=window.open('"+homepage+"');><td style=font-family:±¼¸²;font-size:9pt height=18 nowrap>&nbsp;<img src=images/n_homepage.gif border=0 align=absmiddle>&nbsp;&nbsp;È¨ÆäÀÌÁö&nbsp;&nbsp;</td></tr>";
			printHeight = printHeight + 16;
		}
		if(member_no) {
			printMain = printMain +	"<tr onMouseOver=this.style.backgroundColor='#bbbbbb' onMouseOut=this.style.backgroundColor='' onMousedown=_send_mail('"+member_no+"','');><td style=font-family:±¼¸²;font-size:9pt height=18 nowrap>&nbsp;<img src=images/n_mail.gif border=0 align=absmiddle>&nbsp;&nbsp;¸ÞÀÏ º¸³»±â&nbsp;&nbsp;</td></tr>";
			printHeight = printHeight + 16;
		}
		if(member_no) {
			if(isMember) {
				printMain = printMain +	"<tr onMouseOver=this.style.backgroundColor='#bbbbbb' onMouseOut=this.style.backgroundColor='' onMousedown=window.open('view_info.php?member_no="+member_no+"','view_info','width=400,height=510,toolbar=no,scrollbars=yes');><td style=font-family:±¼¸²;font-size:9pt height=18 nowrap>&nbsp;<img src=images/n_memo.gif border=0 align=absmiddle>&nbsp;&nbsp;ÂÊÁö º¸³»±â&nbsp;&nbsp;</td></tr>";
				printHeight = printHeight + 16;
			}
			printMain = printMain +	"<tr onMouseOver=this.style.backgroundColor='#bbbbbb' onMouseOut=this.style.backgroundColor='' onMousedown=window.open('view_info2.php?member_no="+member_no+"','view_info','width=400,height=510,toolbar=no,scrollbars=yes');><td style=font-family:±¼¸²;font-size:9pt height=18 nowrap>&nbsp;<img src=images/n_information.gif border=0 align=absmiddle>&nbsp;&nbsp;È¸¿øÁ¤º¸ º¸±â&nbsp;&nbsp;</td></tr>";
			printHeight = printHeight + 16;
		}
		if(writer) {
			printMain = printMain +	"<tr onMouseOver=this.style.backgroundColor='#bbbbbb' onMouseOut=this.style.backgroundColor='' onMousedown=location.href='zboard.php?id="+boardID+"&sn1=on&sn=on&ss=off&sc=off&keyword="+writer+"';><td style=font-family:±¼¸²;font-size:9pt height=18 nowrap>&nbsp;<img src=images/n_search.gif border=0 align=absmiddle>&nbsp;&nbsp;ÀÌ¸§À¸·Î °Ë»ö&nbsp;&nbsp;</td></tr>";
			printHeight = printHeight + 16;
		}
		if(writer) {
			printMain = printMain +	"<tr onMouseOver=this.style.backgroundColor='#bbbbbb' onMouseOut=this.style.backgroundColor='' onMousedown=location.href='/search_bbs.php?sn=on&ss=off&sc=off&keyword="+writer+"';><td style=font-family:±¼¸²;font-size:9pt height=18 nowrap>&nbsp;<img src=images/n_search.gif border=0 align=absmiddle>&nbsp;&nbsp;ÀüÃ¼°Ô½Ã±Û °Ë»ö&nbsp;&nbsp;</td></tr>";
			printHeight = printHeight + 16;
		}
		if(writer) {
			printMain = printMain +	"<tr onMouseOver=this.style.backgroundColor='#bbbbbb' onMouseOut=this.style.backgroundColor='' onMousedown=location.href='/search_comment.php?sn=on&sc=off&keyword="+writer+"';><td style=font-family:±¼¸²;font-size:9pt height=18 nowrap>&nbsp;<img src=images/n_search.gif border=0 align=absmiddle>&nbsp;&nbsp;ÀüÃ¼ÄÚ¸àÆ® °Ë»ö&nbsp;&nbsp;</td></tr>";
			printHeight = printHeight + 16;
		}
		if(isLevel){
			printMain = printMain +	"<tr onMouseOver=this.style.backgroundColor='#bbbbbb' onMouseOut=this.style.backgroundColor='' onMousedown=window.open('/zboard/ppomppu_tell.php?member_no="+member_no+"&name="+writer+"&id="+boardID+"&no="+iNo+"','view_info','width=450,height=250,toolbar=no,scrollbars=yes');><td style=font-family:±¼¸²;font-size:9pt height=18 nowrap>&nbsp;<img src=images/n_search.gif border=0 align=absmiddle>&nbsp;&nbsp;<b>±îÄ¥,µµ¹è ½Å°í</b>&nbsp;&nbsp;</td></tr>";
			printHeight = printHeight + 16;
		}
		if(isAdmin) {
			if(member_no) {
				printMain = printMain +	"<tr onMouseOver=this.style.backgroundColor='#bbbbbb' onMouseOut=this.style.backgroundColor='' onMousedown=window.open('open_window.php?mode=i&str="+member_no+"','ZBremote','width=1,height=1,left=1,top=1');><td style=font-family:±¼¸²;font-size:9pt height=18 nowrap>&nbsp;<img src=images/n_modify.gif border=0 align=absmiddle>&nbsp;&nbsp;<font color=darkred>È¸¿øÁ¤º¸ º¯°æ&nbsp;&nbsp;</td></tr>";
				printHeight = printHeight + 16;
			}
			printMain = printMain +	"<tr onMouseOver=this.style.backgroundColor='#bbbbbb' onMouseOut=this.style.backgroundColor='' onMousedown=window.open('open_window.php?mode="+traceType+"&str="+traceID+"','ZBremote','width=1,height=1,left=1,top=1');><td style=font-family:±¼¸²;font-size:9pt height=18 nowrap>&nbsp;<img src=images/n_relationlist.gif border=0 align=absmiddle>&nbsp;&nbsp;<font color=darkred>°ü·Ã±Û ÃßÀû</font>&nbsp;&nbsp;</td></tr>";
			printHeight = printHeight + 16;
		
		}
	
		var layer_body = "<table border=0 width=100%><tr><td colspan=3 height=10></td></tr><tr><td width=5></td><td bgcolor=222222 style='cursor:hand'><table border=0 cellspacing=0 cellpadding=3 width=100% height=100% bgcolor=#FFFFFF>"+printMain+"</table></td><td width=10></td></tr><tr><td colspan=3 height=10></td></tr></table>";
		obj.innerHTML = layer_body;
		obj.style.width = 150;
		obj.style.height = printHeight;
		obj.style.visibility='visible';
	}


	function zb_init_layer(layername)
	{
		document.writeln("<div id="+layername+" style='position:absolute; left:1px; top:1px; width:1px; height:1px; z-index:1; visibility: hidden' onmousedown=\"zb_layer_action('"+layername+"', 'hidden')\" onmouseout=\"zb_layer_action('"+layername+"', 'hidden')\" onmouseover=\"zb_layer_action('"+layername+"', 'visible')\">");
		document.writeln("</div>");
	}
	
	zb_init_layer('zb_layer_div');
