<!--
	function fxEmptyCart()
	{
		//var Conferma = confirm ('Remove all the items from the cart?');
		var Conferma = true;
		var i = 0;
		var Clear = false;
		
		if (Conferma)
		{
			if (document.fProdotti.tQuantita)
			{
				var nElementi = document.fProdotti.tQuantita.length;
				
				if (!nElementi)
				{
					if (document.fProdotti.tQuantita.value > 0)
					{
						document.fProdotti.tQuantita.value = '';
						document.fProdotti.Azione.value = 'C';
						document.fProdotti.IDProdotto.disabled = false;
						document.fProdotti.Quantita.disabled   = false;
						document.fProdotti.Azione.disabled     = false;
					}
					if (document.fProdotti.iQuantita.value > 0)
					{ Clear = true; }
				}
				else
				{
					for (i = 0; i < nElementi; i++)
					{
						if (document.fProdotti.tQuantita[i].value > 0)
						{
							document.fProdotti.tQuantita[i].value = '';
							document.fProdotti.Azione[i].value = 'C';
							document.fProdotti.IDProdotto[i].disabled = false;
							document.fProdotti.Quantita[i].disabled   = false;
							document.fProdotti.Azione[i].disabled     = false;
						}
						
						if (document.fProdotti.iQuantita[i].value > 0)
						{ Clear = true; }
					}
				}
				
				if (Clear)
				{
					document.fProdotti.action = document.fProdotti.id + document.location.search;
					document.fProdotti.submit();
				}
			}
		}
	}
	
	function fxCheckQuantity(src,i)
	{
		//Conteggio campi
		var nItems = document.fProdotti.IDProdotto.length;
		
		if (!nItems)
		{
			// Controllo se devo mandare a processare il prodotto nel cart XML
			if (document.fProdotti.iQuantita.value != src.value)
			{
				// Prodotto da processare
				if (document.fProdotti.iQuantita.value == '' && parseInt(src.value) != 0)
				{ document.fProdotti.Azione.value = 'I'; }
				else if (src.value != '' && parseInt(src.value) != 0)
				{ document.fProdotti.Azione.value = 'M'; }
				else if (src.value == '' || parseInt(src.value) == 0)
				{
					if (document.fProdotti.Azione.value != 'I')
					{ document.fProdotti.Azione.value = 'C'; }
					else
					{ document.fProdotti.Azione.value = '' }
				}
				else
				{ return false; }
				
				document.fProdotti.Quantita.value = document.fProdotti.tQuantita.value;
				document.fProdotti.IDProdotto.disabled = false;
				document.fProdotti.Quantita.disabled = false;
				document.fProdotti.Azione.disabled = false;
			}
			else
			{
				// Prodotto da non processare
				document.fProdotti.Azione.value = '';
				document.fProdotti.IDProdotto.disabled = true;
				document.fProdotti.Quantita.disabled = true;
				document.fProdotti.Azione.disabled = true;
			}
		}
		else
		{
			// Controllo se devo mandare a processare il prodotto nel cart XML
			if (document.fProdotti.iQuantita.value != src.value)
			{
				// Prodotto da processare
				if (document.fProdotti.iQuantita.value == '' && parseInt(src.value) != 0)
				{ document.fProdotti.Azione[i].value = 'I'; }
				else if (src.value != '' && parseInt(src.value) != 0)
				{ document.fProdotti.Azione[i].value = 'M'; }
				else if (src.value == '' || parseInt(src.value) == 0)
				{
					if (document.fProdotti.Azione[i].value != 'I')
					{ document.fProdotti.Azione[i].value = 'C'; }
					else
					{ document.fProdotti.Azione[i].value = '' }
				}
				else
				{ return false; }
				
				document.fProdotti.Quantita[i].value = document.fProdotti.tQuantita[i].value;
				document.fProdotti.IDProdotto[i].disabled = false;
				document.fProdotti.Quantita[i].disabled   = false;
				document.fProdotti.Azione[i].disabled     = false;
			}
			else
			{
				// Prodotto da non processare
				document.fProdotti.Azione[i].value = '';
				document.fProdotti.IDProdotto[i].disabled = true;
				document.fProdotti.Quantita[i].disabled   = true;
				document.fProdotti.Azione[i].disabled     = true;
			}
		}
	}
	
	function fxDel(src,i)
	{
		var nItems = document.fProdotti.IDProdotto.length;
		//var vConfirm = confirm('Remove the product [' + src + '] from the cart?');
		var vConfirm = true;
		
		if (vConfirm)
		{
			if (!nItems)
			{
				document.fProdotti.tQuantita.value = '';
				fxCheckQuantity(document.fProdotti.tQuantita,i)
			}
			else
			{
				document.fProdotti.tQuantita[i].value = '';
				fxCheckQuantity(document.fProdotti.tQuantita[i],i)
			}
			
			document.fProdotti.action = document.fProdotti.id + document.location.search;
			document.fProdotti.submit();
		}
	}
	
	function fxCheckProducts(src)
	{
		if (src.tQuantita)
		{
			var nItems = src.tQuantita.length;
			
			// Verifica esistenza del campo
			if (!nItems)
			{ fxCheckQuantity(src.tQuantita,0); }
		}
	}
//-->

