function giveFavor(characterId)
{
	$("#favorPaneContent").load("/favors.php?action=give&character_id=" + characterId, function() { $("#favorPane").css("display", "block") });
	return false;
}

function viewFavor(favorId)
{
	$("#favorPaneContent").load("/favors.php?action=view&favor_id=" + favorId, function(){$("#favorPane").css("display", "block")});
	return false;
}
function transferFavor(favorId)
{
	$("#favorPaneContent").load("/favors.php?action=transfer&favor_id=" + favorId, function(){$("#favorPane").css("display", "block")});
	return false;
}
function dischargeFavor(favorId)
{
	if(confirm('Are you sure you want to discharge the favor?')) {
		$.ajax({
			url: "/favors.php?action=discharge&favorId=" + favorId,
			type: "post",
			dataType: "html",
			success: function(response, status, request) {
				alert(response);
				//window.location.reload();
			},
			error: function(request, message, exception) {
				alert('There was an error submitting the request. Please try again.');
			}
		});
	}
	return false;
}

function breakFavor(favorId)
{
	if(confirm('Are you sure you want to break the favor?')) {
		$.ajax({
			url: "/favors.php?action=break&favorId=" + favorId,
			type: "post",
			dataType: "html",
			success: function(response, status, request) {
				alert(response);
				//window.location.reload();
			},
			error: function(request, message, exception) {
				alert('There was an error submitting the request. Please try again.');
			}
		});
	}
	return false;
}
