function ksCheckProdForm(form) {
	var e, title, tmpindx, iQuantity, quantity_check, msg, upperLine, lowerLine, myattribute_select
	msg = "";
	for (var i = 0; i < form.elements.length; i++)
  {
		e = form.elements[i]
		if ((e.title == null)||(e.title == "")) {
			title = e.name;
		}
		else {
			title = e.title;
		}
	if (e.quantityBox) {
		iQuantity = e.value;
		if (!isNumber(iQuantity)) {
			quantity_check = true;
		}
		if (parseInt(iQuantity) < 0) {
			quantity_check = true;
		}
		if ((iQuantity) < 1) {
			quantity_check = true;
		}
	}
	if (e.name == "attr1") {
		tmpindx = e.selectedIndex
		if (e.options[tmpindx].value < 1) {
			myattribute_select = true;
		}
	}
	if (e.name == "attr2") {
		tmpindx = e.selectedIndex
		if (e.options[tmpindx].value < 1) {
			myattribute_select = true;
		}
	}
	if (e.name == "attr3") {
		tmpindx = e.selectedIndex
		if (e.options[tmpindx].value < 1) {
			myattribute_select = true;
		}
	}
  }

	if (!quantity_check && !myattribute_select) {return true}
	msg = "Please correct the following and try adding\nthe product to your Shopping Cart again: \n";
	upperLine = "\n___________________________________________________\n\n";
	lowerLine = "___________________________________________________\n";
	if (quantity_check) {
		msg += upperLine;
		msg += "Please enter a valid Quantity value.\n"
		msg += lowerLine;
	}
	if (myattribute_select) {
		msg += upperLine;
		msg += "Please make a selection from the product's drop down attribute list(s).\n"
		msg += lowerLine;
	}
	alert(msg);
	return false;
}	


function isNumber(value) {
	for (var i=0; i < value.length; i++) {
		a = parseInt(value.charAt(i));
		if (isNaN(a)) {
			return false;			
			break;
		}
	}
	return true;
}
