/**************************************************************************
Javascript Trim Member Functions

Use the code below to make trim a method of all Strings. These are useful to place in a global Javascript file included by all your pages. 

How to use :
<SCRIPT LANGUAGE="JavaScript" TYPE="text/JavaScript" SRC="/javascripts/trim.js"></SCRIPT>

// example of using trim, ltrim, and rtrim
var myString = " hello my name is ";
alert("*"+myString.trim()+"*");
alert("*"+myString.ltrim()+"*");
alert("*"+myString.rtrim()+"*");

Author by Allen Chen, 2004/07/30
***************************************************************************/
<!--
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+$/,"");
}
-->