function allowFollow(userId, hash) { //, alertId) {
	route_command("allow", [{property:"id", value:userId},{property:"hash", value:hash}], updateAlertsBox);
}

function declineFollow(userId, hash) { //, alertId) {
	route_command("decline", [{property:"id", value:userId},{property:"hash", value:hash}], updateAlertsBox);
}

function deleteAlert(alertId, read) {
	route_command("deleteAlert", [{property:"id", value:alertId}, {property:"read", value:read}], updateAlertsBox);
}

function readAlert(alertId) {
	route_command("readAlert", [{property:"id", value:alertId}], updateAlertsBox);
}

function route_command(cmd, data, returnFunction) {
	var nds = "function=" + cmd;
	for ( var i = 0; i < data.length; i ++ ) {
		nds += "&" + data[i].property + "=" + data[i].value;
	}
	$.ajax({
		type: "POST",
		url: "services/ajaxActions.php",
		data: nds,
		success: returnFunction
	});
}

function updateAlertsBox(data) {
	fetchContent('#write', 0, 'alerts');
	//alert(data);
}