function trim(str) {
	str = new String(str);
	str = str.replace(/^\s*|\s*$/g,'');
	return str;
}