function isAlphabetic(str)
{
   var boolResult = true;
   var intLength = String(str).length;
   
   for (i = 0; i < intLength; i++)
   {
	  boolResult = (boolResult) && (str.charAt(i) >= 'A') && (str.charAt(i) <= 'Z');
   }
   
   return boolResult;
}



function isAlphanumeric(str)
{
   var boolResult = true;
   var intLength = String(str).length;
   
   for (i = 0; i < intLength; i++)
   {
	  boolResult = (boolResult) && (((str.charAt(i) >= 'A') && (str.charAt(i) <= 'Z'))
	                                ||
								    ((str.charAt(i) >= '0') && (str.charAt(i) <= '9')));
   }
   
   return boolResult;
}



function validateOptionsForm(form,isCheckStockLevel) 
{
   //!!alert('validateOptionsForm, version 9');   //!! 
   var boolResult = false;
   var warningMsg = new String("");
   var errorMsg = new String("");
   var strQty = String(form.qty.value);
   var intQty = ((strQty == "undefined") || (strQty == "null") || (strQty == "") || (Number(strQty) == NaN)) ? 0 : Number(strQty); 
   var strMaxQty = String(form.maxqty.value);
   var intMaxQty = ((strMaxQty == "undefined") || (strMaxQty == "null") || (strMaxQty == "") || (Number(strMaxQty) == NaN)) ? 0 : Number(strMaxQty); 
   
   if (intQty <= 0)
   {
      errorMsg += "ERROR: You must specify the number of products you wish to buy!\n";
	  form.qty.focus();
   }
   else if ((isCheckStockLevel) && (intQty > intMaxQty))
   {
      errorMsg += "ERROR: You have specified more of this product than we have in stock!\nPlease reselect the quantity up to a maximum of " + strMaxQty + "\n";
	  form.qty.focus();
   }
   
   if (errorMsg.length <= 0)
   { 
      boolResult = (warningMsg.length <= 0) ? true : (confirm(warningMsg + "\nClick OK if your option selections are as intended, or Cancel to correct them.\n"));
   }
   else
   {
	  alert(errorMsg + warningMsg + "\nClick OK to correct your option selections.\n");
      boolResult = false;
   }
   
   document.returnValue = (boolResult);
}
