function calcul_total()
{
	var total = 0;
	var sous_total = 0;
	var shipping_total = 0;
	var nbBtl = 0;
	
	$('input.price_cepages').each(function()
	{
		var id = this.id.split('_');
		id = id[1];
		
		var qty = $('#qty_' + id).val();
		
		if (qty == "")
		{
			qty = 0;
			$('#qty_' + id).val('');
		}
		
		nbBtl += parseInt(qty);
		
		var price = this.value;
		
		var total_line = parseFloat(qty * price);
		$('#total_' + id).text(total_line);
		
		total += total_line;
		sous_total += total_line;
	});
	
	$('#sous_total_cepage').text(sous_total);
	
	sous_total = 0;
	
	$('input.price_eaux').each(function()
	{
		var id = this.id.split('_');
		id = id[1];
		
		var qty = $('#qty_' + id).val();
		
		if (qty == "")
		{
			qty = 0;
			$('#qty_' + id).val('');
		}
		
		nbBtl += parseInt(qty);
		
		var price = this.value;
		
		var total_line = parseFloat(qty * price);
		$('#total_' + id).text(total_line);
		
		total += total_line;
		sous_total += total_line;
	});
	
	$('#sous_total_eaux').text(sous_total);
	
	$('#total_shipping').css('display', 'block');
	$('#msg_shipping').css('display', 'none');
	$('#order_button').css('display', 'block');
	
	if (nbBtl <= 18 && nbBtl > 0)
	{
		shipping_total = 28;
	}
	else if (nbBtl <= 60)
	{
		shipping_total = parseFloat(nbBtl * 1.3);
	}
	else
	{
		$('#total_shipping').css('display', 'none');
		$('#msg_shipping').css('display', 'block');
		$('#order_button').css('display', 'none');
	}
	
	total += shipping_total;
	$('#shipping').text(shipping_total);
	$('#shipping_value').val(shipping_total);
	$('#total').text(total);
	$('#total_value').val(total);
}

