function displayShoppingCart() {
	new Ajax.Updater('shoppingCart', 'xmlGateway.php?load=orders/shoppingCart', { method: 'get', evalScripts:true });
}

function placeInCart(productId) {
	//new Ajax.Updater('shoppingCart', 'xmlGateway.php?shoppingCartAction=placeInCart&productId='+productId, { method: 'get', evalScripts:true });
	new Ajax.Request('xmlGateway.php?shoppingCartAction=placeInCart&productId='+productId);
	setTimeout("displayShoppingCart();",200);
	// scroll to cart
	Effect.ScrollTo('shoppingCart');
	setTimeout("blinkShoppingCart();",1000);
}

function dropFromCart(productId) {
	
	new Ajax.Request('xmlGateway.php?shoppingCartAction=dropFromCart&productId='+productId);
	displayShoppingCart();
	
}

function blinkShoppingCart() {
	
	new Effect.Highlight('shoppingCartTable', { startcolor: '#ffff99',
endcolor: '#EFEFEF' }); 

}

function updateItemAmount(obj) {
	
	new Ajax.Request('xmlGateway.php?shoppingCartAction=updateItemAmount&productId='+obj.id+'&itemAmount='+obj.value);
	displayShoppingCart();
	setTimeout("blinkShoppingCart();",200);
}

function makeOrder(confirmText,busyText,thankYouText,placeOrderText) {
	if(confirm(confirmText)) {
		$('orderButton').disabled = true;
		$('orderButton').value = busyText;
		new Ajax.Updater('responseListener','xmlGateway.php?shoppingCartAction=makeOrder');
		alert(thankYouText);
		$('orderButton').disabled = false;
		$('orderButton').value = placeOrderText;
	}
}
