var Pdfcart = {
	handle : function(inputid, menuid, uri) {
		var action = "addtocart";
		if(!$(inputid).checked) action = "removefromcart";
		new Ajax.Request(
			'/index.php?sid=pdfcart&action='+action+'&page='+menuid+'&uri='+escape(uri), {
				onComplete : function(transport) {
					$('page-cart-info').innerHTML = transport.responseText;
				}
			}
		);
	},
	reOrder : function () {
		new Ajax.Request('/index.php?sid=pdfcart&action=reorder', {
			method: 'post',
			parameters: Sortable.serialize('cart_items')
		});
	},
	removeFromCart : function(menuid, listitemid) {
		new Ajax.Request(
			'/index.php?sid=pdfcart&action=removefromcart&page='+menuid, {
				onComplete : function(transport) {
					$(listitemid).remove();
				}
			}
		);
		return false;
	}
}