	// description: set of custom extensions to the String object that may prove useful
	//

	function parseNumberString(str)
	{
		// returns a number STRING from a given string
		// parses input string and returns a concatenated string of all the numbers embedded in it
		// (e.g. "3 blind mice and 2 dogs" returns "32")
		// (usage: str.parseNumber();)
		//

		str = (this != window)? this : str;

		var filteredNumber = "";

		if (str != "")
		{
			for (i = 0; i < str.length; i++)
			{
				var character = str.charAt(i);

				if(!isNaN(parseInt(character)))
				{
					filteredNumber += character;
				}
			}
		}

		return filteredNumber;
	}
	String.prototype.parseNumber = parseNumberString;

	function checkLengthString(testLength)
	{
		// simply tests the length of a string against a given number
		// (usage: str.checkLength(number);)
		//
		// can also check against a given length range expressed as "minLength-maxLength":
		// (usage: str.checkLength(2-6);)
		//

		var checkValue = false;
		var rangeArray = (testLength + "").split("-"); // ensure testLength is converted to a string and split on "-" character... if the resulting array has a length greater than one then a range was supplied
		if(rangeArray.length > 1)
		{
			var minLength = rangeArray[0].parseNumber();
			var maxLength = rangeArray[1].parseNumber();
			var maxLength = (maxLength == "")? 999999 : maxLength;	// if no max length was supplied default to "infinate" length (999,999 characters)
			checkValue = (this.length >= minLength && this.length <= maxLength)? true : false;
		}
		else
			checkValue = (this.length == testLength)? true : false;
		return checkValue;
	}
	String.prototype.checkLength = checkLengthString;

	function reverseString(str)
	{
		// reverses the string altogeher... useful for working a number backwards to forwards
		// one digit at a time (requires conversion of number to string of course)
		// (e.g. "foo.reverse()" returns "oof")
		// (usage: str.reverse();)
		//

		str = (this != window)? this : str;
		return str =  str.split('').reverse().join('');

	}
	String.prototype.reverse = reverseString;

	function trimString(str)
	{
		// trims white space off beginning and end of string
		// (usage: str.trim();)
		//

  		str = (this != window)? this : str;
		return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
	}
	String.prototype.trim = trimString;

