//This script file is used to provide generic utility functions

//Make sure only numbers are entered.  An event object must be passed.  
//False is returned if the event character code is not numeric.  Backspaces
//are supported.
//
//Example usage:
//<form:input path="phoneAreaCode" size="3" maxlength="3" onkeypress="return numCheck(event);"/>
//
function numCheck(e){
	var unicode=e.charCode? e.charCode : e.keyCode
	if ((unicode != 8) && (unicode != 9)){ //if the key isn't the backspace key (which we should allow)
		if (unicode < 48||unicode > 57) { //if not a number
			return false //disable key press
		}
	}
}


function numDecimalCheck(e){

	if(numCheck(e) == false) {

		var unicode=e.charCode? e.charCode : e.keyCode
		if(unicode != 46) {
			return false;
		}
	}
}
