function trim(strText) {
	// this will get rid of leading/trailing spaces 
	return ltrim(rtrim(strText));
}

//------------------------------------------------------------------------ 

function ltrim(strText) { 
	// this will get rid of leading spaces 
	while (strText.charCodeAt(0) == 160 || strText.charCodeAt(0) == 32)
	strText = strText.substring(1, strText.length)
	return strText;
}

//------------------------------------------------------------------------

function rtrim(strText){
	// this will get rid of trailing spaces 
	while (strText.charCodeAt(strText.length-1) == 160 || strText.charCodeAt(strText.length-1) == 32) 
	strText = strText.substring(0, strText.length-1); 
	return strText;
}

//------------------------------------------------------------------------


