if ((typeof (ncsj)=="undefined"))
{	
	ncsj={ManageFriend:[]};
}
else
{
	ncsj.namespace ("ncsj.user");
}

ncsj.user.ManageFriend = 
function()
{
	ncsj.user.ManageFriend.requestUserInformation = 
	function(nickName)
	{
		var MSG_ERROR = "Invalid Data Input";	

		try 
		{
			resultURI = encodeURIComponent(nickName);
			sendUrl = "http://myinfo.plaync.jp/external/profile/index.nc?targetNickName=" + resultURI;
			window.open (sendUrl,"_popUp","width=520, height=650, scrollbars=no, location=no, menubar=no, toolbar=no, status=no");
		} 
		catch (exc) 
		{
			resultURI = MSG_ERROR;

		}

	}

	ncsj.user.ManageFriend.requestUserKeyword = 
	function(keyword)
	{
		var MSG_ERROR = "Invalid Data Input";	

		try 
		{
			resultURI = encodeURIComponent(keyword);
			sendUrl = "http://blog.plaync.jp/?tp=keyword&vw=user&Keyword=" + resultURI;
			window.open (sendUrl,"_keyword");
		} 
		catch (exc) 
		{
			resultURI = MSG_ERROR;
		}
	}

	ncsj.user.ManageFriend.requestUserFriendList = 
	function()
	{
		var MSG_ERROR = "Invalid Data Input";	

		try 
		{
			sendUrl = "http://myinfo.plaync.jp/friend/popup/friendList.nc";
			window.open (sendUrl,"_friendList","width=520, height=590, scrollbars=no, location=no, menubar=no, toolbar=no, status=no");
		} 
		catch (exc) {}
	}

	ncsj.user.ManageFriend.requestFriend = 
	function(nickName)
	{
		var MSG_ERROR = "Invalid Data Input";	

		try 
		{
			var sendUrl = "http://myinfo.plaync.jp/friend/popup/external/index.nc";
			var parameter = "?ap=requestFriend&targetNickName=" + encodeURIComponent(nickName);
			window.open (sendUrl + parameter,"_friendList","width=520, height=590, scrollbars=no, location=no, menubar=no, toolbar=no, status=no");
		} 
		catch (exc) {}
	}

	ncsj.user.ManageFriend.createMessage = 
	function(nickName)
	{
		var MSG_ERROR = "Invalid Data Input";	

		try 
		{
			resultURI = encodeURIComponent(nickName);
			sendUrl = "http://myinfo.plaync.jp/message/popup/index.nc?ap=createMessage&targetNickName=" + resultURI;
			window.open (sendUrl,"_message","width=520, height=590, scrollbars=no, location=no, menubar=no, toolbar=no, status=no");
		} 
		catch (exc) 
		{
			resultURI = MSG_ERROR;

		}

	}

	ncsj.user.ManageFriend.createOptionedMessage = 
	/* DEBUG */
	//function(nickName, option)
	function(nickName, option, preContents)
        {
		var MSG_ERROR = "Invalid Data Input";	
		//var option = 2;
		targetString = "";

		try 
		{
			if (preContents == "")
			{
				targetString = "";
			}
			else
			{
				targetString = preContents.split("[(;)]").join("\n");
			}
			
			resultURI = encodeURIComponent(nickName);

			//window.alert(targetString);
			//encodePreContents = encodeURI(preContents);			
									
			sendUrl = "http://myinfo.plaync.jp/message/popup/index.nc?ap=createMessage&messageType=" + option + "&targetNickName=" + resultURI + "&preContents=" + encodeURI(targetString);
			window.open (sendUrl,"_message","width=520, height=590, scrollbars=no, location=no, menubar=no, toolbar=no, status=no");
		} 
		catch (exc) 
		{
			resultURI = MSG_ERROR;

		}

	/* DEBUG */
	}
}
ncsj.user.ManageFriend();