﻿function AcceptFriend(Id) {
    var url = '/Friend/Friend.ashx?Accept&Format=json';												
					new Ajax.Request(url, {method: 'post', parameters: { FriendId: Id },												
									 onSuccess: function(transport) {     
                					 var rsp = transport.responseText.evalJSON().rsp;
								if(rsp.stat != 'fail')
									alert(rsp.err.msg);

																			
                        } });
                        
        document.getElementById('Aceptar_' + Id).style.display = "none";
        document.getElementById('Ignorar_' + Id).style.display = "none";
        document.getElementById('FeedBack_True_' + Id).style.display = "block";
}
 function Ignore(Id, UserName, LastName) { 
	if(!confirm('¿Esta seguro que quieres eliminar a '+ UserName + ' ' + LastName + ' de tu lista de contactos?'))
	{
	 
	}
	else
	{
		var url = '/Friend/Friend.ashx?Ignore&Format=json';												
						new Ajax.Request(url, {method: 'post', parameters: { FriendId: Id },												
										 onSuccess: function(transport) {     
										 var rsp = transport.responseText.evalJSON().rsp;
									if(rsp.stat != 'fail')
										alert(rsp.err.msg);
							} });
							document.getElementById('LabelName' + Id).style.textDecoration = "line-through";
							document.getElementById('LabelBody' + Id).style.textDecoration = "line-through";
							document.getElementById('LabelVisitas' + Id).style.textDecoration = "line-through";
							
							document.getElementById('LabelAmigos' + Id).style.textDecoration = "line-through";
							document.getElementById('LabelFotos' + Id).style.textDecoration = "line-through";
							document.getElementById('LabelVideos' + Id).style.textDecoration = "line-through";
							document.getElementById('LabelNotas' + Id).style.textDecoration = "line-through";
							document.getElementById('LabelNotas' + Id).style.textDecoration = "line-through";
							document.getElementById('Img' + Id).src = "../images/usuario_eliminado.gif";
	}
}

 function IgnoreFriend(Id, UserName, LastName) {
	if(!confirm('¿Esta seguro que quieres ignorar a '+ UserName + ' ' + LastName + ' de tu lista de contactos?'))
	{
	 
	}
	else
	{
		var url = '/Friend/Friend.ashx?Ignore&Format=json';												
						new Ajax.Request(url, {method: 'post', parameters: { FriendId: Id },												
										 onSuccess: function(transport) {     
										 var rsp = transport.responseText.evalJSON().rsp;
									if(rsp.stat != 'fail')
										alert(rsp.err.msg);
							} });
		document.getElementById('Aceptar_' + Id).style.display = "none";
		document.getElementById('Ignorar_' + Id).style.display = "none";
		document.getElementById('FeedBack_False_' + Id).style.display = "block";    
	}                   
}