// JavaScript Document

/* Remove file from download cart */
function remove_file(id, element) {
	// remove item from cart, remove row from cart table
	$.post('/remove-cart-resource.aspx', {'id': id});
	remove_row(element);
	return false;
}

/* Fade out and remove element */
function remove_row(element) {
	$(element).animate({opacity: 0.0}, 300);
	$(element).queue(function() {
		$(this).hide();
	});
	return false;
}

function get_file(id) {
	$('#get-file-container').load('/get-file-dialog.aspx', {'id': id});
	return false;
}

function add_file(id) {
	$.post('/add-cart-resource.aspx', {'id': id});
	$('#get-file-container').html('');
	setTimeout('window.location = window.location;', 1000);
	return false;
}
