String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}

String.prototype.emailcheck = function(){
	var emailRegEx = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if(this.match(emailRegEx)){ return true;}
	else {return false;}
}

String.prototype.isNumeric4 = function() {
  var objRegExp  =  /^\d{4}$/;
  //check for numeric characters
  if(this.match(objRegExp)){ return true;}
  else {return false;}
}

String.prototype.isNumeric3 = function() {
  var objRegExp  =  /^\d{1,2}$/;
  //check for numeric characters
  if(this.match(objRegExp)){ return true;}
  else {return false;}
}

String.prototype.isDate = function() {
  var objRegExp  =  /(19|20)[0-9]{2}[\/](0[1-9]|1[012])[\/](0[1-9]|[12][0-9]|3[01])$/;
  //check for numeric characters
  if(this.match(objRegExp)){ return true;}
  else {return false;}
}

String.prototype.XSS = function()
{
var myregexp = /[^&_@\-\w\sa-zA-Z0-9]/i;

this.value = this.value.replace(/[^&_@\-\w\sa-zA-Z0-9]/ig, " ");
this.value = this.value.replace(/\s+/ig, " ");
this.value = this.value.trim();
}