//------------------------------------------------------
// personalmenu.js = ÀÏ¹Ý = hidden_proc
// personalmenu_window.js = À©µµ¿ì = hidden_window_proc
//------------------------------------------------------

//parent.document.onmousedown = hideMenu;

if (location.href.indexOf(".okcashbag.com") > -1) {
	var SERVICE = "okcashbag";
	var GAME_ROOT = "nategame.okcashbag.com";
	var CARD_ROOT = "card.nategame.okcashbag.com";
	var AVATAR_ROOT = "avatar.nategame.okcashbag.com";
} else {
	var SERVICE = "nate";
	var GAME_ROOT = "game.nate.com";
	var CARD_ROOT = "card.game.nate.com";
	var AVATAR_ROOT = "avatar.game.nate.com";
}

var menuOn = false;
var overMenu = false;
var menuInfo = {
	
	//MenuWidth: MenuWidth = 140,
	//MenuHeight: MenuHeight = 170,
	
	FontSize: FontSize = "9pt",
	FontColor: FontColor = "black",

	BgColor: BgColor = "#DCEDF3",
	FontColorBar: FontColor = "#f3f3f3",
	BgColorBar: BgColor = "#6795df",
	FontColorOver: FontColor = "white",
	BgColorOver: BgColor = "#6795df",
	BorderColor: BorderColor = "#c0c0c0",

	MenuItem: MenuItem = [
		[ "prshow", "ÇÁ·ÎÇÊº¸±â" ],
		[ "showava", "Âø¿ëÀÇ»óº¸±â" ],
		[ "zzim", "Âò¸®½ºÆ®º¸±â" ]
		//[ "blacklist", "ºí·¢¸®½ºÆ®Ãß°¡" ]
		//[ "sendmemo", "ÂÊÁöº¸³»±â" ],
		//[ "datechat", "1:1 ´ëÈ­" ],		
		//[ "addbuddy", "Ä£±¸·Î Ãß°¡" ],
		//[ "manner", "¸Å³ÊÆò°¡ÇÏ±â" ]

	]
};
var menuInfo2 = {
	
	//MenuWidth: MenuWidth = 140,
	//MenuHeight: MenuHeight = 170,
	
	FontSize: FontSize = "9pt",
	FontColor: FontColor = "black",

	BgColor: BgColor = "#DCEDF3",
	FontColorBar: FontColor = "#f3f3f3",
	BgColorBar: BgColor = "#6795df",
	FontColorOver: FontColor = "white",
	BgColorOver: BgColor = "#6795df",
	BorderColor: BorderColor = "#c0c0c0",

	MenuItem: MenuItem = [
		[ "changeface", "Ç¥Á¤¹Ù²Ù±â ¢º" ],
		[ "prshow", "³»ÇÁ·ÎÇÊ" ],
		[ "changeavatar", "³»¿ÊÀå" ],
		[ "nowfortune", "¿À´ÃÀÇ¿î¼¼" ],
		[ "nowevent", "¿À´ÃÀÇÀÌº¥Æ®" ]
	]
};	
		/**
		[ "goscore", "³»°ÔÀÓÀüÀû" ],
		[ "goavatar", "¾Æ¹ÙÅ¸²Ù¹Ì±â" ],
		[ "changeavatar", "¿Ê°¥¾ÆÀÔ±â" ],
		[ "goalbum", "ÄÚµð¾Ù¹ü" ],		
		[ "goitem", "³»¾ÆÀÌÅÛ" ],**/

var submenuInfo = {
	

	MenuItem: MenuItem = [
		[ "face0", "±âº»Ç¥Á¤" ],
		[ "face1", "¿ô´ÂÇ¥Á¤" ],
		[ "face2", "¿ì´ÂÇ¥Á¤" ],
		[ "face3", "È­³­Ç¥Á¤" ],
		[ "face4", "È²´çÇÑÇ¥Á¤" ]
		/**[ "face5", "À®Å©ÇÏ±â" ],
		[ "face6", "³î¶õÇ¥Á¤" ],
		[ "face7", "¸Þ·ÕÇÏ±â" ]**/

		
	]
};	

var basicInfo = {
	send_sn : send_sn = "",
	send_id : send_id = "",
	send_nick : send_nick = "",
	receive_sn : receive_sn = "",
	receive_id : receive_id = "",
	receive_nick : receive_nick = ""
	
};

var srcAvatar="" ;


initial();

//·¹ÀÌ¾î ÃÊ±âÈ­ ÀÔ´Ï´Ù.height:"+menuInfo.MenuHeight+"px;
function initial() {
	var sHTML;
	sHTML = "<div id=\"userMenu\" style=\"position: absolute; left: 0px; top: 0px; z-index=5; visibility: hidden\" onMouseOver=\"_menuOver(this)\" onMouseOut=\"_menuOut(this)\"></div>"
	sHTML += "<div id=\"userMenu2\"  style=\"position: absolute; left: 0px; top: 0px; width: 100px;z-index=5; border: 1px solid #999999; visibility: hidden\" onMouseOver=\"submenuOver(this)\" onMouseOut=\"_menuOut(this)\"></div>"
	//sHTML = "<div id=\"userMenu\" style=\"position: absolute; left: 140px; top: 130px; width: 120px;z-index=5;  border: 1px solid #999999; visibility: hidden\" onMouseOver=\"_menuOver(this)\" onMouseOut=\"_menuOut(this)\"></div>"
	//sHTML += "<div id=\"userMenu2\"  style=\"position: absolute; left: 140px; top: 130px; width: 100px;z-index=5;  border: 1px solid #999999; visibility: hidden\" onMouseOver=\"submenuOver(this)\" onMouseOut=\"_menuOut(this)\"></div>"
	
	document.write(sHTML);
}
var origin_mousedown;
function pmClose(){
		document.all.userMenu.innerHTML="";
		document.all.userMenu2.innerHTML="";
}

function pmenu(send_sn,send_id,send_nick,receive_sn,receive_id,receive_nick,borderColor,bgColor,fgColor,onBgColor,onFgColor,spanid) {
	var oMenu = document.all.userMenu;
	srcAvatar=spanid;
	//oMenu.style.border =""+ borderColor +" 1px solid";
	menuInfo2.BgColor = bgColor;
	menuInfo2.FontColor = fgColor;
	menuInfo2.FontColorOver=onFgColor;
	menuInfo2.BgColorOver=onBgColor;
	menuInfo2.BorderColor=borderColor;

	basicInfo.send_sn = send_sn;	
	basicInfo.send_id = send_id;
	basicInfo.send_nick=send_nick;
	basicInfo.receive_sn = receive_sn;	
	basicInfo.receive_id = receive_id;
	basicInfo.receive_nick=receive_nick;
	var sHTML;
	var left;
	var top;
	var height;
	sHTML="";

	onBgColor ="#336699";
	onFgColor ="#FFFFFF";
	bgColor ="#EEEEEE";
	fgColor = "#000000";

	left = document.body.scrollLeft+event.x -20;
	top = document.body.scrollTop+event.y -20;

	sHTML ="<table border=0 cellpadding=0 cellspacing=1 width=120 align=center>";
	sHTML+="<tr><td align=center bgcolor=\""+borderColor+"\">";
	sHTML+="	<table border=0 cellpadding=0 cellspacing=1 width=120 align=center>";
	sHTML+="	<tr><td bcolor=#FFFFFF>";
	sHTML+="		<table width=\"120\" cellspacing=\"0\" cellpadding=\"1\" bgcolor=\""+bgColor+"\"  onMouseOver=\"chBgImg();\" onMouseOut=\"chBgImg2();\">";
	sHTML+="		<tr >";
	sHTML+="			<td  style=\"padding-left: 5; color : "+fgColor+"\"  width=\"120\"  align=center>";
	sHTML+=				"<b>"+send_id+"</b>";
	sHTML+="			</td>";
	sHTML+="		</tr>";
	sHTML+="		<tr >";
	sHTML+="			<td height=1 bgcolor='"+borderColor+"'>";
	sHTML+="			</td>";
	sHTML+="		</tr>";
	for (var i = 0; i < menuInfo2.MenuItem.length; i++) {
		sHTML+="		<tr>";
		sHTML+="			<td  style=\"padding-left: 5; color : "+fgColor+"\"  width=\"120\"  onMouseOver=\"this.style.background = '"+onBgColor+"'; this.style.color = '"+onFgColor+"'; this.style.cursor = 'hand';\" onMouseOut=\"this.style.background = '"+bgColor+"'; this.style.color = '"+fgColor+"';\" onClick=\"menuAction('"+menuInfo2.MenuItem[i][0]+"')\">";
		sHTML+=				menuInfo2.MenuItem[i][1];
		sHTML+="			</td>";
		sHTML+="		</tr>";
	}	
	sHTML+="		</table>";
	sHTML+="	</td></tr>";
	sHTML+="	</table>";
	sHTML+="	</td>";
	sHTML+="</tr>";
	sHTML+="</table>";
	hHTML ="<table border=0 cellpadding=0 cellspacing=0 width=145>";
	hHTML+="<tr><td colspan=4 height=3 onMouseOver=hideMenu();></td></tr>";
	hHTML+="<tr><td colspan=4 height=12></td></tr>";
	hHTML+="<tr><td width=3 onMouseOver=hideMenu();></td>";
	hHTML+="	<td width=1></td>";
	hHTML+="	<td align=center width=*> " + sHTML + "</td>";
	hHTML+="	<td width=5 onMouseOver=hideMenu();></td></tr>";
	hHTML+="<tr><td colspan=4 height=3 onMouseOver=hideMenu();></td></tr>";
	hHTML+="</table>";

	oMenu.innerHTML = hHTML;
	oMenu.style.left = left;
	oMenu.style.top = top;
	oMenu.style.visibility = "visible";
	menuOn=true;
	origin_mousedown=document.onmousedown;
	document.onmousedown = pageClick;
}

function pmenu2(send_sn,send_id,send_nick,receive_sn,receive_id,receive_nick,borderColor,bgColor,fgColor,onBgColor,onFgColor,spanid) {
	var oMenu = document.all.userMenu;
	srcAvatar=spanid;
	//oMenu.style.border =""+ borderColor +" 1px solid";
	menuInfo2.BgColor = bgColor;
	menuInfo2.FontColor = fgColor;
	menuInfo2.FontColorOver=onFgColor;
	menuInfo2.BgColorOver=onBgColor;
	menuInfo2.BorderColor=borderColor;

	basicInfo.send_sn = send_sn;	
	basicInfo.send_id = send_id;
	basicInfo.send_nick=send_nick;
	basicInfo.receive_sn = receive_sn;	
	basicInfo.receive_id = receive_id;
	basicInfo.receive_nick=receive_nick;
	var sHTML;
	var left;
	var top;
	var height;
	sHTML="";

	//onBgColor ="#336699";
	//onFgColor ="#FFFFFF";
	//bgColor ="#EEEEEE";
	//fgColor = "#000000";
		
	//left = event.x + document.body.scrollLeft  ;
	//top = event.y + document.body.scrollTop ;
	left = 0  ;
	top = 0 ;
	sHTML ="<table border=0 cellpadding=0 cellspacing=1 width=120 align=center>";
	sHTML+="<tr><td align=center bgcolor=\""+borderColor+"\">";
	sHTML+="	<table border=0 cellpadding=0 cellspacing=1 width=120 align=center>";
	sHTML+="	<tr><td bcolor=#FFFFFF>";
	sHTML+="		<table width=\"120\" cellspacing=\"0\" cellpadding=\"1\" bgcolor=\""+bgColor+"\"  onMouseOver=\"chBgImg();\" onMouseOut=\"chBgImg2();\">";
	sHTML+="		<tr >";
	sHTML+="			<td  style=\"padding-left: 5; color : "+fgColor+"\"  width=\"120\"  align=center>";
	sHTML+=				"<b>"+send_id+"</b>";
	sHTML+="			</td>";
	sHTML+="		</tr>";
	sHTML+="		<tr >";
	sHTML+="			<td height=1 bgcolor='"+borderColor+"'>";
	sHTML+="			</td>";
	sHTML+="		</tr>";
	for (var i = 0; i < menuInfo2.MenuItem.length; i++) {
		sHTML+="		<tr>";
		sHTML+="			<td  style=\"padding-left: 5; color : "+fgColor+"\"  width=\"120\"  onMouseOver=\"this.style.background = '"+onBgColor+"'; this.style.color = '"+onFgColor+"'; this.style.cursor = 'hand';\" onMouseOut=\"this.style.background = '"+bgColor+"'; this.style.color = '"+fgColor+"';\" onClick=\"menuAction('"+menuInfo2.MenuItem[i][0]+"')\">";
		sHTML+=				menuInfo2.MenuItem[i][1];
		sHTML+="			</td>";
		sHTML+="		</tr>";
	}	
	sHTML+="		</table>";
	sHTML+="	</td></tr>";
	sHTML+="	</table>";
	sHTML+="	</td>";
	sHTML+="</tr>";
	sHTML+="</table>";
	hHTML ="<table border=0 cellpadding=0 cellspacing=0 width=145>";
	hHTML+="<tr><td colspan=4 height=3 onMouseOver=hideMenu();></td></tr>";
	hHTML+="<tr><td colspan=4 height=12></td></tr>";
	hHTML+="<tr><td width=3 onMouseOver=hideMenu();></td>";
	hHTML+="	<td width=17></td>";
	hHTML+="	<td align=center width=*> " + sHTML + "</td>";
	hHTML+="	<td width=5 onMouseOver=hideMenu();></td></tr>";
	hHTML+="<tr><td colspan=4 height=3 onMouseOver=hideMenu();></td></tr>";
	hHTML+="</table>";

	oMenu.innerHTML = hHTML;
	oMenu.style.left = left;
	oMenu.style.top = top;
	oMenu.style.visibility = "visible";
	menuOn=true;
	origin_mousedown=document.onmousedown;
	document.onmousedown = pageClick;
}

function pmenu_v410(send_sn,send_id,send_nick,receive_sn,receive_id,receive_nick,borderColor,bgColor,fgColor,onBgColor,onFgColor,spanid) {
	var oMenu = document.all.userMenu;
	srcAvatar=spanid;
	//oMenu.style.border =""+ borderColor +" 1px solid";
	menuInfo2.BgColor = bgColor;
	menuInfo2.FontColor = fgColor;
	menuInfo2.FontColorOver=onFgColor;
	menuInfo2.BgColorOver=onBgColor;
	menuInfo2.BorderColor=borderColor;

	basicInfo.send_sn = send_sn;	
	basicInfo.send_id = send_id;
	basicInfo.send_nick=send_nick;
	basicInfo.receive_sn = receive_sn;	
	basicInfo.receive_id = receive_id;
	basicInfo.receive_nick=receive_nick;
	var sHTML;
	var left;
	var top;
	var height;
	sHTML="";
	//left = 0  ;
	//top = 0 ;

	//top = get_objectTop(document.all['avaImg']) -4;
	//left = get_objectLeft(document.all['avaImg']) -4;
	left = event.x + document.body.scrollLeft -10 ;
	top = event.y + document.body.scrollTop -10;

	sHTML = "<table width=95 border=0 cellpadding=9 cellspacing=0>";
	sHTML += "	<tr><td style=\"border:#cccbcb solid 1px\" bgcolor=\"#ffffff\">";
	sHTML += "		<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>";
	sHTML += "			<tr><td class=\"gy_7373_s\"><img src=\"http://img.nate.com/game/img/main/body/i_arrow01.gif\" width=\"2\" height=\"3\" vspace=\"3\" style=\"margin:0 7 0 0\"><a href=\"javascript:changeFace(0); hideMenu();\" hidefocus>±âº»Ç¥Á¤</a></td></tr>";
	sHTML += "			<tr><td class=\"gy_7373_s\"><img src=\"http://img.nate.com/game/img/main/body/i_arrow01.gif\" width=\"2\" height=\"3\" vspace=\"3\" style=\"margin:0 7 0 0\"><a href=\"javascript:changeFace(1); hideMenu();\" hidefocus>¿ô´ÂÇ¥Á¤</a></td></tr>";
	sHTML += "			<tr><td class=\"gy_7373_s\"><img src=\"http://img.nate.com/game/img/main/body/i_arrow01.gif\" width=\"2\" height=\"3\" vspace=\"3\" style=\"margin:0 7 0 0\"><a href=\"javascript:changeFace(2); hideMenu();\" hidefocus>¿ì´ÂÇ¥Á¤</a></td></tr>";
	sHTML += "			<tr><td class=\"gy_7373_s\"><img src=\"http://img.nate.com/game/img/main/body/i_arrow01.gif\" width=\"2\" height=\"3\" vspace=\"3\" style=\"margin:0 7 0 0\"><a href=\"javascript:changeFace(3); hideMenu();\" hidefocus>È­³­Ç¥Á¤</a></td></tr>";
	sHTML += "			<tr><td class=\"gy_7373_s\"><img src=\"http://img.nate.com/game/img/main/body/i_arrow01.gif\" width=\"2\" height=\"3\" vspace=\"3\" style=\"margin:0 7 0 0\"><a href=\"javascript:changeFace(4); hideMenu();\" hidefocus>È²´çÇÑÇ¥Á¤</a></td></tr>";
	sHTML += "			<tr><td height=\"3\"></td></tr>";
	sHTML += "			<tr><td height=\"1\" bgcolor=\"#b8d4eb\"></td></tr>";
	sHTML += "			<tr><td height=\"3\"></td></tr>";
	sHTML += "			<tr><td class=\"gy_7373_s\"><img src=\"http://img.nate.com/game/img/main/body/i_arrow01.gif\" width=\"2\" height=\"3\" vspace=\"3\" style=\"margin:0 7 0 0\"><a href=\"javascript:;\" onClick=\"menuAction('changeavatar'); hideMenu(); return false;\" hidefocus>³»  ¿ÊÀå</a></td></tr>";
	if (SERVICE == "nate") {
		sHTML += "			<tr><td height=\"3\"></td></tr>";
		sHTML += "			<tr><td height=\"1\" bgcolor=\"#b8d4eb\"></td></tr>";
		sHTML += "			<tr><td height=\"3\"></td></tr>";
		sHTML += "			<tr><td class=\"gy_7373_s\"><img src=\"http://img.nate.com/game/img/main/body/i_arrow01.gif\" width=\"2\" height=\"3\" vspace=\"3\" style=\"margin:0 7 0 0\"><a href=\"javascript:;\" onClick=\"menuAction('mycash'); hideMenu(); return false;\" hidefocus>³»  °èÁÂ</a></td></tr>";
		sHTML += "			<tr><td class=\"gy_7373_s\"><img src=\"http://img.nate.com/game/img/main/body/i_arrow01.gif\" width=\"2\" height=\"3\" vspace=\"3\" style=\"margin:0 7 0 0\"><a href=\"javascript:;\" onClick=\"menuAction('chargecash'); hideMenu(); return false;\" hidefocus>Ä³½¬ ÃæÀü</a></td></tr>";
	}
	sHTML += "		</table></td>";
	sHTML += "	</tr>";
	sHTML += "</table>";
	
	hHTML ="<table border=0 cellpadding=0 cellspacing=0>";
	hHTML+="	<tr><td colspan=5 height=3 onMouseOut=hideMenu();></td></tr>";
	hHTML+="	<tr><td colspan=5 height=1></td></tr>";

	hHTML+="	<tr>";
	hHTML+="	<td width=3 onMouseOut=hideMenu();></td>";
	hHTML+="	<td width=1></td>";
	hHTML+="	<td align=center width=*> " + sHTML + "</td>";
	hHTML+="	<td width=19></td>";
	hHTML+="	<td width=3 onMouseOut=hideMenu();></td>";
	hHTML+="	</tr>";

	hHTML+="	<tr><td colspan=5 height=1></td></tr>";
	hHTML+="	<tr><td colspan=5 height=2 onMouseOut=hideMenu();></td></tr>";
	hHTML+="</table>";



	oMenu.innerHTML = hHTML;
	oMenu.style.left = left;
	oMenu.style.top = top;
	oMenu.style.visibility = "visible";
	menuOn=true;
	origin_mousedown=document.onmousedown;
	document.onmousedown = pageClick;
}

function get_objectTop(obj){
	if (obj.offsetParent == document.body) return obj.offsetTop;
	else return obj.offsetTop + get_objectTop(obj.offsetParent);
}

function get_objectLeft(obj){
	if (obj.offsetParent == document.body) return obj.offsetLeft;
	else return obj.offsetLeft + get_objectLeft(obj.offsetParent);
}


function chBgImg() {
	var bImg = document.all['bImgDiv1'];
	bImg.style.visibility = 'visible'; 
}

function chBgImg2() {
	var bImg = document.all['bImgDiv1'];
	bImg.style.visibility = 'hidden'; 
}

function submenu(send_sn,send_id,send_nick,receive_sn,receive_id,receive_nick,borderColor,bgColor,fgColor,onBgColor,onFgColor,El) {
	var oMenu = document.all.userMenu2;
	oMenu.style.border =""+ borderColor +" 1px solid";
	basicInfo.send_sn = send_sn;	
	basicInfo.send_id = send_id;
	basicInfo.send_nick=send_nick;
	basicInfo.receive_sn = receive_sn;	
	basicInfo.receive_id = receive_id;
	basicInfo.receive_nick=receive_nick;
	var sHTML;
	var left;
	var top;
	var height;
	sHTML="";

	//onBgColor ="#336699";
	//onFgColor ="#FFFFFF";
	//bgColor ="#EEEEEE";
	//fgColor = "#000000";
		
	//left = event.x + document.body.scrollLeft  ;
	//top = event.y + document.body.scrollTop	;
	top = document.body.clientTop + _get_objectTop(document.all.userMenu) + 37;
	left = document.body.clientLeft + _get_objectLeft(document.all.userMenu) + 100;
	//left = 100;
	//top = 40;
	//top = event.y + document.body.scrollTop - 55 ;
	
	sHTML="<table width=\"100\" cellspacing=\"0\" cellpadding=\"1\" bgcolor=\""+bgColor+"\"  >";
	for (var i = 0; i < submenuInfo.MenuItem.length; i++) {
		sHTML+="		<tr >";
		sHTML+="			<td  style=\"padding-left: 5; color : "+fgColor+"\"  width=\"100\"  onMouseOver=\"this.style.background = '"+onBgColor+"'; this.style.color = '"+onFgColor+"'; this.style.cursor = 'hand';\" onMouseOut=\"this.style.background = '"+bgColor+"'; this.style.color = '"+fgColor+"';\" onClick=\"menuAction('"+submenuInfo.MenuItem[i][0]+"')\">";
		sHTML+=				submenuInfo.MenuItem[i][1];
		sHTML+="			</td>";
		sHTML+="		</tr>";

	}	
	sHTML+="	</table>";
	
	
	oMenu.style.left = left;
	oMenu.style.top = top;
	oMenu.style.visibility = "visible";
	oMenu.innerHTML = sHTML;
	menuOn=true;
	//origin_mousedown=document.onmousedown;
	//document.onmousedown = pageClick;
	
}
function _get_objectTop(obj){
	if (obj.offsetParent == document.body) return obj.offsetTop;
	else return obj.offsetTop + _get_objectTop(obj.offsetParent);
}

function _get_objectLeft(obj){
	if (obj.offsetParent == document.body) return obj.offsetLeft;
	else return obj.offsetLeft + _get_objectLeft(obj.offsetParent);
}
function hideMenu() {
	menuOn = false;
	document.all.userMenu.style.visibility = "hidden";
	hideSubMenu();
	document.onmousedown = origin_mousedown;
}
function hideSubMenu() {
	document.all.userMenu2.style.visibility = "hidden";

}
function _menuOver() {
	menuOn = true;
	overMenu = true;
	if(document.all.userMenu2.style.visibility = "visible"){
		hideSubMenu();	
	}
	
	;

}
function submenuOver() {
	menuOn = true;
	overMenu = true;

}
function _menuOut() {
	if (event.srcElement.contains(event.toElement))	return;
	overMenu = false;
}

function itemOver(objItem) {
	objItem.style.color = menuInfo.FontColorOver;
	objItem.style.background = menuInfo.BgColorOver;
}

function itemOut(objItem) {
	objItem.style.color = menuInfo.FontColor;
	objItem.style.background = menuInfo.BgColor;
}

function pageClick() {
	if (menuOn == true && overMenu == false) {
		hideMenu();
	}
}
function isMy(my_sn,to_sn){
	if (my_sn==to_sn){
		alert("º»ÀÎÀº ¼±ÅÃÇÒ¼ö ¾ø½À´Ï´Ù.");
		return true;
	} else if(basicInfo.receive_nick=="¿î¿µÀÚ") {
		alert("¿î¿µÀÚ´Â ¼±ÅÃÇÒ¼ö ¾ø½À´Ï´Ù.");
		return true;		
	} else {
		return false;	
	}
		
}
function menuAction(strAction) {
	if ((strAction!="") && (strAction!="changeface") )	{
		hideMenu();
	}
	var today = new Date();
	var t=today.getTime();   
	if (basicInfo.send_sn==""){
		alert("·Î±×ÀÎÈÄ ÀÌ¿ëÇÏ¼¼¿ä.");
		return;
	}
	switch (strAction) {
		case "prshow": 
			
				window.open('http://'+GAME_ROOT+'/r/in_ava/u='+GAME_ROOT+'/myinfo/profile.html?id='+basicInfo.receive_id,'myinfo_profile','width=500,height=514,scrollbars=no,top=10,left=10');
				//window.open("/lovetrain/popup/mypr.asp?memberId="+detailinfo.TargetId,"myprsend","width=516,height=600,scrollbars");		
				break;
		case "sendmemo": 
				if (isMy(basicInfo.send_sn,basicInfo.receive_sn)) return;
				window.open('http://chatting.empas.com/messagebox/answer.jsp?send_sn='+basicInfo.send_sn+'&send_id='+basicInfo.send_id+'&send_nick='+basicInfo.send_nick+'&receive_sn='+basicInfo.receive_sn+'&receive_id='+basicInfo.receive_id+'&receive_nick='+basicInfo.receive_nick,'','width=450,height=264');
				//window.open("/lovetrain/popup/memosend.asp?memberId="+detailinfo.TargetId+"&memberName="+detailinfo.extra,"d"+(new Date()).getTime(),"width=420,height=320,toolbar=no,directories=no,status=no,scrollbars=no,resize=no,menubar=no");
				break;
		case "datechat":  
		
				//window.open("/lovetrain/chat/datechat/index.asp?type=make&to_id="+detailinfo.TargetId+"&to_alias="+detailinfo.extra,"d"+(new Date()).getTime(),"width=650,height=500,toolbar=no,directories=no,status=no,scrollbars=no,resize=no,menubar=no");
				if (isMy(basicInfo.send_sn,basicInfo.receive_sn)) return;
			 
			
				dateHostList=["app1.chatting.empas.com","app2.chatting.empas.com","app3.chatting.empas.com"];
				var dateHost=dateHostList[(new Date()).getTime()%dateHostList.length];
			
				window.open("http://chatting.empas.com/invite_user.jsp?svr_location="+dateHost+"&to_sn="+basicInfo.receive_sn+"&to_user_id="+basicInfo.receive_id+"&to_alias="+basicInfo.receive_nick,"","width=300,height=200,toolbar=no,directories=no,status=no,scrollbars=no,resizable=yes,menubar=no");
				break;
		case "addlove": 
				//hiddenFrame.location.href="/lovetrain/popup/regLoveList.asp?memberType=B&memberId="+detailinfo.TargetId;
				break; 
		case "blacklist": 
				if (isMy(basicInfo.send_sn,basicInfo.receive_sn)) return;
			
				var ret = confirm("Á¤¸»·Î ºí·¢¸®½ºÆ®·Î µî·ÏÇÏ½Ã°Ú½À´Ï±î");
				if(ret){
					window.open('http://chatting.empas.com/myfriends/makefriends.jsp?isClose=Y&send_sn='+basicInfo.send_sn+'&send_id='+basicInfo.send_id+'&send_nick='+basicInfo.send_nick+'&friend_sn='+basicInfo.receive_sn+'&user_id='+basicInfo.receive_id+'&receive_nick='+basicInfo.receive_nick,'','width=355,height=250');
				}	
				break;
		case "addbuddy": 
				if (isMy(basicInfo.send_sn,basicInfo.receive_sn)) return;
			
				window.open('http://chatting.empas.com/myfriends/makefriends.jsp?isFriend=Y&isClose=Y&send_sn='+basicInfo.send_sn+'&send_id='+basicInfo.send_id+'&send_nick='+basicInfo.send_nick+'&friend_sn='+basicInfo.receive_sn+'&user_id='+basicInfo.receive_id+'&receive_nick='+basicInfo.receive_nick,'','width=355,height=250');
				break; 
		case "sendmail": 
				//window.open("/lovetrain/popup/sendmail.asp?memberId="+detailinfo.TargetId,"myprsend","width=516,height=500,scrollbars");
				break;
		case "callpolice":
				//document.location.href="mailto:hancafe@hancafe.com";			    
				break;
		case "manner":
				if (isMy(basicInfo.send_sn,basicInfo.receive_sn)) return;
			
				window.open('http://chatting.empas.com/manner/manner.jsp?to_sn='+basicInfo.receive_sn,'','width=400,height=300');
				break;
		case "goscore":
				//location.href="http://game.nate.com/info/info-gamerecord.html";
				window.open('http://'+GAME_ROOT+'/r/in_ava/u='+GAME_ROOT+'/myinfo/myinfo_gamescore.html','_parent');
				break;
		case "goitem":
				//location.href="http://game.nate.com/info/info-gameitem.html";
				window.open('http://'+GAME_ROOT+'/r/in_ava/u='+GAME_ROOT+'/myinfo/myinfo_item.html','_parent');
				break;
		case "goalbum":
				//location.href="http://game.nate.com/info/info-coordialbum.html";
				window.open('http://'+GAME_ROOT+'/r/in_ava/u='+GAME_ROOT+'/myinfo/myinfo_coordialbum.html','_parent');
				break;
		case "changeavatar":
				//location.href="http://game.nate.com/info/info-wardrobe.html";
				window.open('http://'+GAME_ROOT+'/r/in_ava/u='+GAME_ROOT+'/myinfo/myinfo_clothes.html','_blank');
				break;	
		case "goavatar":
				//location.href="http://avatar.game.nate.com/home/";
				window.open('http://'+GAME_ROOT+'/r/in_ava/u='+AVATAR_ROOT+'/','_parent');
				break;
		case "zzim":
				window.open('http://'+GAME_ROOT+'/r/in_ava/u='+GAME_ROOT+'/userinfo-zzim.html?usersn='+basicInfo.receive_sn,'WNotice','width=494,height=514,scrollbars=no,top=10,left=10');
				break;	
		case "showava":
				if (location.href.indexOf("empas") > -1) {
					window.open('http://'+GAME_ROOT+'/r/in_ava/u=avatar.game.nate.com/transaction/transaction.cgi?command=buy_cody&usrsn='+basicInfo.receive_sn,'','width=435,height=493');
				} else {
					window.open('http://'+GAME_ROOT+'/r/in_ava/u=avatar.game.nate.com/newtrans/transaction.cgi?command=buy_cody&usrsn='+basicInfo.receive_sn,'','width=435,height=493');
				}
				break;	
		case "changeface":
				submenu(basicInfo.send_sn,basicInfo.send_id,basicInfo.send_nick,basicInfo.receive_sn,basicInfo.receive_id,basicInfo.receive_nick,menuInfo2.BorderColor,menuInfo2.BgColor,menuInfo2.FontColor,menuInfo2.BgColorOver,menuInfo2.FontColorOver,this);
				//alert(strAction);
				break;		
		case "face0":
				//setAvatarCookie(change_face(get_avatar_info(basicInfo.send_sn),"0",srcAvatar));
				changeFace(0);
				break;	
		case "face1":
				//setAvatarCookie(change_face(get_avatar_info(basicInfo.send_sn),"1",srcAvatar));
				changeFace(1);
				break;	
		case "face2":
				//setAvatarCookie(change_face(get_avatar_info(basicInfo.send_sn),"2",srcAvatar));
				changeFace(2);
				break;	
		case "face3":
				//setAvatarCookie(change_face(get_avatar_info(basicInfo.send_sn),"3",srcAvatar));
				changeFace(3);
				break;	
		case "face4":
				//setAvatarCookie(change_face(get_avatar_info(basicInfo.send_sn),"4",srcAvatar));
				changeFace(4);
				break;	
		case "face5":
				//setAvatarCookie(change_face(get_avatar_info(basicInfo.send_sn),"5",srcAvatar));
				changeFace(5);
				break;	
		case "face6":
				//setAvatarCookie(change_face(get_avatar_info(basicInfo.send_sn),"6",srcAvatar));
				changeFace(6);
				break;	
		case "face7":
				//alert(get_avatar_info(basicInfo.send_sn));
				
				//setAvatarCookie(change_face(get_avatar_info(basicInfo.send_sn),"7",srcAvatar));
				//alert(get_avatar_info(basicInfo.send_sn));
				//alert(change_face(get_avatar_info(basicInfo.send_sn),"7",srcAvatar));
				changeFace(7);
				break;	
		case "nowfortune":
				window.open('http://'+GAME_ROOT+'/r/in_ava/u=rd.empas.com/red_unse.html','_parent');
				break;
		case "nowevent":
				window.open('http://'+GAME_ROOT+'/r/in_ava/u='+GAME_ROOT+'/event/event-main.html ','_parent');
				break;
		case "mycash":
				if (location.href.indexOf("empas") > -1) {
					window.open('http://'+GAME_ROOT+'/r/in_ava/u=cash.game.nate.com/myaccount.php ','_blank');
				} else {
					window.open('http://'+GAME_ROOT+'/r/in_ava/u=bill.nate.com/WebApp/Main/MainFrame.jsp','_blank');
				}
				break;
		case "chargecash":
				if (location.href.indexOf("empas") > -1) {
					ChargeCash('HPD');
				} else {
					chargeCash_nate();
				}
				break;
	}
}

function changeFace(idx) {
	//Ç¥º¡Àº 0~4,±âÅ¸ 7±îÁö Á¸Àç
	if(idx > 8) return false;

	if (document.getElementById('avatar')) {
		var op = default_head.split(":");
		var sp = op[0].split("-");
		default_head=sp[0]+"-"+idx+":0:0";
		if (items[Z_HEAD]) items[Z_HEAD]=default_head;
		if (default_items[Z_HEAD]) default_items[Z_HEAD]=default_head;
		avatar.innerHTML=draw_avatar(items);

		document.changeFace.location.href='http://'+GAME_ROOT+"/r/in_ava/u="+AVATAR_ROOT+"/com/change_face.cgi?" + idx + "/L";
	} else {
		var ava_img = eval(document.all['avaImg']);

		//Ç¥Á¤ÀÌ¹ÌÁö¸¦ ºÒ·¯¿Â´Ù.
		var face_img = new Image; 
		//var RandId = Math.round(Math.random() * 10000);
		ava_img.src = 'http://'+GAME_ROOT+"/r/in_ava/u="+AVATAR_ROOT+"/com/change_face.cgi?" + idx; 
	}
}
