$(document).ready(function() {
	
});

function doDisableCommentCall(e, commentId) {
	$.ajax({
		type: "GET",
		url: "ajax/disableComment.php",
		dataType: "xml",
		data: {id: commentId},
		error: function() {
			alert("Fejl!\n\u00D8v :(");
        },
		success: function(xml){
			$(xml).find("root").each(function() {
				// root element
				$status = $(this).find("status").text();
				if($status == "success") {
					// Comment successfully disabled
					$(this).find("response").each(function() {
						var commentBox = $(this).find("commentBox").text();
						$(e).parent().parent().parent().html(commentBox);
					});
				}
				else {
					// Comment not disabled
					alert("Comment could not be disabled");
				}
			});
		}
	});
}

function doEditCommentCall(e, commentId) {
	alert("Not yet implemented!");
}
