function check_max(form_arg,max_str) {
	var str = form_arg.value;
	if (str.length > max_str) {
		alert('This field is limited to ' + max_str + ' characters and will be truncated.');
		form_arg.value = str.substring(0,(max_str-1));
	}
	return true;
}

function clean_text(form_arg) {
	var str = form_arg.value;

	// remove special characters like "$" and "," etc...
	re = /\$|,|@|#|~|`|\%|\*|\^|\&|\(|\)|\+|\=|\[|\-|\_|\]|\[|\}|\{|\;|\:|\'|\"|\<|\>|\?|\||\\|\!|\$|\./g;
	form_arg.value = str.replace(re, "");

	return true;
}
