// general purpose function to see if a suspected numeric input // is a positive integer function isPosInteger(inputVal) { inputStr = inputVal.toString() for (var i = 0; i < inputStr.length; i++) { var oneChar = inputStr.charAt(i) if (oneChar < "0" || oneChar > "9") { return false } } return true }