<!--
// extend String object to provide regular expression matching against defined patterns:
var INT 		= /^-{0,1}\d+$/
var POS_INT 	= /^\d*$/;
var NEG_INT 	= /^-\d+$/;
var NONZERO_INT 	= /^[1-9]+\d*$/;
var NUMBER 		= /^-{0,1}\d*\.{0,1}\d+$/;
var POS_NUMBER 	= /^\d*\.{0,1}\d+$/;
var NEG_NUMBER 	= /^-\d*\.{0,1}\d+$/;
var ALPHA		= /^[A-Z]+$/i;
var ALPHPASPACE	= /^[A-Z ]+$/i;
var ALPHANUM	= /^[A-Z0-9]+$/i;
var ALPHANUMSPACE = /^[A-Z0-9 ]+$/i;
var EMAIL		= /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i;
var NAME		= /^[A-Z .'-]+$/i;

String.prototype.isType = function(regex) {
	if (this.match(regex)) {
		return true;
	}
	else {
		return false;
	}
}

// extend String object to provide function to trim whitespace
String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}

// extend String object to provide function to trim whitespace
// and convert inner whitespace sequences to single spaces
String.prototype.trimAndCompact = function() {
	return this.replace(/^\s+|\s+$/g,"").replace(/\s+/g, ' ');
}
//-->
