

function addFriend(friendID, callback)
{
	new Ajax.Request( window.location,
		{
			parameters: { 	cmd:"addfriend",
							friendID : friendID
						},
			onComplete: function(resp)
			{
				if(callback)
				{
					callback();
				}

				decrementNotificationCount();
			}
		}
	);
}


function cancelFriend(friendID, callback)
{
	new Ajax.Request(window.location,
		{
			parameters: {cmd : "removefriend", friendID : friendID},
			onComplete: function()
			{
				if(callback)
				{
					callback();
				}

				decrementNotificationCount();
			}
		}
	);
}


function setFriendRequestViewed(friendID, callback)
{
	new Ajax.Request(window.location,
		{
			parameters: {cmd : "setFriendRequestViewed", friendID : friendID},
			onComplete: function(resp)
			{
				if(callback)
				{
					callback();
				}
			}
		}
	);

}


function removeDonationNotif( donation_id, callback )
{
	new Ajax.Request( window.location,
		{
			parameters: {cmd : "removedonation", donation_id : donation_id},
			onComplete: function()
			{
				decrementNotificationCount();

				if(callback)
				{ callback(); }
			}
		}
	);

}


function removeContributionNotif(donation_id, callback)
{
	new Ajax.Request(window.location,
		{
			parameters: {cmd : "removecontribution", donation_id : donation_id},
			onComplete: function()
			{
				decrementNotificationCount();

				if( callback )
				{ callback(); }
			}
		}
	);
}


function removeMessageNotif(message_id, callback)
{
	new Ajax.Request(window.location,
		{
			parameters: {cmd : "removemessage", message_id : message_id},
			onComplete: function()
			{
				decrementNotificationCount();

				if( callback )
				{ top.location.href = callback; }
			}
		}
	);
}


// Hide action buttons
function hideAddFriendButton(memberID)
{
	$$('.friendicon').each(
		function(e){
			if(e.id == 'add_friend_action'+memberID)
			{
				e.hide();
			}
		}
	);
	$$('.friends').each(
		function(e)
		{
			if(e.id == 'add_friend_action'+memberID)
			{
				e.hide();
			}
		}
	);

}

function hideAddFavouriteButton(){
	$$('.bookmark').each(
		function(e){
			e.hide();
		}
	);

}

function hideReportButton(){
	$$('.report').each(
		function(e){
			e.hide();
		}
	);

}

/*function hideRemovedFriend(memberID)
{
	$$('.member').each(
		function(e){
			if(e.id == 'member'+memberID)
			{
				e.hide();
			}
		}
	);

}
*/
