function TestInputIsNumber(e)
{
	var key;
	var keychar;
	var reg;
	
	if(window.event) {
		// for IE, e.keyCode or window.event.keyCode can be used
		key = e.keyCode; 
	}
	else if(e.which) {
		// netscape
		key = e.which; 
	}
	else {
		// no event, so pass through
		return true;
	}
	
	keychar = String.fromCharCode(key);
	reg = /\d|[\b]/;
	return reg.test(String.fromCharCode(key));
}

function openwindow(url,name,properties,width, height)
{
	winleft = Math.round((screen.width - width)/2);
	wintop = Math.round((screen.height - height)/2);

	window.open(url, name, properties + ",left="+winleft+",top="+wintop+",width="+width+",height="+height);
}

String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}
String.prototype.ltrim = function() {
	return this.replace(/^\s+/,"");
}
String.prototype.rtrim = function() {
	return this.replace(/\s+$/,"");
}