// VARIAVEIS GLOBAIS //
var const_WhiteChars = ' \t\n\r';
// isEmpty() //
String.prototype.isEmpty = function(){
	var iCount, sChar;
	if(this==null || this.length<=0)
		return true;
	for(iCount=0; iCount<this.length; iCount++){
		sChar = this.charAt(iCount);
		if(const_WhiteChars.indexOf(sChar)==-1) return false;
	}
	return true;
}
// Trim() //
String.prototype.Trim = function(){
	var iCount, iPos, sChar, sValor1=this;
	if(sValor1==null || sValor1.length<=0)
		return;

	for(iCount=0; iCount<const_WhiteChars.length; iCount++){
		sChar = const_WhiteChars.substr(iCount,1);
		while(sValor1.indexOf(sChar)>=0){
			sValor1 = sValor1.replace(sChar,'');
		}
	}
	return sValor1;
}
// Left(iQtde) //
String.prototype.Left = function(iQtde){
	return this.slice(0, iQtde);
}
// Right(iQtde) //
String.prototype.Right = function(iQtde){
	return this.slice(iQtde, this.length);
}

String.prototype.isValidEmail = function(){
	pattern = new RegExp("^([0-9,a-z,A-Z]+)([.,_,-]([0-9,a-z,A-Z]+))*[@]([0-9,a-z,A-Z]+)([.,_,-]([0-9,a-z,A-Z]+))*[.]([a-z,A-Z]){2,3}([0-9,a-z,A-Z])?$");
	if(this.search(pattern) == -1)
		return false;
	else
		return true;
}