	function addToCart( item_id, id ){
		var selIndex =  document.getElementById('size').selectedIndex;
		var size = document.getElementById('size').options[selIndex].value
		n = document.getElementById('quantity').value
		window.location='?id=21&cp=shopping_cart/add&item_id='+item_id+'&size='+size+'&n='+n
	}
	
	function changeNumber( order_item_id, n, price ){
		if( n > 0 ){
			document.getElementById('actioniframe' ).src='server.php?module=content.products&cp=shopping_cart/n&order_item_id='+order_item_id+'&n='+n
			updateTotal( order_item_id, n, price )
		}
		else
			alert( 'Quantity not Allowed' );
	}
	
	function delOrderItem( order_item_id, row ){
		if( order_item_id > 0 ){
			
		document.getElementById('actioniframe' ).src='server.php?module=content.products&cp=shopping_cart/del&order_item_id='+order_item_id
		alert( 'Item removed from shopping cart' );
		document.getElementById('row_'+row).style.display='none'
		}
		
	}
	
	
	function updateTotal( row, n, price ){
		document.getElementById( 'total_'+row ).innerHTML = '$ ' + ( roundNumber( (n*price), 2 ) )
	}
	
	function roundNumber(n, d) {
	  n = n - 0;
	  if (d == null) d = 2;
	  var f = Math.pow(10, d);
	  n += Math.pow(10, - (d + 1));
	  n = Math.round(n * f) / f;
	  n += Math.pow(10, - (d + 1));
	  n += '';
	  return d == 0 ? n.substring(0, n.indexOf('.')) :  n.substring(0, n.indexOf('.') + d + 1);
	}