function trim(str) {
	str = str.replace(/^\s+/g, ""); 
	str = str.replace(/\s+$/g, ""); 
	return str; 
}