function friend(){
	args = friend.arguments;	
	currentObj = args[3];
	parentObj = currentObj.parentNode;		
	notification = null;
	messageOut = null;
	friendPtr = this;	

	FRIEND_MESSAGE = 
	{
		REMOVE_MESSAGE:
		{
			success:	"Quitado de la lista de Seguidos.",
			failure:	"Error al quitar seguidos de la lista.",
			inProgress:	"Por favor aguarda..."
		},
		
		ADD_MESSAGE:
		{
			success:	"Pedido enviado.",	
			failure:	"El pedido ha fallado.",
			inProgress:	"Por favor aguarda..."
		}
		
	};		

	
	FAN_MESSAGE = 
	{
		REMOVE_MESSAGE:
		{
			success:	"Fuiste quitado de la Lista de Fans.",	
			failure:	"Error al quitarte de la Lista de Fans.",
			inProgress:	"Por favor aguarda..."
		},
		
		ADD_MESSAGE:
		{
			success:	"ĦAhora eres un Fan!",	
			failure:	"Error al volverte un Fan.",
			inProgress:	"Por favor aguarda..."
		}
		
	};		
	

	
	if (args.length <= 1) return false;
	
	
	switch(args[2])
	{
		case "FanToFan": 
			notification = FRIEND_MESSAGE;
			break;
		case "FanToBand": 
			notification = FAN_MESSAGE;
			break;		
		case "BandToBand": 
			notification = FRIEND_MESSAGE;
			break;
			
		default: notification = FRIEND_MESSAGE; break;
	}
	
	switch(args[0])
	{		
		case "add": 
			messageOut  = notification.ADD_MESSAGE;
			break;
			
		case "remove": 
			messageOut  = notification.REMOVE_MESSAGE;
			break;
	}
	
	var friendURL ="/sitewide/dataservices/user/update_friend.jhtml?action="+args[0]+"&id="+args[1]+"&type="+args[2];
	var ajaxReq = new Ajax.Request( friendURL,
	  	{
			method: 'get',
			contentType: 'text/xml',
			onSuccess: function(transport){
				xml = transport.responseXML;
				//alert(transport.responseText);

				friendPtr.parentObj.style.background = "#666";			
				friendPtr.parentObj.innerHTML = friendPtr.messageOut.success;

				//body = xml.documentElement;
				//window.location.reload();
			},
			
			onLoading: function()
			{
				friendPtr.parentObj.style.background = "#666";			
				friendPtr.parentObj.innerHTML = friendPtr.messageOut.inProgress;
			},
			
			onException: function(transport,exception) {
				//alert("The request had a fatal exception thrown. " + exception);													
				friendPtr.parentObj.style.background = "#666";			
				friendPtr.parentObj.innerHTML = friendPtr.messageOut.failure;
				
				return true;
			},
			onFailure: function(transport) {
				friendPtr.parentObj.style.background = "#666";			
				friendPtr.parentObj.innerHTML = friendPtr.messageOut.failure;
				return false;
			}
		}
	);
}