function CommaFormatted(amount)
{
	var delimiter = ","; // replace comma if desired
	var a = amount.split('.',2)
	var d = a[1];
	var i = parseInt(a[0]);
	if(isNaN(i)) { return ''; }
	var minus = '';
	if(i < 0) { minus = '-'; }
	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(delimiter);
	if(d.length < 1) { amount = n; }
	else { amount = n + '.' + d; }
	amount = minus + amount;
	return amount;
}
function fmtPrice(value) {
result=Math.floor(value);
var cents=100*(value-Math.floor(value))+0.5;

return result;
}
function calculate()
{
	surveys = document.calform.surveys.value;
	avmoney = 20;
	sdays = document.calform.sdays.value;
	cfocus = document.calform.cfocus.value;
	avfocus = 55;
	fdays = document.calform.fdays.value;

	weekly = ((surveys * avmoney * sdays) + (cfocus * avfocus * fdays));
	monthly = weekly * 4;
	yearly = weekly * 52;
	
	weekly_res = fmtPrice(weekly);
	monthly_res = fmtPrice(monthly);
	yearly_res = fmtPrice(yearly);

    d = document.getElementById("weekly3");
	d.innerHTML = "$" + weekly_res;
	d = document.getElementById("monthly3");
	d.innerHTML = "$" + monthly_res;
	d = document.getElementById("yearly3");
	d.innerHTML = "$" + yearly_res;

	return false;
	
}