String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}
String.prototype.ltrim = function() {
	return this.replace(/^\s+/,"");
}
String.prototype.rtrim = function() {
	return this.replace(/\s+$/,"");
}

//object for error checking
var validationSet = {
  'email': {
	'require':true,
    'regexp': /^.+?@.+?\..+$/,
    'error': 'This email address is invalid. ' +
        'It should be of the form someone@example.com.'		
  },
  'name': {
	 'require':true,
    'regexp': /^\w+$/,
    'error': 'The name should contains character and number only.' 
  }
};
//put the required field into array
var requiredSet = ['name','email','message'];
