
	function calcTaxCreditDollar(form) {
		t3 = eval(form.txt3.value);
		t2 = eval(form.txt2.value);
		//alert(t3 * t2);

		form.txt4.value = t2 * t3;
		//alert(form.txt4.value);
		
		return;
	}
	
	function goToDepCareCost(form) {
		calcTaxableIncome(form);
		findMarginalTax(form);
	}

	function calcTaxableIncome(form) {
	    form.txt6.value = Math.abs(form.txt6.value) * -1;
	    form.txt7.value = Math.abs(form.txt7.value) * -1;
		form.txt8.value = form.txt5.value - Math.abs(form.txt6.value) - Math.abs(form.txt7.value);
		//alert(form.txt8.value);
		return;
	}
	
	function findMarginalTax2005(form) {
		var tax_table = new Array();
		
		var theone;
		for (i=0;i<form.rdoFilingStatus.length;i++) {
			if (form.rdoFilingStatus[i].checked==true) {
				theone=i;
				break; 
				//exist for loop, as target acquired.
			}
		}

		var filing_status = form.rdoFilingStatus[theone].value;

		if (filing_status == 'single') {
		
			tax_table[1] = [0,7150,0.2365];
		
			tax_table[2] = [7151,29050,0.2865];
		
			tax_table[3] = [29051,70350,0.4065];
		
			tax_table[4] = [70351,146750,0.4365];
		
			tax_table[5] = [146751,100000000,0.4665];
		
		} else {
		
			tax_table[1] = [0,14300,0.2365];
		
			tax_table[2] = [14301,58100,0.2865];
		
			tax_table[3] = [58101,117250,0.4065];
		
			tax_table[4] = [117251,178650,0.4365];
		
			tax_table[5] = [178651,100000000,0.4665];
		
		}
		// determine the array item count -- use for outer boundaries of loop
		var table_length = tax_table.length;
		var income = form.txt8.value;
		//alert(income);

		// loop through tax table array to find what tax credit rate to use for income input
		var x;
		for (x = 1; x < table_length; x++) {
			//alert(tax_table[x][1]);
			if (income >= tax_table[x][0] && income <= tax_table[x][1]) {
				form.txt9.value = tax_table[x][2];
				return;
			}
			// no tax credit rate was found
			//doc.txt9.value = 0;
		}
		alert(form.txt9.value);
		return;
	}

	function findMarginalTax2007(form) {
		var tax_table = new Array();
		
		var theone;
		for (i=0;i<form.rdoFilingStatus.length;i++) {
			if (form.rdoFilingStatus[i].checked==true) {
				theone=i;
				break; 
				//exist for loop, as target acquired.
			}
		}

		var filing_status = form.rdoFilingStatus[theone].value;

		if (filing_status == 'single') {
		
			tax_table[1] = [0,7825,0.2365];
		
			tax_table[2] = [7826,31850,0.2865];
		
			tax_table[3] = [31851,77100,0.3865];
		
			tax_table[4] = [77101,160850,0.4165];
		
			tax_table[5] = [160851,349700,0.4665];

			tax_table[6] = [349701,100000000,0.4865];
		
		} else {
		
			tax_table[1] = [0,15650,0.2365];
		
			tax_table[2] = [15651,63700,0.2865];
		
			tax_table[3] = [63701,128500,0.3865];
		
			tax_table[4] = [128501,195850,0.4165];
		
			tax_table[5] = [195851,349700,0.4665];
		
			tax_table[6] = [349701,100000000,0.4865];
		
		}
		// determine the array item count -- use for outer boundaries of loop
		var table_length = tax_table.length;
		var income = form.txt8.value;
		//alert(income);

		// loop through tax table array to find what tax credit rate to use for income input
		var x;
		for (x = 1; x < table_length; x++) {
			//alert(tax_table[x][1]);
			if (income >= tax_table[x][0] && income <= tax_table[x][1]) {
				form.txt9.value = tax_table[x][2];
				return;
			}
			// no tax credit rate was found
			//doc.txt9.value = 0;
		}
		alert(form.txt9.value);
		return;
	}

	function calcTaxSavings(form) {
	    var t9 = form.txt9.value;
	    var t10 = Math.abs(form.txt10.value);
	    var value = (t9 * t10);
		//form.txt11.value = (Math.round(value*Math.pow(10,2))/Math.pow(10,2)).toFixed(2);
		form.txt11.value = roundNum(value,2).toFixed(2);
		return;
	}
	
	function roundNum(val,dec) {
	    var value = Math.round(val*Math.pow(10,dec))/Math.pow(10,dec);
	    return value;
	}
	
