function NumberFormat(value, decimals, decimalDelimiter, thousandsDelimiter){
	if (isNaN(decimals)){
	   decimals = 2;
	}
	if (isNaN(decimalDelimiter)){
	   decimalDelimiter = ".";
	}
	if (isNaN(thousandsDelimiter)){
	   thousandsDelimiter = ",";
	}
	
	var negative = false;
	var s;
	var fltValue = parseFloat(value);
	
	if(isNaN(fltValue)) { fltValue = 0.00; }
	if(fltValue < 0) { negative = true; }
	fltValue = Math.abs(fltValue);
	fltValue = parseInt((fltValue + .005) * 100);
	fltValue = fltValue / 100;
	s = new String(fltValue);
	if(s.indexOf('.') < 0) { s += '.00'; }
	if(s.indexOf('.') == (s.length - 2)) { s += '0'; }
	var a = s.split('.',2)
	var d = a[1];
	var i = parseInt(a[0]);
	if(isNaN(i)) { return s; }
	i = Math.abs(i);
	var n = new String(i);
	var a = [];
	while(n.length > 3)
	{
		var nn = n.substr(n.length-3);
		a.unshift(nn);
		n = n.substr(0,n.length-3);
	}
	if(n.length > 0) { a.unshift(n); }
	n = a.join(thousandsDelimiter);
	if(d.length < 1) { s = n; }
	else { s = n + '.' + d; }
	if(negative){
		s = '-' + s;
	}
	return s;
}