if(js_subGO!='chat') js_subGO="mypage";
var sexcolor_arr = new Array('fcsubman','fcsubwoman','fcsubfriend');
var buddy_menu_show=false;
document.write("<div id='inlineDiv' style='z-index:10000;position:absolute;width:85px;border:0px solid #0395E1;visibility:hidden;display:none'>"
+"<table width='83' border='0' cellspacing='0' cellpadding='0'>"
+"  <tr><td colspan='5'><img src='"+js_img+"/common/b_top.gif' width='89' height='11'></td></tr>"
+"  <tr onmouseover=\"this.cells(2).style.backgroundColor='#F1F1F1'\" onmouseout=\"this.cells(2).style.backgroundColor='#FFFFFF'\" style='cursor:hand'><td width='1' rowspan='15' bgcolor='#3c3c3c'></td><td width='3' rowspan='15' bgcolor='#f1f1f1'></td><td width='81' height='19' bgcolor='#ffffff'  class='fcsub'>&nbsp;<img src='"+js_img+"/common/ico/ico_borrow.gif' width='13' height='12' align='absmiddle'><a style='cursor:hand;' onFocus='blur()'>&nbsp;ÀÔÀº¿Ê±¸¸Å</a></td><td width='3' rowspan='15' bgcolor='#f1f1f1'></td><td width='1' rowspan='15' bgcolor='#3c3c3c'></td></tr>"
+"  <tr><td width='81' height='3' bgcolor='#f1f1f1'></td></tr>"
+"  <tr onmouseover=\"this.cells(0).style.backgroundColor='#F1F1F1'\" onmouseout=\"this.cells(0).style.backgroundColor='#FFFFFF'\" style='cursor:hand'><td width='81' height='19' bgcolor='#ffffff'  class='fcsub'>&nbsp;<img src='"+js_img+"/common/ico/ico_miniprofile.gif' width='12' height='11' align='absmiddle'><a style='cursor:hand;' onFocus='blur()'>&nbsp;¹Ì´ÏÇÁ·ÎÇÊ </a></td> </tr>   "
+"  <tr><td width='81' height='3' bgcolor='#f1f1f1'></td></tr>"
+"  <tr onmouseover=\"this.cells(0).style.backgroundColor='#F1F1F1'\" onmouseout=\"this.cells(0).style.backgroundColor='#FFFFFF'\" style='cursor:hand'><td width='81' height='19' bgcolor='#ffffff'  class='fcsub'>&nbsp;<img src='"+js_img+"/common/ico/ico_11.gif' width='12' height='13' align='absmiddle'><a style='cursor:hand;' onFocus='blur()'>&nbsp;1:1 ½ÅÃ»</a></td></tr>"
+"  <tr><td width='81' height='3' bgcolor='#f1f1f1'></td></tr>"
+"  <tr onmouseover=\"this.cells(0).style.backgroundColor='#F1F1F1'\" onmouseout=\"this.cells(0).style.backgroundColor='#FFFFFF'\" style='cursor:hand'><td width='81' height='19' bgcolor='#ffffff'  class='fcsub'>&nbsp;<img src='"+js_img+"/common/ico/ico_msg.gif' width='12' height='12' align='absmiddle'><a style='cursor:hand;' onFocus='blur()'>&nbsp;ÂÊÁöº¸³»±â</a></td></tr>"
+"  <tr><td width='81' height='3' bgcolor='#f1f1f1'></td></tr>"
+"  <tr onmouseover=\"this.cells(0).style.backgroundColor='#F1F1F1'\" onmouseout=\"this.cells(0).style.backgroundColor='#FFFFFF'\" style='cursor:hand'><td width='81' height='19' bgcolor='#ffffff'  class='fcsub'>&nbsp;<img src='"+js_img+"/common/ico/ico_send_cards.gif' width='12' height='11' align='absmiddle'><a style='cursor:hand;' onFocus='blur()'>&nbsp;¸íÇÔº¸³»±â</a></td></tr>"
+"  <tr><td width='81' height='3' bgcolor='#f1f1f1'></td></tr>"
+"  <tr onmouseover=\"this.cells(0).style.backgroundColor='#F1F1F1'\" onmouseout=\"this.cells(0).style.backgroundColor='#FFFFFF'\" style='cursor:hand'><td width='81' height='19' bgcolor='#ffffff'  class='fcsub'>&nbsp;<img src='"+js_img+"/common/ico/ico_left_1.gif' width='13' height='12' align='absmiddle'><a style='cursor:hand;' onFocus='blur()'>&nbsp;Ä£±¸Ãß°¡</a></td></tr>"
+"  <tr><td width='81' height='3' bgcolor='#f1f1f1'></td></tr>"
+"  <tr onmouseover=\"this.cells(0).style.backgroundColor='#F1F1F1'\" onmouseout=\"this.cells(0).style.backgroundColor='#FFFFFF'\" style='cursor:hand'><td width='81' height='19' bgcolor='#ffffff'  class='fcsub'>&nbsp;<img src='"+js_img+"/common/ico/ico_left_3.gif' width='13' height='12' align='absmiddle'><a style='cursor:hand;' onFocus='blur()'>&nbsp;Ä£±¸Á¦¿Ü</a></td></tr>"
+"  <tr><td width='81' height='3' bgcolor='#f1f1f1'></td></tr>"
+"  <tr onmouseover=\"this.cells(0).style.backgroundColor='#F1F1F1'\" onmouseout=\"this.cells(0).style.backgroundColor='#FFFFFF'\" style='cursor:hand'><td width='81' height='19' bgcolor='#ffffff'  class='fcsub'>&nbsp;<img src='"+js_img+"/common/ico/ico_left_4.gif' width='13' height='12' align='absmiddle'><a style='cursor:hand;' onFocus='blur()'>&nbsp;Ä£±¸Á¤º¸</a></td></tr>"
+"  <tr><td colspan='5'><img src='"+js_img+"/common/b_bottom.gif' width='89' height='11'></td></tr>"
+"</table></div>");
function buddy_menu_onshow(m_id, sex, isFriend, alias)
{
	if(!getCookie('setN') || !m_id) return; 
	if(getCookie('setN') == m_id) return;
	// ¾Æ·¡ ¼¼ÁÙ ±è±¤ÈÆ Ãß°¡
	if(getCookie('setKIND') == 'G'){
		if(js_GO.substring(0,8) != 'game|ham') return;
	}
	
	if ( m_id == 4197647 || m_id == 4197659 || m_id == 38 || m_id == 40 || m_id == 41 || m_id == 44 || m_id == 45 || m_id == 4979817 || m_id == 4979822 || m_id == 4252175 || m_id == 4251547 || m_id == 5178773 || m_id == 5178775 || m_id == 5178781 || m_id == 5178786)
		return;

	

	if (!(isFriend=="y" || isFriend =="true")){
		try{

		//	alert("Ä£±¸¾Æ´Ò¶§");

			if (document.all["inlineDiv"]) {
				var tempmenuDiv;
				if (!document.all["inlineDiv"].length) tempmenuDiv=document.all["inlineDiv"];
				else tempmenuDiv=document.all["inlineDiv"][0];
				if (tempmenuDiv.all(0).tagName == "TABLE")
					tempmenuDiv.all(0).rows(9).style.display="none";tempmenuDiv.all(0).rows(10).style.display="none";
					tempmenuDiv.all(0).rows(11).style.display="block";tempmenuDiv.all(0).rows(12).style.display="block";
					tempmenuDiv.all(0).rows(13).style.display="none";tempmenuDiv.all(0).rows(14).style.display="none";
					tempmenuDiv.all(0).rows(15).style.display="block";tempmenuDiv.all(0).rows(16).style.display="block";
			}
		}catch(e){}
	}else{
		try{

			//alert("Ä£±¸ÀÏ¶§");
			if (document.all["inlineDiv"]) {
				var tempmenuDiv;
				if (!document.all["inlineDiv"].length) tempmenuDiv=document.all["inlineDiv"];
				else tempmenuDiv=document.all["inlineDiv"][0];
				if (tempmenuDiv.all(0).tagName == "TABLE")
					tempmenuDiv.all(0).rows(9).style.display="block";tempmenuDiv.all(0).rows(10).style.display="block";
					tempmenuDiv.all(0).rows(11).style.display="none";tempmenuDiv.all(0).rows(12).style.display="none";
				//	tempmenuDiv.all(0).rows(13).style.display="none";tempmenuDiv.all(0).rows(14).style.display="none";
			}
		}catch(e){}
	
	}
	
	var openertype = 1;

	if (isFriend=="miniprofile")
	{
			tempmenuDiv.all(0).rows(3).style.display="none";tempmenuDiv.all(0).rows(3).style.display="none";
			openertype  = 0;  //¹Ì´ÏÇÁ·ÎÇÊÀÏ¶§´Â Go°ªÀÌ³ª To °ª¿¡ ¿µÇâÀ» ¹ÞÀ¸¸é ¾ÈµÈ´Ù. EtcArr[2] --> $setVar[4]À¸·Î ³Ñ¾î°¨..
	}

		try{
	if (ChatRoomType=="SINGLE"){
					tempmenuDiv.all(0).rows(3).style.display="none";
					tempmenuDiv.all(0).rows(4).style.display="none";
	}
		}catch(e){}

	if (!document.all["inlineDiv"]) return;
	var menuDiv, nickname;
	if (!document.all["inlineDiv"].length) menuDiv=document.all["inlineDiv"];
	else menuDiv=document.all["inlineDiv"][0];
	nickname=event.srcElement.innerText;	 //´Ð³×ÀÓ
	nickname=escape(nickname);
	if(alias){alias=escape(alias);}
	buddy_menu_show=true;

	menuDiv.all(0).rows(1).onclick=
		new Function("buyitem('"+m_id+"','"+nickname+"','"+ openertype + "');buddy_menu_hide();");
	menuDiv.all(0).rows(3).onclick=
		new Function("mini_profile('"+m_id+"');buddy_menu_hide();");
	menuDiv.all(0).rows(5).onclick=
		new Function("singlechat_request_window_open('"+m_id+"','"+nickname+"','"+sex+"');buddy_menu_hide();");
	menuDiv.all(0).rows(7).onclick=
		new Function("send_message('"+m_id+"','"+nickname+"','"+sex+"');buddy_menu_hide();");
	menuDiv.all(0).rows(9).onclick=
		new Function("send_vcard('"+m_id+"','"+nickname+"');buddy_menu_hide();");
	menuDiv.all(0).rows(11).onclick=
		new Function("buddy_add('"+m_id+"','"+nickname+"','"+sex+"');buddy_menu_hide();");
	menuDiv.all(0).rows(13).onclick=
		new Function("buddy_del('"+m_id+"','n','','"+nickname+"','"+sex+"','"+alias+"');buddy_menu_hide();");
	menuDiv.all(0).rows(15).onclick=
		new Function("buddy_view('"+m_id+"');buddy_menu_hide();");
		
	menuDiv.style.top=event.clientY+document.body.scrollTop-3+"px";
	menuDiv.style.left=event.clientX+document.body.scrollLeft+10;
	menuDiv.style.visibility="visible";
	menuDiv.style.display="";
	if ((parseInt(menuDiv.style.top) + menuDiv.offsetHeight) > (document.body.clientHeight+document.body.scrollTop))
		menuDiv.style.top=parseInt(menuDiv.style.top)-(menuDiv.offsetHeight-6);
	if ((parseInt(menuDiv.style.left) + menuDiv.offsetWidth) > (document.body.clientWidth+document.body.scrollLeft))
		menuDiv.style.left=parseInt(menuDiv.style.left)-(menuDiv.offsetWidth+20);
	menuDiv.onmouseout=new Function("buddy_menu_show=false;");
	menuDiv.onmouseover=new Function("buddy_menu_show=true;");
	document.onclick=buddy_menu_hide_check;
	document.body.onresize=buddy_menu_hide;
}
function buddy_menu_hide()
{
	if (!document.all["inlineDiv"]) return;
	var menuDiv;
	if (!document.all["inlineDiv"].length) menuDiv=document.all["inlineDiv"];
	else menuDiv=document.all["inlineDiv"][0];
	menuDiv.style.visibility="hidden";
	menuDiv.style.display="none";
}
function buddy_menu_hide_check()
{
	if (!buddy_menu_show) buddy_menu_hide();
}
function send_message(m_id, nickname, sex)
{
	nickname=unescape(nickname);
	if(!nickname) nickname="";
	if(!sex) sex="";
	//any_open("/POP/chat/message_send.php?GO="+js_GO+"&m_id="+m_id+"&m_nickname="+nickname+"&md_sex="+sex,385,230);
	window.showModalDialog("/POP/chat/message_send.php?GO="+js_GO+"&m_id="+m_id+"&m_nickname="+nickname+"&md_sex="+sex, window, 'dialogHeight:260px; unadorned:yes; dialogWidth:385px; help:no; resizable:no; status:no; scroll=no;');
}
function mini_profile(m_id)
{
	miniprofileView(m_id);
//	sweetchat_alert('¹Ì´ÏÇÁ·ÎÇÊÀº ¸®´º¾ó ÀÛ¾÷ÁßÀÔ´Ï´Ù.','1000');
	//any_open2("/mini/?mini=prf&m_id="+m_id,630,520);
}
function singlechat_request_window_open(m_id, nickname, sex)
{

	nickname=unescape(nickname);
//	any_open("/POP/chat/singlechat_request.php?GO="+js_GO+"&m_id="+m_id+"&m_nickname="+nickname+"&md_sex="+sex,385,270);
	window.showModalDialog("/POP/chat/singlechat_request.php?GO="+js_GO+"|ham"+"&m_id="+m_id+"&m_nickname="+nickname+"&md_sex="+sex, window, 'dialogHeight:297px; unadorned:yes; dialogWidth:385px; help:no; resizable:no; status:no; scroll=no;');
}
function send_vcard(m_id, nickname)
{
	nickname=unescape(nickname);
	any_open("/POP/chat/vcard_send.php?GO="+js_GO+"&m_id="+m_id+"&NickTo="+nickname,385,328);
//	window.showModalDialog("/POP/chat/vcard_send.php?GO="+js_GO+"&m_id="+m_id+"&NickTo="+nickname, window, 'dialogHeight:355px; unadorned:yes; dialogWidth:385px; help:no; resizable:no; status:no; scroll=no;');
}
function buddy_add(m_id, nickname, sex)
{
	nickname=unescape(nickname);
	any_open("/POP/chat/add_friend_select_group.php?GO="+js_GO+"&m_id="+m_id+"&m_nickname="+nickname+"&md_sex="+sex,385,270);
//	window.showModalDialog("/POP/chat/add_friend_select_group.php?m_id="+m_id+"&m_nickname="+nickname+"&md_sex="+sex, window, 'dialogHeight:300px; unadorned:yes; dialogWidth:385px; help:no; resizable:no; status:no; scroll=no;');

}


// 05/04/15 ÀÌ½ÅÈñ Ãß°¡
function buyitem(m_id, nickname, openertype)
{
	nickname=unescape(nickname);
	if (openertype=='1')
	{
		any_open("/POP/shop/item_purchase.php?GO="+ js_GO+"&TO="+js_TO+"&ETC="+m_id+"@"+ nickname +"|FB_BUY2|"+ openertype,385,270);   
	}
	else
	{
		any_open("/POP/shop/item_purchase.php?GO=shop&TO="+js_TO+"&ETC="+m_id+"@"+ nickname +"|FB_BUY2|"+ openertype,385,270);   // GO°ªÀ» js_GO·Î ÇÏÁö ¾Ê°í ¹«Á¶°Ç shopÀ¸·Î
	}
}




function buddy_del(Rosters,buddy,buddt_opt,nickname,sex,alias)
{
	var name;
	((sex=="m")? sex=0: sex=1);
//	if(alias){sex=2;}
	if(nickname) name = "<span class='+sexcolor_arr[sex]+'>"+unescape(nickname)+"</span>";
//	if(alias) name = "<span class='+sexcolor_arr[sex]+'>"+unescape(alias)+"</span>";
	MSG = "<b><span class="+sexcolor_arr[sex]+">"+unescape(nickname) +"</span></b>´ÔÀ» Ä£±¸¿¡¼­ Á¦¿Ü ÇÏ½Ã°Ú½À´Ï±î?";
	if(!candy_confirm(MSG,js_subGO)) return;
	Rosters = Rosters+"\t"+buddy+"\t"+buddt_opt+"\n";
	if (Rosters) {
		if(parent){
		parent.FriendDeleteUser(Rosters);
		}else{
		FriendDeleteUser(Rosters);
		}
	}
}
function buddy_view(roster_m_id)
{
//	any_open("/POP/mypage/friend_modify_2.php?GO="+js_GO+"&roster_m_id="+roster_m_id,385,270,0,'Alias_win');
	window.showModalDialog('/POP/mypage/friend_modify_2.php?GO='+js_GO+'&roster_m_id='+roster_m_id, window, 'dialogHeight:272px; unadorned:yes; dialogWidth:395px; help:no; resizable:no; status:no; scroll=no;');
}
function alias_add(m_id, nickname, alias)
{
	nickname=unescape(nickname);	
	alias=unescape(alias);	
	any_open("/POP/chat/add_alias.php?GO="+js_GO+"&m_id="+m_id+"&m_nickname="+nickname+"&md_alias="+alias,385,270);
//	window.showModalDialog("/POP/chat/add_alias.php?GO=chat&m_id="+m_id+"&m_nickname="+nickname+"&md_alias="+alias, window, 'dialogHeight:297px; unadorned:yes; dialogWidth:385px; help:no; resizable:no; status:no; scroll=no;');
}
