function trimAll(strText) {

	// Returns the passed string with all of the spaces removed.

	input = new String(strText);
	output = new String();

	for(counter=0;counter<=input.length;counter++)
	{
		if(input.charAt(counter)!=" ")
			output+=input.charAt(counter);
	}
	
	return output;

}

function trim(strText) {

	// Returns the passed string with the leading and trailing spaces removed.
	
	input = new String(strText);
	output = new String();
	start = 1;
	end = 0;

	for(counter=0;counter<=input.length-1;counter++)
	{
		if (input.charAt(counter)!=" ") 
		{
			start = counter;
			break;
		}
	}

	for(counter=input.length-1;counter>=0;counter--)
	{
			
		if (input.charAt(counter)!=" ")
		{
			end = counter+1;
			break;
		}
	}
				
	if(end<start) 
		output = "";
	else
		output = input.substring(start, end);
			
	return output;
	
}