function listProductQtyCheck(n) {

	var formName		= document.forms[0].name;
	var CountUp			= 0;
	var validCharacters = "0123456789.";

	for (n-- ;n >= 0; n--) {

		var textBit = "QTY";
		if (n < 10) textBit += "0";
		if (n < 100) textBit += "0";
		textBit += n;

		var stringContent = eval('document.' + formName + '.' + textBit + '.value');

		CountUp += (stringContent - 0);

		var j = stringContent.length;

		if (stringContent != "") {

			for (i = 0; i < j; i++) {

				var thisCharacter = stringContent.charAt(i);
				if (validCharacters.indexOf(thisCharacter) == -1) {
					window.alert('One or more of the fields contains invalid characters');
					return false;
				}
			}
		}
	}
	if (CountUp == 0) {
		window.alert('You must select more than 0 items to add to your cart');
		return false;
	}

	return true;
}

function listProductSelectQtyCheck(formName)
{
	var n   			= eval('document.' + formName + '.productcount.value');
	var qtyCount		= 0;
	var validCharacters = "0123456789.";

	for (n-- ; n >= 0; n--)
	{
		var 			textBit = "QTY";
		if (n < 10) 	textBit += "0";
		if (n < 100)	textBit += "0";
		
		textBit += n;

		var qty = eval('document.' + formName + '.' + textBit);

		if (qty.selectedIndex > 0) qtyCount++;
	}
	if (qtyCount == 0)
	{
		window.alert('You must select more than 0 items to add to your cart');
		return false;
	}
	return true;
}

function MultipleFormListProductQtyCheck(formName, n) {

	var CountUp			= 0;
	var validCharacters = "0123456789.";

	for (n-- ;n >= 0; n--) {

		var textBit = "QTY";
		if (n < 10) textBit += "0";
		if (n < 100) textBit += "0";
		textBit += n;

		var stringContent = eval('document.' + formName + '.' + textBit + '.value');

		CountUp += (stringContent - 0);

		var j = stringContent.length;

		if (stringContent != "") {

			for (i = 0; i < j; i++) {

				var thisCharacter = stringContent.charAt(i);
				if (validCharacters.indexOf(thisCharacter) == -1) {
					window.alert('One or more of the fields contains invalid characters');
					return false;
				}
			}
		}
	}
	if (CountUp == 0) {
		window.alert('You must select more than 0 items to add to your cart');
		return false;
	}
	return true;
}

