		var fld;
		var totQty;
		var totPrice;
function ValNum(theField)
{
	var RE=/\d+/;		
	fld=theField;
	if(!(RE.test(theField.value)))
	{
		alert("Invalid value, Please Reenter");
		setTimeout("doSelection()",0);
		theField.value = "0";
	}
	else
	{
		calcTotals(); 
	}
}
function doSelection()
{
	fld.focus();
	fld.select();
}
function calcTotals()
{
	theForm=document.frmContainer;
	cnt=theForm.fldhNumRows.value;
	maxQty=theForm.fldhContainerQty.value;
	totQty=0;
	totPrice=0.00;
	for(i=0;i<cnt;i++)
	{
		Qty=String('fldQty'+String(i));
		totQty+=Number(document.getElementById(Qty).value);
		Price=String('fldhPrice'+String(i));
		totPrice+=Number((document.getElementById(Price).value * document.getElementById(Qty).value));
	}
	if(!(isNaN(totQty)))
	{
		theForm.fldTotQty.value=totQty;
		if(theForm.fldhALaCarte.value==1)
		{
			totdPrice="$"+totPrice.toFixed(2);
			theForm.fldTotPrice.value=totdPrice;
		}
	}
}
function ValForm(Web)
{		
	theForm=document.frmContainer;
	theForm=document.frmContainer;
	cnt=theForm.fldhNumRows.value;
	maxQty=theForm.fldhContainerQty.value;
	calcTotals();
	if(!(isNaN(totQty)))
	{
		if(maxQty>totQty)
		{
			alert("You have only selected "+totQty+" items. Please select "+(maxQty-totQty)+" more items.");
			return false;
		}
		else
		{
			if(maxQty<totQty)
			{
				alert("You have selected "+totQty+" items. Please select "+(totQty-maxQty)+" fewer items.");
				return false;
			}
			else
			{
				container=Web+"/DDGAssets/Cart/Cart.php?";
				container+=String(theForm.fldhCartID.value+'&'+theForm.fldhContainerID.value+'&'+theForm.fldhContainerColorID.value);	
				for(i=0;i<cnt;i++)
				{
					ProdID=String('fldhProdID'+String(i));
					Color=String('fldhColor'+String(i));
					Size=String('fldhSize'+String(i));
					Qty=String('fldQty'+String(i));
					if(document.getElementById(Qty).value>0)
					{
						container+=String('&'+document.getElementById(ProdID).value+'&'+document.getElementById(Color).value+'&'+document.getElementById(Size).value+'&'+document.getElementById(Qty).value);
					}
				}
				theForm.action=container;
				theForm.submit();
			}
		}
	}
	else
	{
		return false;
	}
}
