var ShoppCartAjaxHandler = function (cart) {
	(function($) { 
		if ($('#shopp-cart-items').length > 0) {
		
			$("#scItems ul").empty();
			$("#scItems ul").append("<li><strong>Cart Contents:</strong></li>");
			for (x=0;x<cart.Contents.length;x++) {
				var itemList = '<li><span class="sbQTY">'+cart.Contents[x].quantity+'</span><span class="sbNAME">'+cart.Contents[x].name;
				if (cart.Contents[x].option.label) {
					itemList = itemList + ' (' + cart.Contents[x].option.label + ')';
				}
				itemList = itemList + '</span><span class="sbPRICE alignright">' + asMoney(cart.Contents[x].total) + '</span></li>';
				$("#scItems ul").append(itemList);
			}
			$("#scItems ul").show();
			
			$('#shopp-cart-items').html(cart.Totals.quantity);
			$('#shopp-cart-total').html(asMoney(cart.Totals.total));			
		} else {
			$('#cob').show();
			
			$("#scItems ul").empty();
			$("#scItems ul").append("<li><strong>Cart Contents:</strong></li>");
			for (x=0;x<cart.Contents.length;x++) {
				var itemList = '<li><span class="sbQTY">'+cart.Contents[x].quantity+'</span><span class="sbNAME">'+cart.Contents[x].name;
				if (cart.Contents[x].option.label) {
					itemList = itemList + ' (' + cart.Contents[x].option.label + ')';
				}
				itemList = itemList + '</span><span class="sbPRICE alignright">' + asMoney(cart.Contents[x].total) + '</span></li>';
				$("#scItems ul").append(itemList);
			}
			$("#scItems ul").show();
			
			$('.widget_shoppcartwidget p.status').html('<span id="shopp-sidecart-items">'+cart.Totals.quantity+'</span> <strong>Items</strong><br /><span id="shopp-sidecart-total" class="money">'+asMoney(cart.Totals.total)+'</span> <strong>Total</strong>');
		}
	})(jQuery)	
}
