if ('undefined' == typeof(String.prototype.ltrim)) {
	String.prototype.ltrim = function() {
		return this.replace(/^\s+/, '');
	}
}

if ('undefined' == typeof(String.prototype.rtrim)) {
	String.prototype.rtrim = function() {
		return this.replace(/\s+$/, '');
	}
}

if ('undefined' == typeof(String.prototype.trim)) {
	String.prototype.trim = function() {
		return this.replace(/^\s+/, '').replace(/\s+$/, '');
	}
}

function submitOnEnter(form_id)
{
	if (event.keyCode == 13 && typeof document.getElementById(form_id) != 'undefined')
		document.getElementById(form_id).submit();
}