function trim(a) {
	if (!a) return "";
	a = a.replace(/^\s+/, '');
	return a.replace(/\s+$/, '');
}