document.write("<div id='div_userInfo' style='position:absolute;width:118px;background-color:#fff1d7;border:0 solid #b39a18;z-index:1;visibility:hidden'></div>");

function linkUserInfo(userID, nickname,cust_mng_num,pMenu)
{
	if(pMenu == "") pMenu = "user_context";

	tmpuser2=userID.substring(userID.lastIndexOf("@"));

	if(tmpuser2==null)
		tmpuser=userID+'@nate.com';
	else
		tmpuser=userID;


	objUserInfo = new UserInfo(tmpuser, nickname,cust_mng_num,pMenu);
	objUserInfo.viewMenu();
}

function hide_userMenu(userID)
{
	objUserInfo.hideMenu();
	objUserInfo = null;
}


// »ç¿ëÀÚ Á¤º¸ Å¬·¡½º
function UserInfo(userID, nickname, cust_mng_num, pMenu)
{
	if(pMenu == "") pMenu = "user_context";

	this.pMenu = pMenu;
	this.userID = userID;
	this.nickname = nickname;
	this.cust_mng_num = cust_mng_num;

	this.strMenu = "";
	this.pX = posX;
	this.pY = posY;
	this.viewMenu = viewMenu;
	this.hideMenu = hideMenu;
	this.setDiv = setDiv;

	this.div_info = document.all.div_userInfo;
	function setDiv()	{
		this.div_info.innerHTML = strMenu;
//		this.div_info.style.left = posX + 5;
//		this.div_info.style.top = posY + 5;
		this.div_info.style.left = posX - 330;
		this.div_info.style.top = posY - 142;
		
		//alert("#"+this.div_info.style.left+","+this.div_info.style.top+"#");
		
	}

	function viewMenu()	{

		var is_wap = false;
		var tmpspeed=userID.substring(0,3);

		if( tmpspeed=="011" || tmpspeed =="017")
			is_wap = true;

		var view_nick = this.nickname;
		if(view_nick.length > 10)
		{
			if(view_nick.indexOf("@") > -1)
				view_nick = view_nick.substring(0, view_nick.indexOf("@")+1);
			if(view_nick.length > 10)
				view_nick = view_nick.substring(0, 10);
			view_nick += "..";
		}

		//	»ç¿ëÀÚ ÀÌ¸§
		strMenu = "<table width='135' height='20' border='0' cellpadding='0' cellspacing='0' style='background:#78B2E0; border:1px solid #2F6B9D;padding-top:2px;'>"
			+ "<tr>"
			+ "	<td width='120' class='black'> &nbsp; &nbsp;"+view_nick+"</td>"
			+ "	<td width='15' valign='center'>"
			+ "		<a href=\"javascript:hide_userMenu('"+this.cust_mng_num+"');\"><img src='http://nateonweb.nate.com/client/profile4.0/images/x.gif' width=11 height=11 border=0></a> \n"
//			+ "		<a href=\"javascript:hide_userMenu('"+this.cust_mng_num+"');\"><img src='http://nateonweb.nate.com/client/profile2/images/x.gif' width=11 height=11 border=0></a> \n"
			+ "	</td>"
			+ "</tr>"
			+ "</table> \n";

		if( !is_wap )
		{
			strMenu += "<table width='135' border='0' cellpadding='0' cellspacing='0' style='background:#D8EDFF; border:1px solid #2F6B9D;padding-top:2px;'>"
				+ "<tr>"
				+ "	<td width=135 height='20' class='black'>"
				+ "		&nbsp; &nbsp;<a href=\"javascript:sendProfile('"+this.userID+"', '"+this.cust_mng_num+"');hide_userMenu('"+this.userID+"');\"><font class='black'>ÇÁ·ÎÇÊ º¸±â</font></a>"
				+ "	</td>"
				+ "</tr>";
/*
			strMenu += "<tr>"
				+ "	<td width=135 height='20' class='black'>"
				+ "		&nbsp; &nbsp;<a href=\"javascript:sendMail('"+this.userID+"');hide_userMenu('"+this.userID+"');\"><font class='black'>¸ÞÀÏ º¸³»±â</font></a>"
				+ "	</td>"
				+ "</tr>";
			strMenu += "<tr>"
				+ "	<td width=135 height='20' class='black'>"
				+ "		&nbsp; &nbsp;<a href=\"javascript:sendMemo('"+this.userID+"');hide_userMenu('"+this.userID+"');\"><font class='black'>¸Þ¸ð º¸³»±â</font></a>"
				+ "	</td>"
				+ "</tr>";
			strMenu += "<tr>"
				+ "	<td width=135 height='20' class='black'>"
				+ "		&nbsp; &nbsp;<a href=\"javascript:sendSMS('"+this.userID+"', '" + cust_mng_num + "', '');hide_userMenu('"+this.userID+"');\"><font class='black'>¹®ÀÚ¸Þ½ÃÁö º¸³»±â</font></a>"
				+ "	</td>"
				+ "</tr>";
*/
			strMenu += "<tr>"
				+ "	<td width=135 height='20' class='black'>"
				+ "		&nbsp; &nbsp;<a href=\"javascript:sendFriend('"+this.userID+"','"+this.pMenu+"');hide_userMenu('"+this.userID+"');\"><font class='black'>Ä£±¸¿äÃ»ÇÏ±â</font></a>"
				+ "	</td>"
				+ "</tr>";

			strMenu += "</table>";

			this.setDiv();
			this.div_info.style.visibility = "visible";
			
			//	createpopupÀ¸·Î »ý¼ºÇØº¸±â
			/*
			var popupBody = oPopup.document.body;
			popupBody.innerHTML = strMenu;
			var realHeight = popupBody.scrollHeight;
			var realWidth = popupBody.scrollWidth;
			oPopup.show(posX + 5, posY + 5, realWidth, realHeight, popupBody);
			*/
		}
	}
	function hideMenu()	{
		this.userID = null;
		this.nickname = null;
		this.strMenu = "";
		this.div_info.style.visibility = "hidden";
	}
}
