function confirma_borrar() {
	return confirm ('Sure you want to delete this update? There is NO undo!');
}
/*
function delete_post(update_id) {
	var answer = confirm ('Sure you want to delete this update? There is NO undo!');
	if (answer){
		$j.ajax({
				type: "POST",
				url: "/delete_post/",
				data: 'id='+update_id,
				complete: function(str){
					if (str.responseText == 'expired') {
						location.href = location.href;
					} else {
						if (str.responseText == "ok") {
							location.href = location.href;
						} else if (str.responseText.length > 1) {
							alert(str.responseText);
						} else {
							alert('Error while deleting');
						}
					}
				}
		});
	}
}
*/
function mark_inappropriate(update_id) {
	var answer = confirm ('Sure you want to mark inappropriate this update?');
	if (answer) {
		$j("#image_mark_inappropriate_" + update_id).attr("src","/img/loader.gif");

		$j.ajax({
			type: "GET",
			url: "/mark_inappropriate/",
			data: 'id='+update_id,
			complete: function(str){
				if (str.responseText == 'expired') {
					location.href = location.href;
				} else {
					if (str.responseText == "1") {
						//location.href = location.href;
						$j("#image_mark_inappropriate_" + update_id).attr("src", "/img/exclamation.gif");
						$j("#image_mark_inappropriate_" + update_id).css("title", "Marked as inappropriate");
						var img=$j("#button_mark_inappropriate_" + update_id).html();
						$j("#button_mark_inappropriate_" + update_id).remove();
						$j("#div_mark_inappropriate_" + update_id).html(img);

					} else {
						$j("#image_mark_inappropriate_" + update_id).attr("src","/img/flag_red.gif");
						alert('Error while marking as inappropriate');
					}
				}
			}
		});
	}
}
function view_inappropriate(update_id) {
	$j("#loading_show_inappropriate_" + update_id).attr("src","/img/loader.gif");

	$j.ajax({
		type: "GET",
		url: "/show_inappropriate/",
		data: 'id='+update_id,
		complete: function(str){
			if (str.responseText == 'expired') {
				location.href = location.href;
			} else {
				$j("#div_update_" + update_id).html(str.responseText);
			}
		}
	});
}
function update_pos(id, place) {
	$j("#place_" + id).text(place);
}
