function acceptFriend(userId)
{
	if (document.getElementById('view' + userId))
	{
		try
		{
			document.getElementById('accepted' + userId).style.display = 'table-row';
		}
		catch (e)
		{
			/* IE doesn't support "table-row" */
			document.getElementById('accepted' + userId).style.display = 'block';
		}
		document.getElementById('view' + userId).style.display = 'none';
		ajaxPostData('/my_friends.submit.php', {accept: userId});
	}
}

function declineFriend(userId)
{
	if (document.getElementById('view' + userId))
	{
		document.getElementById('view' + userId).style.display = 'none';
		ajaxPostData('/my_friends.submit.php', {decline: userId});
	}
}

function addFriend(userId)
{
	if (document.getElementById('add' + userId))
	{
		document.getElementById('add' + userId).style.display = 'none';
		ajaxPostData('/my_friends.submit.php', {add: userId});
		alert(msgRequestedFriend);
	}
}

function removeFriend(userId)
{
	if (document.getElementById('view' + userId))
	{
		document.getElementById('view' + userId).style.display = 'none';
		ajaxPostData('/my_friends.submit.php', {remove: userId});
	}
}

