<!--
//**************************************************************************************************
//*	function included:
//*		trim
//*		isEmpty
//*		getLength
//**************************************************************************************************

//@ trim the leader and tailer space
String.prototype.trim = function(){
	return this.replace(/^\s*/,"").replace(/\s*$/,"");
}


//@ remove any space in the string so as to determine the string is empty or not
String.prototype.isEmpty = function(){
	var bEmpty = false;

	bEmpty = (this.replace(/ /g, "").length == 0) ? true : false;
	return (bEmpty)
}

//@ get the length of the textfield
String.prototype.getLength = function(){
	var l = 0;
	var charCount = 0;
	var charPosition = 0;

	if (this.isEmpty()){
		return (0);
	} else{
		for (charPosition = 0; charPosition < this.length; charPosition++){
			(this.charCodeAt(charPosition) >= 256) ? charCount += 2 : charCount++;
		}

		return (charCount);
	}
}
//-->