// trim prototype
String.prototype.trim = function () {return this.replace(/^\s*/, "").replace(/\s*$/, "");}

// validate email address
function validateEmail(emailStr){
	// email regex
	var emailRegEx = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	// check email string
	if(emailStr.match(emailRegEx))
		return true;
	else
		return false;
}
