function trim(strText) { 

	// this will get rid of leading spaces 
	while (strText.charCodeAt(0) == 160)
		strText = strText.substring(1, strText.length); //remove invisible space
	while (strText.substring(0,1) == ' ') 
		strText = strText.substring(1, strText.length);

	// this will get rid of trailing spaces 
	while (strText.substr(strText.length-1,1).charCodeAt(0) == 160)
		strText = strText.substring(0, strText.length-1);
	while (strText.substr(strText.length-1,1) == ' ')
		strText = strText.substring(0, strText.length-1);

	return strText;
} 

