
function calc() {

	income=document.f1.income.value
	income=delDigits(income);


	if (isNaN(income))
	{	document.f1.d10.value = "0.00";
		document.f1.day5.value = "0.00";
		document.f1.day4.value = "0.00";
		document.f1.day3.value = "0.00";
		return	}

	if (income < 20000)
	{	
		document.f1.d10.value = "0.00";
		document.f1.day5.value = "0.00";
		document.f1.day4.value = "0.00";
		document.f1.day3.value = "0.00";
		return
	}

	if (income > 40000)
	{
		document.f1.d10.value =  round2penny((income - 40000) * .3/12 + 2000/12);
		document.f1.day5.value =  round2penny( ((income - 40000) * .3/12 + 2000/12)/21.75 );
		document.f1.day4.value =  round2penny( ((income - 40000) * .3/12 + 2000/12)/17.4 );
		document.f1.day3.value =  round2penny( ((income - 40000) * .3/12 + 2000/12)/13.05 );
		return
	}

	document.f1.d10.value =  round2penny((income - 20000) * .1/12);
	document.f1.day5.value =  round2penny( ((income - 20000) * .1/12)/21.75	);
	document.f1.day4.value =  round2penny( ((income - 20000) * .1/12)/17.4	);
	document.f1.day3.value =  round2penny( ((income - 20000) * .1/12)/13.05	);
	


	return;
}


function delDigits(n) {
var s = String(n);
var n2 = String();
for(var i = 0; i < s.length; i++) {
   var ss = s.substr(i,1);
   if(ss >= '0' && ss <= '9' || ss ==".") { n2 = n2 + ss; }
   }
return n2;
}


function round2penny(num){
 num = Math.round(num*100)/100;
 num += "";
 if(num.indexOf(".") == -1){num += ".00"}
 if ( (num.length - num.indexOf("."))<3) {num+="0"} ;
 return ("$ " +  num);
}

