function ltrim ( s )
	{
		return s.replace( /^\s*/, "" )
	}

	function rtrim ( s )
	{
		return s.replace( /\s*$/, "" );
	}

	//Combine the rtrim() and ltrim() functions to make the trim() function, which just wraps both calls together:

	function trim ( s )
	{
		return rtrim(ltrim(s));
	}

	