
function friends_remove(id) {
	new Ajax.Request('/friends/remove/'+id, {
		onLoading: function(){  },
		onSuccess: function(xhr) {
			if (xhr.responseJSON.status == 'OK') {
				$('invited_'+id).remove();
				if ($('invited_sep_'+id)) $('invited_sep_'+id).remove();
				var elemnum = $$('#table_invited tr').size();
				if (elemnum == 0) {
					$('profil_invited').hide();
					$('switch_invited').hide();
					$('profil_friends').show();
					$('switch_link_friends').addClassName('eckehover_profil');
				}
			}
		}
	});
}

function friends_quit(id) {
	if (confirm(friends_quit_confirm)) {
		new Ajax.Request('/friends/quit/'+id, {
			onLoading: function(){  },
			onSuccess: function(xhr) {
				if (xhr.responseJSON.status == 'OK') {
					Effect.Fade($('friends_'+id), { duration: 1.0 });
					if ($('friends_sep_'+id)) Effect.Fade($('friends_sep_'+id), { duration: 1.0 });
				}
			}
		});
	}
}
