function favorite_delete_one(id) {
	
	var post = ac_form_post("form_" + id);
	
	ac_ui_api_call(jsSaving);
	ac_ajax_post_cb(apipath, "favorite.favorite_delete_one", favorite_delete_one_cb, post);
}

function favorite_delete_one_cb(xml) {
	var ary = ac_dom_read_node(xml, null);
	ac_ui_api_callback();

	if (ary.succeeded != "0") {
		ac_result_show(ary.message);
		$("form_" + ary.id).className = "ac_hidden";
	} else {
		ac_error_show(ary.message);
	}
}

function favorite_delete_all() {
	
	var post = ac_form_post("form");
	
	if (confirm("Are you sure you want to delete all Saved Articles?")) {
		ac_ui_api_call(jsSaving);
		ac_ajax_post_cb(apipath, "favorite.favorite_delete_all", favorite_delete_all_cb, post);
	}
}

function favorite_delete_all_cb(xml) {
	var ary = ac_dom_read_node(xml, null);
	ac_ui_api_callback();
	
	if (ary.succeeded != "0") {
		ac_result_show(ary.message);
		$("favoriteslist").className = "ac_hidden";
		$("form").innerHTML = "<p>No articles currently in your saved list.</p>";
	} else {
		ac_error_show(ary.message);
	}
}

