
function isValidHost(s) {
	var regexp = /^(http:\/\/)?((([0-9]{1,3}\.){3}[0-9]{1,3})|([0-9a-z-.]{0,61})?\.[a-z]{2,4})$/i
	return regexp.test(s);
}

function trim(str) { return str.replace(/^\s+|\,|\s+$/g,''); }
function ltrimslash(str) { return str.replace(/^\//, ''); }
function ltrimhash(str) { return str.replace(/^\#/, ''); }						
function rtrimslash(str) { return str.replace(/\/$/, ''); }
function ltrim(str) { return str.replace(/^\s+/, ''); }
function rtrim(str) { return str.replace(/\s+$/, ''); }
function alltrim(str) { return str.replace(/^\s+|\s+$/g, ''); }

function addCommas(nStr){
	nStr += '';
	x = nStr.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {
		x1 = x1.replace(rgx, '$1' + ',' + '$2');
	}
	return x1 + x2;
}
