function ltrim(str) {
	var LTRIMrgExp = /^\s */;
	return str.replace(LTRIMrgExp, '');
}

function rtrim(str) {
	var RTRIMrgExp = /\s *$/;
	return str.replace(RTRIMrgExp, '');
}

function trim(str) {
	return ltrim(rtrim(str));
}

function minLength(oText, len) {
	if (oText.length >= len) return true
	return false;
}
function maxLength(oText, len) {
	if (oText.length <= len) return true
	return false;
}

function submitorder() {
	$("#act").val('order');
	document.adminform.submit();	
}
function addCommas(nStr)
{
	while (nStr.indexOf('.') != -1) {
		nStr = nStr.replace('.','');
	}
	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;
}
