﻿function FSfncCheckNumber(FormField,TheMessage,AllowBlank,PositiveOnly,IntegerOnly) {
	// AllowBlank, PositiveOnly, and IntegerOnly are optional
	if ((isNaN(FormField.value)) || (FormField.value.search(/\s/g)>-1)) {alert(TheMessage); FormField.focus(); return false}
	if ((AllowBlank==false) && (FormField.value=="")) {alert(TheMessage); FormField.focus(); return false}
	if ((PositiveOnly) && (FormField.value<0)) {alert(TheMessage); FormField.focus(); return false}
	if ((IntegerOnly) && (FormField.value.indexOf(".")>-1)) {alert(TheMessage); FormField.focus(); return false}
	return true;
	}

function FSfncCheckString(FormField,TheMessage,AllowBlank,MaxLength) {
	// MaxLength is optional, when not provided the string is only checked for being blank.
	if ((AllowBlank==false) && (FormField.value=="")) {alert(TheMessage); FormField.focus(); return false}
	if ((MaxLength!="") && (FormField.value.length>MaxLength)) {alert(TheMessage); FormField.focus(); return false}
	return true;
	}
