function formValidator() {
	// set up array to hold error messages
	this.errorList = new Array;

	// set up object methods
	this.isEmpty = isEmpty; 
	this.isNumber = isNumber;
	this.raiseError = raiseError; 
	this.numErrors = numErrors; 
	this.displayErrors = displayErrors; 
}

function isEmpty(val) {
	if (val.match(/^s+$/) || val == "") {
		return true;
	} else {
		return false;
	} 
}

function isNumber(val) {
	if (isNaN(val)) {
		return false;
	} else {
		return true;
	} 
}

function displayErrors() {
	for (x=0; x<this.errorList.length; x++) {
		alert("Error: " + this.errorList[x]);
	}
}

function raiseError(msg) {
	this.errorList[this.errorList.length] = msg;
}

function numErrors() {
	return this.errorList.length;
}
