

function ajaxAddFriendRequest()
{
	if (ajaxBasicRequest())
	{
		document.getElementById("PM_AddFriend").value = 'Break of Friendship';
		document.getElementById("PM_AddFriend").className = 'button blue';
	}
}
function ajaxDelFriendRequest()
{
	if (ajaxBasicRequest())
	{
		document.getElementById("PM_AddFriend").value = 'Request Friendship';
		document.getElementById("PM_AddFriend").className = 'button white';
	}
}

function ajaxAddFriendSend()
{
	if (request == null)
		createRequest();
		
	var url = "./social/addFriend.php";
	var postString = "";
	
	postString += "friend_key=" + encodeURIComponent(user_key);
	postString += "&parity=" + encodeURIComponent(parity_code);


	request.open("POST",url,true);   
	request.onreadystatechange = ajaxAddFriendRequest;
	request.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=utf-8");
	request.send(postString);
}

function ajaxDelFriendSend()
{
	if (request == null)
		createRequest();
		
	var url = "./social/delFriend.php";
	var postString = "";
	
	postString += "friend_key=" + encodeURIComponent(user_key);
	postString += "&parity=" + encodeURIComponent(parity_code);


	request.open("POST",url,true);   
	request.onreadystatechange = ajaxDelFriendRequest;
	request.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=utf-8");
	request.send(postString);
}
