//quantity_check function. Javascript based, coded 8/4/2003 by Sean Corrales. Checks all fields upon submit to make
//sure the user has inserted at least one numeric value.

function quanity_check(Frm)	//declare function
	{

	var counter=0;		//keeps track of variables with numeric info
	var blank="";		//defines a blank variable

	for (var i=0; i<Frm.elements.length; i++)     //cycles through all form elements.
	    {
	    if(Frm.elements[i].value != blank)        //checks to see if the element is blank
		{
		   numReg = "^[0-9]+$"		  		//numeric regular expression	
	           var regex = new RegExp(numReg);		//er..regular expression test?
		   if (regex.test(Frm.elements[i].value)) {	//tests the element for numerals
			counter++				//increments the counter if they entered a quantity
		   }
		}
	     }
	if (counter==0) 	//If the script found no valid results, sends error message and does not let them proceed.
	   {
	      	alert("You must enter a numeric quantity for the product(s) you wish to purchase.");
		return false;
	   }


	}



