CORE.friends = {};


CORE.friends.accept = function(){
	var uid = (arguments[0])?arguments[0]:0
	$("#Message").html = '<img src="/images/rotating.gif">'
	$.ajax({
		type: "GET",
		url:"/account/friends/ajax/_processaccept.cfm",
		data:"uid=" + uid + "&p=a",
		success: function(mess){
				$("#Message").html(mess)
			}
	})		
};

CORE.friends.decline = function(){
	var uid = (arguments[0])?arguments[0]:0
	$("#Message").html = '<img src="/images/rotating.gif">'
	$.ajax({
		type: "GET",
		url:"/account/friends/ajax/_processaccept.cfm",
		data:"uid=" + uid + "&p=d",
		success: function(mess){
				$("#Message").html(mess)
			}
	})	
};

CORE.friends.SendRequest = function(){
	$("#message").html = '<img src="/images/rotating.gif">'
	var reqid = (arguments[0])?arguments[0]:0
	var uid = (arguments[1])?arguments[1]:0
	
	$.ajax({
		type: "GET",
		url:"/account/friends/ajax/_sendrequest.cfm",
		data:"uid=" + uid + "&rid=" + reqid,
		success: function(mess){
				$("#message").html(mess);
				$("#message").show();
				$("#message").animate({opacity: 1.0}, 2000);
				$("#message").fadeOut(1000);
			}
	})		
};

CORE.friends.getFriends = function() {
	$("#myfriends").html = "<img src='/images/rotating.gif'>";
	var type = arguments[0];
	
	$.ajax({
		type: "GET",
		url:"/account/_friends.cfm",
		data:"type=" + type,
		success: function(mess){
				$("#myfriends").html(mess);
				//$("#myfriends").show();
			}
	})		
};

