//the functions in this document update the DOM after an AJAX call.


function page_update_add_new_file_category(category_id, category_title, what)
{
	var new_category = document.createElement('li');

	new_category.innerHTML = "<a href='JavaScript: //' onclick=\"var confirm_delete = confirm('You are about to delete this category! This will delete all the files in this category.'); if(confirm_delete == true) ajax_delete_category(" + category_id + ", '" + what + "');\"><img src='" + root_directory + "/images/icons/cross.png' alt='Delete' class='icon'></a>";

	new_category.innerHTML = new_category.innerHTML + "<a href='/file_manager/show_category/" + category_id + "/'>" + category_title + "</a>";

	new_category.style.display = 'none';

	new_category.id = 'li_categories-' + category_id;

	document.getElementById('li_categories').appendChild(new_category);

	$(document).ready(function(){
		$("#li_categories-" + category_id).fadeIn("slow");
	});
}


function page_update_delete_content_item(content_item_id, section_id)
{
	//remove the item from the page
	//fancy
	$(document).ready(function(){
		$("#content_list_" + section_id + "-" + content_item_id).fadeOut("slow");
	});
	//non-fancy
	//document.getElementById('content_list_' + content_item_id).style.display = 'none';
}

function page_update_delete_file_item(file_item_id)
{
	//remove the item from the page
	//fancy
	$(document).ready(function(){
		$("#file_list-" + file_item_id).fadeOut("slow");
	});
	//non-fancy
	//document.getElementById('content_list_' + content_item_id).style.display = 'none';
}

function page_update_delete_category(category_id)
{
	//remove the item from the page
	//fancy
	$(document).ready(function(){
		$("#li_categories-" + category_id).fadeOut("slow");
	});
	//non-fancy
	//document.getElementById('content_list_' + content_item_id).style.display = 'none';
}
