/*
   With thanks to joe crawford who created this handy script on 12/14/2001.
*/
function howManyChecked(whichForm,whichCheckBoxArray,myMax,myMin,whichQuestion)
{
	var _countChecked = 0;
	var err = 0;
	/* iterate through all the elements in the checkbox array */
	for(i=0;i<document[whichForm][whichCheckBoxArray].length;i++)
	{
		/* and check to see if each is checked */
		   if(document[whichForm][whichCheckBoxArray][i].checked==true)
				/* if it is, increment a counter */
				      { _countChecked++; }
				      }
				      /* is the count too high? */
				      if(_countChecked > myMax)
						       { alert('Limit '+myMax+' checks for the '+whichQuestion+' question.');
								      err = 1;}
								      /* of is the count too low */
								      else if(_countChecked < myMin)
									   { alert('Please place a check mark in the box to the left of the book(s) you wish to order.');
											err = 1;}
											if (err == 1) { return false; }
}
