function trim(inputString) 
{
	return inputString.replace(/^\s+|\s+$/g, ''); 
}

String.prototype.trim = function()
{
	return trim(this);	
}

function space(char)
{
	var space = " .,/<>?!`';:@#$%^&*()=-|[]{}" + '"' + "\\\n\t";
	
	for (var i = 0; i < space.length; i++)
	{
		if (char == space.charAt(i))
		{
			return true;	
		}
	}
	if (char == "")
	{
		return true;	
	}
	
	if (char == null)
	{
		return true;	
	}
	
	return false;
}

String.prototype.indexOfWord = function(word, start)
{
	var index = this.indexOf(word, start);
	
	if (index == -1)
	{
		return -1;
	}
	
	var start, end		// Booleans // is the start/end of the word a word break
	
	start = (index == 0);
	if (start == false)
	{
		start = space(this.charAt(index - 1));
	}
	
	end = (index + word.length == this.length);
	if (end == false)
	{
		end = space(this.charAt(index + word.length));
	}
	
	if (start && end == true)
	{
		return index;
	}
	else
	{
		if (index + word.length > this.length)
		{
			return -1;
		}
		else
		{
			return this.indexOfWord(word, index + word.length);
		}
	}
}

String.prototype.removeWord = function(word, start)
{
	var index = this.indexOfWord(word, start)
	
	if (index != -1)
	{
		return this.substring(0, index) + this.substring(index + word.length, this.length);
	}
	else
	{
		return this;
	}
}
