//Client Side Validation File
/*var isNS4 = (navigator.appName=="Netscape")?1:0;
enteredvalue=0;
//function OnlyNum()
{
	if (!isNS4)
	{
		if (event.keyCode < 45 || event.keyCode > 57)
			event.returnValue = false;
	}
	else
	{
		if (event.which < 45 || event.which > 57)
			return false;
	}
enteredvalue=enteredvalue+1;
}
*/
// calculate the ASCII code of the given character
var enteredvalue=0;
function CalcKeyCode(aChar) {
  var character = aChar.substring(0,1);
  var code = aChar.charCodeAt(0);
  return code;
}

function checkNumber(val,val_qty_lim) {
	
  var strPass = val.value;
  if(eval(strPass)<eval(val_qty_lim))
  {
	alert("Quantity must be atleast "+eval(val_qty_lim)+" or more. ");
	return false;
  }

   var strLength = strPass.length;
  var lchar = val.value.charAt((strLength) - 1);
  var cCode = CalcKeyCode(lchar);
enteredvalue=enteredvalue+1;
  /* Check if the keyed in character is a number
     do you want alphabetic UPPERCASE only ?
     or lower case only just check their respective
     codes and replace the 48 and 57 */
	
  if (cCode < 48 || cCode > 57 ) {
    var myNumber = val.value.substring(0, (strLength) - 1);
   // val.value = myNumber;
val.value=""
alert ("Please enter a proper quantity")
	enteredvalue=enteredvalue-1;
  }
  return false;
}


