function _GnxUserMenu()
{			
	var myEvent;
	this.setEvent = function( evt )
	{
		this.myEvent = evt;		
	}
		
	this.Show = function( oidUser, strLocalID, maskGameCode_VirtualUser, strVirtualUserName, maskGameCode_Group, oidUser_Group, oidRealUser_Group, strServerName, strVirtualUserName_My )
	{
		this.oidUser = oidUser;
		this.strLocalID = "";
		this.maskGameCode_VirtualUser = +maskGameCode_VirtualUser;
		this.strVirtualUserName = strVirtualUserName;
		this.maskGameCode_Group = maskGameCode_Group;
		this.oidUser_Group = oidUser_Group;
		this.strServerName = strServerName;
		this.oidRealUser_Group = oidRealUser_Group;		
		
		this.IsMyGuild = function()
		{
			var strGuildKey = GuildActiveX.oidRealUser_Group;
			if ( !GuildActiveX.isInstall() ) return false;
				
			var isMyGuild = false;
			if ( this.IsLogin() )
			{
				var oidUser = getCookies( 'NXCHOID' );
				GuildCommunicator.Guild.Monitor( strGuildKey );
				
				var guild_info = GuildCommunicator.Guild.GetOnlineInfo( strGuildKey );
				if ( guild_info != null )
				{
					var members = _Col2Array( guild_info.aOnlineGuildMembers );
					for( var i in members )
					{						
						if( members[i].GetOID() == oidUser )
						{
							isMyGuild = true;
							break;
						}
					}
				}
			}
			return isMyGuild;
		}
		
		this.IsOnline = function()
		{
			var strGuildKey = GuildActiveX.oidRealUser_Group;	
			var isOnLine = false;			
			GuildCommunicator.Guild.Monitor( strGuildKey );
			var guild_info = GuildCommunicator.Guild.GetOnlineInfo( strGuildKey );
			
			if ( guild_info != null )
			{				
				var members = _Col2Array( guild_info.aOnlineGuildMembers );
				for( var i in members )
				{					
					if( members[i].GetOID() == this.oidUser )
					{
						isOnLine = true;
						break;
					}
				}
			}
			return isOnLine;
		}
		
		this.IsLogin = function()
		{
			return ( getCookies( "IL" ) == "1" ) ? 1 : 0;	
		}
		
		this.GetMainGameCode = function( maskGameCode )
		{	
			if ( maskGameCode >> 16 == 0xd ) {
				return GnxGameCode.maskGameCode_Zera;
			}
			else if( maskGameCode >> 16 == 0x10 )
				return GnxGameCode.maskGameCode_Lunia;
			else if( this.maskGameCode_Group == 268435471 )
				return 73739;
			else
				return maskGameCode;
		}
		
		this.SetMenu_GuildUser = function()
		{
			var strMenu = "±æµå¿øÁ¤º¸º¸±â";
			
			if( this.IsLogin() )
			{
				var strLink = "";
				if( this.IsMyGuild() )									
					strLink = "window.open( \"../../Guild/Page/Gnx.aspx?URL=popup/guild_profile&maskGameCode_User=" + GnxGameCode.maskGameCode_NX + "&oidUser_User=" + this.oidUser + "&maskGameCode_Group=" + this.maskGameCode_Group + "&oidUser_Group=" + this.oidUser_Group + "&maskGameCode=" + this.maskGameCode_VirtualUser + "&strNameInGroup=" + strVirtualUserName +"\", \"GuildUserInfo\", \"width=390, height=430 scrollbars=0,location=0,status=no,resizable=0,menubar=0,titlebar=0,toolbar=0\")";				
				else
					strLink = "alert( \"±æµå¿ø Á¤º¸´Â ¼Ò¼Ó ±æµå¿ø¸¸ º¼ ¼ö ÀÖ½À´Ï´Ù.\" );";				
				NxQuickMenu.addItem( strMenu, strLink );
			}
			else
			{
				NxQuickMenu.addText( strMenu, "none" );
			}
		}
		
		this.SetMenu_NxUser = function( strMenu )
		{			
			var strLink = "NgbMember.OpenUserProfile( " +this.oidUser +" );";
			NxQuickMenu.addItem( strMenu, strLink );
		}
		
		this.SetMenu_KartUser = function( strMenu )
		{				
			var strLink = "window.open( \"http://kart.nexon.com/camp/Page/GnxPop.aspx?URL=GameProfile/GarageHome&oidUser=" + this.oidUser + "&strRiderID=" + this.strVirtualUserName + "&maskGameCode_Group=" + this.maskGameCode_Group + "&oidUser_Group=" + this.oidUser_Group +"\", \"KartUserInfo\", \"width=665, height=490, scrollbars=yes,location=0,status=no,resizable=0,menubar=0,titlebar=0,toolbar=0\")";
			NxQuickMenu.addItem( strMenu, strLink );
		}
		
		this.SetMenu_WarrockUser = function( strMenu )
		{		
			var strLink = "window.open( \"http://warrock.nexon.com/warrock2/Page/Gnx2.aspx?URL=Gampy/GampyGatePage&strNickName=" + escape(this.strVirtualUserName) +"\", \"Gampy\", \"width=750,height=600,toolbar=no,status=no,directories=no,scrollbars=no,location=no,resizable=no,menubar=no\")";
			NxQuickMenu.addItem( strMenu, strLink );
		}
		
		this.SetMenu_ZeraUser = function( strMenu )
		{		
			//var strLink = "window.open( \"http://zera.nexon.com/zera2/page/Gnx.aspx?URL=Profile/Main&strCharacterID=" + this.strVirtualUserName+ this.strVirtualUserName + "&maskGameCode=" + this.maskGameCode_VirtualUser +"\", \"ZeraUserInfo\", \"width=750,height=550,toolbar=no,status=no,directories=no,scrollbars=no,location=no,resizable=no,menubar=no\")";
			var strLink = "window.open( \"http://zera.nexon.com/zera2/page/gnxwebcontrolweb.aspx?URL=webcontrol/profile_web&Name=" + this.strVirtualUserName + "&Server=" + this.maskGameCode_VirtualUser +"\", \"ZeraUserInfo\", \"width=750,height=550,toolbar=no,status=no,directories=no,scrollbars=no,location=no,resizable=no,menubar=no\")";
			NxQuickMenu.addItem( strMenu, strLink );
		}
		
		this.SetMenu_LuniaUser = function( strMenu )
		{			
			var n1GameCode = 0;						
			if( maskGameCode_VirtualUser == 1048577 )
				n1GameCode = 0;
			else
				n1GameCode = 1;
			strLink = "window.open( \"http://lunia.nexon.com/etc/plug/character_info.asp?GameServer=" +n1GameCode +"&CharacterName=" +escape(this.strVirtualUserName) +"\", \"LuniaUserInfo\", \"width=400,height=425,toolbar=no,status=no,directories=no,scrollbars=no,location=no,resizable=no,menubar=no\")";	 			
			NxQuickMenu.addItem( strMenu, strLink );
		}
		
		
		this.SetMenu_CSOUser = function( strMenu )
		{
			var strLink = "window.open( \"http://csonline.nexon.com/CSO/Page/Gnx.aspx?Url=Popup/pop_MemberInfo&oidUser=" + this.oidUser +"\", \"CsoUserInfo\", \"width=240,height=280,toolbar=no,status=no,directories=no,scrollbars=no,location=no,resizable=no,copyhistory=no\")";
			NxQuickMenu.addItem( strMenu, strLink );
		}
		
		this.SetMenu_BFUser = function( strMenu )
		{
			var strLink = "window.open( \"http://bf.nexon.com/main/page/nx_pop.aspx?url=home/CharacterView&oidUser=" + this.oidUser +"\", \"BFUserInfo\", \"width=400,height=310,toolbar=no,status=no,directories=no,scrollbars=no,location=no,resizable=no,copyhistory=no\")";
			NxQuickMenu.addItem( strMenu, strLink );
		}
		
		this.SetMenu_HeroesUser = function( strMenu )
		{
			var strLink = "window.open( \"http://heroes.nexon.com/Common/Achievement/CharacterInfo.aspx?ServerCode=" + maskGameCode_VirtualUser +"&nxOid=" + this.oidUser + "&GameID=" + escape(this.strVirtualUserName) + "\", \"HeroesUserInfo\", \"toolbars=0,menubars=0,status=0,directories=no,scrollbars=no,location=no,resizable=no,copyhistory=no,width=800,height=345,top=0,left=0\")";
			NxQuickMenu.addItem( strMenu, strLink );
		}
		
		
		this.SetMenu_UserInfo= function()
		{
			var strMenu = "È¸¿øÁ¤º¸º¸±â";			
				
			if( this.maskGameCode_Group == 268435458 )
			{			
				this.SetMenu_KartUser( strMenu );
			}
			else if( this.maskGameCode_Group == 268435459 )
			{			
				this.SetMenu_WarrockUser( strMenu );
			}	
			else if( this.maskGameCode_VirtualUser >> 16 == 0xd )
			{
				this.SetMenu_ZeraUser( strMenu );
			}
			else if( this.maskGameCode_Group == 268435467 )
			{
				this.SetMenu_CSOUser ( strMenu );
			}
			else if( this.maskGameCode_Group == 268435470 )
			{
				this.SetMenu_BFUser ( strMenu );
			}
			else if( this.maskGameCode_Group == 268435471 )
			{				
				this.SetMenu_HeroesUser ( strMenu );
			}
			else 
			{
				this.SetMenu_NxUser( strMenu );
			}			
		}
		
		this.SetMenu_Note = function()
		{
			var strMenu = "ÂÊÁöº¸³»±â";
			
			if( this.IsLogin() )
			{				
				var maskGameCode_VirtualUser_local = 0;
				var strUserName_Messenger = "";		
				
				if ( this.maskGameCode_VirtualUser >> 16 == 0xd )
					maskGameCode_VirtualUser_local = 74242;
				else
					maskGameCode_VirtualUser_local = this.GetMainGameCode( this.maskGameCode_VirtualUser );
			
				if ( this.strServerName != "" )
					strUserName_Messenger = "[" + this.strServerName + "]";
				strUserName_Messenger += this.strVirtualUserName;
	  	
				var strLink = "window.open( \"http://message.nexon.com/Nxcom/Page/Gnx.aspx?URL=message/memo_send&oidUser=" + this.oidUser + "&strVirtualUserName=" +strUserName_Messenger +"&maskGameCode=" +maskGameCode_VirtualUser_local +"\", \"SendNote\", \"width=380,height=300,scrollbars=0,location=0,status=no,resizable=0,menubar=0,titlebar=0,toolbar=0\" )";
				NxQuickMenu.addItem( strMenu, strLink );
			}			
			else
			{
				NxQuickMenu.addText( strMenu, "none" );
			}			
		}				

		this.SetMenu_Chat = function()
		{
			var strMenu = "´ëÈ­ÇÏ±â";
			
			if( this.maskGameCode_Group != 268435467 )
			{
				if( this.IsLogin() )
				{
					var strLink = "";
					if( !this.IsOnline() )
					{
						strLink = "alert( \"ÇØ´ç À¯Àú°¡ ¿Â¶óÀÎ »óÅÂ°¡ ¾Æ´Õ´Ï´Ù.\" );";
					}
					else if( !this.IsMyGuild() )
					{
						strLink = "alert( \"´ëÈ­ÇÏ±â´Â ¼Ò¼Ó ±æµå¿ø¿¡°Ô¸¸ Á¦°øÇÕ´Ï´Ù.\" );"; 
					}				
					else
					{
						strLink = "";
						var strServerName = this.strServerName == "" ? "" : "[" + this.strServerName + "]";
						var nUserListCount = 0;
						var strVirtualIDCode = "";
					
						var maskGameCode = this.maskGameCode_VirtualUser;
						if ( ( maskGameCode >> 16 ) == 0xd )
							maskGameCode = 74242;
						if ( ( maskGameCode >> 16 ) == 0x10 )
							maskGameCode = 94213;
						if( this.maskGameCode_Group == 268435471 )
							maskGameCode = 73739;
						
						GuildCommunicator.Guild.Monitor( this.oidRealUser_Group );
						
						var arrVirtualUsers = GuildCommunicator.MyInfo.GetVirtualUsers( maskGameCode );																	
						if ( arrVirtualUsers.length <= 1 )
						{						
							strVirtualIDCode = arrVirtualUsers[0].keyVirtual.uVirtualIDCode;
						}
						else
						{
							for ( var i in arrVirtualUsers )
							{				
								var strGameID = arrVirtualUsers[i].szNickName;	// º»ÀÎ					
							
							
								if (strGameID == strServerName + strVirtualUserName_My )
								{								
								
									strVirtualIDCode = arrVirtualUsers[i].keyVirtual.uVirtualIDCode;
									break;
								}
							}
						}
						
						if ( maskGameCode == 65536 )
								strVirtualUserName = this.strVirtualUserName;
							else
								strVirtualUserName = strServerName + this.strVirtualUserName;							
						
						if ( GuildCommunicator.IsMe( strVirtualUserName, maskGameCode ) )
						{
							strLink = "alert( \"º»ÀÎ°ú ´ëÈ­ÇÒ ¼ö ¾ø½À´Ï´Ù.\" );"; 
						}
						else
						{				
							strLink = "GuildCommunicator.Chat.RequestSessionToGuildMember( \"" +strVirtualUserName +"\" , \"" +( +maskGameCode ) +"\", \"" +strVirtualIDCode +"\" );"
						}
					}
					
					NxQuickMenu.addItem( strMenu, strLink );
				}
				else
				{
					NxQuickMenu.addText( strMenu, "none" );
				}
			}
			else
			{
				NxQuickMenu.addText( strMenu, "none" );
			}
		}	
	
		this.Execute = function()
		{
			this.SetMenu_GuildUser();
			NxQuickMenu.addText( "-", "-" );		
			this.SetMenu_UserInfo();		
			this.SetMenu_Note();
			this.SetMenu_Chat();
			NxQuickMenu.Execute(this.myEvent,{});			
		}
		this.Execute();
	}
}

var GnxUserMenu = new _GnxUserMenu();