function isNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }
   
function validateAddToBasket(sQuantity,sPersonalisation) {

	var sError = '';
	if (! isNumeric(sQuantity)) {
		sError += 'The quantity must be numeric.\n';
	}
	if (sPersonalisation.length == 0) {
		sError += 'Personalisation information is required.\n';
	}
	if (sError.length > 0) {
		alert('Please correct the following errors:\n\n' + sError);
		return false;
	}
	else {
		return true;
	}
}
