var ie = (/MSIE/.test(navigator.userAgent));

var select_obj;
function ZB_layerAction(name,status,event) 
{ 
	var obj = document.getElementById(name);

    if(window.event) var src = window.event.srcElement;
    else var src = event.target;

	var el = src;
	var p  = { x: el.offsetLeft, y: el.offsetTop };

	while (el.offsetParent)	
    {
		el = el.offsetParent;
		p.x += el.offsetLeft;
		p.y += el.offsetTop;
		if (el != document.body && el != document.documentElement) 
        {
			p.x -= el.scrollLeft;
			p.y -= el.scrollTop;
		}
	}

	obj.style.left = p.x - 9 + 'px';
	obj.style.top  = p.y - 6 + 'px';

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

	obj.style.visibility=status; 
}


function print_ZBlayer(name, homepage, mail, member_no, boardID, writer, traceID, traceType, isAdmin, isMember) {
	var printHeight = 0;
	var printMain='';

	if(homepage) {
		printMain = "<tr onMouseOver=\"this.style.backgroundColor='#bbbbbb'\" onMouseOut=\"this.style.backgroundColor=''\" onMousedown=\"window.open('"+homepage+"')\"><td style=\"color:#101010;font-family:굴림;font-size:9pt\" height=\"18px\" nowrap>&nbsp;<img src=\"images/n_homepage.gif\" border=\"0\" align=\"absmiddle\">&nbsp;&nbsp;홈페이지&nbsp;&nbsp;</td></tr>";
		printHeight = printHeight + 16;
	}
	
	if(mail) {
		printMain = printMain +	"<tr onMouseOver=\"this.style.backgroundColor='#bbbbbb'\" onMouseOut=\"this.style.backgroundColor=''\"  onMousedown=\"window.open('open_window.php?mode=m&str="+mail+"','ZBremote','width=1,height=1,left=1,top=1')\"><td style=\"color:#101010;font-family:굴림;font-size:9pt\" height=\"18px\" 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=\"color:#101010;font-family:굴림;font-size:9pt\" height=\"18px\" 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=\"color:#101010;font-family:굴림;font-size:9pt\" height=\"18px\" 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=\"color:#101010;font-family:굴림;font-size:9pt\" height=\"18px\" nowrap>&nbsp;<img src=\"images/n_search.gif\" border=\"0\" align=\"absmiddle\">&nbsp;&nbsp;이름으로 검색&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=\"color:#101010;font-family:굴림;font-size:9pt\" height=\"18px\" nowrap>&nbsp;<img src=\"images/n_modify.gif\" border=\"0\" align=\"absmiddle\">&nbsp;&nbsp;<font color=\"red\">회원정보 변경</font>&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=\"color:#101010;font-family:굴림;font-size:9pt\" height=\"18px\" nowrap>&nbsp;<img src=\"images/n_relationlist.gif\" border=\"0\" align=\"absmiddle\">&nbsp;&nbsp;<font color=\"red\">관련글 추적</font>&nbsp;&nbsp;</td></tr>";
		printHeight = printHeight + 16;
	
	}

	printMain = printMain +	"<tr onMouseOver=\"this.style.backgroundColor='#bbbbbb'\" onMouseOut=\"this.style.backgroundColor=''\"  onMousedown=\"location.href='zboard.php?id=gallery&sn=off&ss=off&sc=off&su=on&keyword="+member_no+"'\"><td style=\"color:#101010;font-family:굴림;font-size:9pt\" height=\"18px\" nowrap>&nbsp;<img src=\"images/n_search.gif\" border=\"0\" align=\"absmiddle\">&nbsp;&nbsp;회원갤러리 검색&nbsp;&nbsp;</td></tr>";
	printHeight = printHeight + 16;

	var printHeader = "<div id='"+name+"' style='position:absolute; left:10px; top:25px; width:127px; height: "+printHeight+"px; z-index:1;visibility:hidden' onMousedown=\"ZB_layerAction('"+name+"','hidden',event)\" align=\"left\"><table border=0><tr><td colspan=3 onMouseover=\"ZB_layerAction('"+name+"','hidden',event)\" height=\"3px\"></td></tr><tr><td width=\"5px\" onMouseover=\"ZB_layerAction('"+name+"','hidden',event)\" rowspan=\"2\">&nbsp;</td><td height=5></td></tr><tr><td><table style=\"cursor: pointer;\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"black\" width=\"100%\" height=\"100%\"><tr><td valign=\"top\" bgcolor=\"white\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"3\" width=\"100%\" height=\"100%\">";
	var printFooter = "</table></td></tr></table></td><td width=\"5px\" rowspan=\"2\" onMouseover=\"ZB_layerAction('"+name+"','hidden',event)\">&nbsp;</td></tr><tr><td colspan=\"3\" height=\"10px\" onMouseover=\"ZB_layerAction('"+name+"','hidden',event)\"></td></tr></table></div>";

	document.writeln(printHeader+printMain+printFooter);
}

