function removeItem(pID) {
	$('cart').fade( {to:0.3,duration:0.3} );
	timer=setTimeout(doRemoveItem.curry(pID), 400);
}
function doRemoveItem(pID){
	new Ajax.Request('ajax/removeFromCart.php', {method: 'post', parameters: {pID: pID}, onSuccess: show_cart, onFailure: show_cart_fail});
}
function update_cart() {
	$('cart').fade({ to:0.3,duration: 0.3, afterFinish: perform_update_cart } );	
}
function perform_update_cart() {
	params = $('cart-form').serialize();
	new Ajax.Request('ajax/updateCart.php', {method: 'post', parameters: params, onSuccess: show_cart, onFailure: show_cart_fail});
}
function show_cart(response) {
	$('cart').appear({ duration: 0.5 });
	var str = response.responseText;
	str = str.split(":::::");
	$('cart').innerHTML=str[0];
	$('top_cart_total').innerHTML=str[1];
	if($('msg')) $('msg').hide();
	timer=setTimeout(makeDraggable, 500);
}
function show_cart_fail(response) {
	$('cart').appear({ duration: 0.5 });
	$('cart').innerHTML=response.responseText;
	if($('msg')) $('msg').hide();
}
function addPromoCode() {
	$('cart').fade( { to:0.3,duration: 0.3, afterFinish: doPromoCode } );
}
function doPromoCode() {
	code = $F('promocode');
	new Ajax.Request('ajax/addPromoCode.php', {method: 'post', parameters: {code: code}, onSuccess: show_cart, onFailure: show_cart_fail});
}
