function verifyincome(checkstring) {
	if (isnotint(checkstring)) {
		alert("Invalid number.");
		document.formX.income.value="$75,000";
	}
	document.formX.income.value=formatnumber(unformat(document.formX.income.value),1);
	recalculate();
}
function recalculate() {
	var pretax = unformat(document.formX.income.value);
	var bc_tax = taxfromcharts('current', 0,pretax);
	var ab_tax = taxfromcharts('current', 1,pretax);
	var sk_tax = taxfromcharts('current', 2,pretax);
	var mb_tax = taxfromcharts('current', 3,pretax);
	var on_tax = taxfromcharts('current', 4,pretax);
	var qc_tax = taxfromcharts('current', 5,pretax);
	var nb_tax = taxfromcharts('current', 6,pretax);
	var ns_tax = taxfromcharts('current', 7,pretax);
	var pe_tax = taxfromcharts('current', 8,pretax);
	var nf_tax = taxfromcharts('current', 9,pretax);
	var nt_tax = taxfromcharts('current', 10,pretax);
	var nu_tax = taxfromcharts('current', 11,pretax);
	var yk_tax = taxfromcharts('current', 12,pretax);
	document.formX.bc_taxpay.value = formatnumber(bc_tax,1);
	document.formX.bc_aftertax.value = formatnumber(pretax-bc_tax,1);
	document.formX.ab_taxpay.value = formatnumber(ab_tax,1);
	document.formX.ab_aftertax.value = formatnumber(pretax-ab_tax,1);
	document.formX.sk_taxpay.value = formatnumber(sk_tax,1);
	document.formX.sk_aftertax.value = formatnumber(pretax-sk_tax,1);
	document.formX.mb_taxpay.value = formatnumber(mb_tax,1);
	document.formX.mb_aftertax.value = formatnumber(pretax-mb_tax,1);
	document.formX.on_taxpay.value = formatnumber(on_tax,1);
	document.formX.on_aftertax.value = formatnumber(pretax-on_tax,1);
	document.formX.qc_taxpay.value = formatnumber(qc_tax,1);
	document.formX.qc_aftertax.value = formatnumber(pretax-qc_tax,1);
	document.formX.nb_taxpay.value = formatnumber(nb_tax,1);
	document.formX.nb_aftertax.value = formatnumber(pretax-nb_tax,1);
	document.formX.ns_taxpay.value = formatnumber(ns_tax,1);
	document.formX.ns_aftertax.value = formatnumber(pretax-ns_tax,1);
	document.formX.pe_taxpay.value = formatnumber(pe_tax,1);
	document.formX.pe_aftertax.value = formatnumber(pretax-pe_tax,1);
	document.formX.nf_taxpay.value = formatnumber(nf_tax,1);
	document.formX.nf_aftertax.value = formatnumber(pretax-nf_tax,1);
	document.formX.nt_taxpay.value = formatnumber(nt_tax,1);
	document.formX.nt_aftertax.value = formatnumber(pretax-nt_tax,1);
	document.formX.nu_taxpay.value = formatnumber(nu_tax,1);
	document.formX.nu_aftertax.value = formatnumber(pretax-nu_tax,1);
	document.formX.yk_taxpay.value = formatnumber(yk_tax,1);
	document.formX.yk_aftertax.value = formatnumber(pretax-yk_tax,1);
	if (pretax == 0) { pretax2=1; }
	else { pretax2=pretax; }
	document.formX.bc_avg_rate.value = formatpercent(bc_tax/pretax2);
	document.formX.ab_avg_rate.value = formatpercent(ab_tax/pretax2);
	document.formX.sk_avg_rate.value = formatpercent(sk_tax/pretax2);
	document.formX.mb_avg_rate.value = formatpercent(mb_tax/pretax2);
	document.formX.on_avg_rate.value = formatpercent(on_tax/pretax2);
	document.formX.qc_avg_rate.value = formatpercent(qc_tax/pretax2);
	document.formX.nb_avg_rate.value = formatpercent(nb_tax/pretax2);
	document.formX.ns_avg_rate.value = formatpercent(ns_tax/pretax2);
	document.formX.pe_avg_rate.value = formatpercent(pe_tax/pretax2);
	document.formX.nf_avg_rate.value = formatpercent(nf_tax/pretax2);
	document.formX.nt_avg_rate.value = formatpercent(nt_tax/pretax2);
	document.formX.yk_avg_rate.value = formatpercent(yk_tax/pretax2);
	document.formX.nu_avg_rate.value = formatpercent(nu_tax/pretax2);
	document.formX.bc_margrate.value = formatpercent(ratefromcharts('current', 0,pretax));
	document.formX.ab_margrate.value = formatpercent(ratefromcharts('current', 1,pretax));
	document.formX.sk_margrate.value = formatpercent(ratefromcharts('current', 2,pretax));
	document.formX.mb_margrate.value = formatpercent(ratefromcharts('current', 3,pretax));
	document.formX.on_margrate.value = formatpercent(ratefromcharts('current', 4,pretax));
	document.formX.qc_margrate.value = formatpercent(ratefromcharts('current', 5,pretax));
	document.formX.nb_margrate.value = formatpercent(ratefromcharts('current', 6,pretax));
	document.formX.ns_margrate.value = formatpercent(ratefromcharts('current', 7,pretax));
	document.formX.pe_margrate.value = formatpercent(ratefromcharts('current', 8,pretax));
	document.formX.nf_margrate.value = formatpercent(ratefromcharts('current', 9,pretax));
	document.formX.nt_margrate.value = formatpercent(ratefromcharts('current', 10,pretax));
	document.formX.nu_margrate.value = formatpercent(ratefromcharts('current', 11,pretax));
	document.formX.yk_margrate.value = formatpercent(ratefromcharts('current', 12,pretax));
	document.formX.bc_capgains.value = formatpercent(capgainsfromcharts('current', 0,pretax));
	document.formX.bc_elgdivrate.value = formatpercent(elgdivratefromcharts('current', 0, pretax));
	document.formX.bc_othdivrate.value = formatpercent(othdivratefromcharts('current', 0, pretax));
	document.formX.ab_capgains.value = formatpercent(capgainsfromcharts('current', 1,pretax));
	document.formX.ab_elgdivrate.value = formatpercent(elgdivratefromcharts('current', 1, pretax));
	document.formX.ab_othdivrate.value = formatpercent(othdivratefromcharts('current', 1, pretax));
	document.formX.sk_capgains.value = formatpercent(capgainsfromcharts('current', 2,pretax));
	document.formX.sk_elgdivrate.value = formatpercent(elgdivratefromcharts('current', 2, pretax));
	document.formX.sk_othdivrate.value = formatpercent(othdivratefromcharts('current', 2, pretax));
	document.formX.mb_capgains.value = formatpercent(capgainsfromcharts('current', 3,pretax));
	document.formX.mb_elgdivrate.value = formatpercent(elgdivratefromcharts('current', 3, pretax));
	document.formX.mb_othdivrate.value = formatpercent(othdivratefromcharts('current', 3, pretax));
	document.formX.on_capgains.value = formatpercent(capgainsfromcharts('current', 4,pretax));
	document.formX.on_elgdivrate.value = formatpercent(elgdivratefromcharts('current', 4, pretax));
	document.formX.on_othdivrate.value = formatpercent(othdivratefromcharts('current', 4, pretax));
	document.formX.qc_capgains.value = formatpercent(capgainsfromcharts('current', 5,pretax));
	document.formX.qc_elgdivrate.value = formatpercent(elgdivratefromcharts('current', 5, pretax));
	document.formX.qc_othdivrate.value = formatpercent(othdivratefromcharts('current', 5, pretax));
	document.formX.nb_capgains.value = formatpercent(capgainsfromcharts('current', 6,pretax));
	document.formX.nb_elgdivrate.value = formatpercent(elgdivratefromcharts('current', 6, pretax));
	document.formX.nb_othdivrate.value = formatpercent(othdivratefromcharts('current', 6, pretax));
	document.formX.ns_capgains.value = formatpercent(capgainsfromcharts('current', 7,pretax));
	document.formX.ns_elgdivrate.value = formatpercent(elgdivratefromcharts('current', 7, pretax));
	document.formX.ns_othdivrate.value = formatpercent(othdivratefromcharts('current', 7, pretax));
	document.formX.pe_capgains.value = formatpercent(capgainsfromcharts('current', 8,pretax));
	document.formX.pe_elgdivrate.value = formatpercent(elgdivratefromcharts('current', 8, pretax));
	document.formX.pe_othdivrate.value = formatpercent(othdivratefromcharts('current', 8, pretax));
	document.formX.nf_capgains.value = formatpercent(capgainsfromcharts('current', 9,pretax));
	document.formX.nf_elgdivrate.value = formatpercent(elgdivratefromcharts('current', 9, pretax));
	document.formX.nf_othdivrate.value = formatpercent(othdivratefromcharts('current', 9, pretax));
	document.formX.nt_capgains.value = formatpercent(capgainsfromcharts('current', 10,pretax));
	document.formX.nt_elgdivrate.value = formatpercent(elgdivratefromcharts('current', 10, pretax));
	document.formX.nt_othdivrate.value = formatpercent(othdivratefromcharts('current', 10, pretax));
	document.formX.nu_capgains.value = formatpercent(capgainsfromcharts('current', 11,pretax));
	document.formX.nu_elgdivrate.value = formatpercent(elgdivratefromcharts('current', 11, pretax));
	document.formX.nu_othdivrate.value = formatpercent(othdivratefromcharts('current', 11, pretax));
	document.formX.yk_capgains.value = formatpercent(capgainsfromcharts('current', 12,pretax));
	document.formX.yk_elgdivrate.value = formatpercent(elgdivratefromcharts('current', 12, pretax));
	document.formX.yk_othdivrate.value = formatpercent(othdivratefromcharts('current', 12, pretax));
}

function dopopup(windowText) {
	var imgWindow;
	var DispString;
	imgWindow = open("","","width=420,height=250,scrollbars=yes");
	imgWindow.document.open();
	imgWindow.document.write("<html>");
	imgWindow.document.write("<head>");
	imgWindow.document.write("<link rel=STYLESHEET href='cica.css' type='text/css'>");
	imgWindow.document.write("</head>");
	imgWindow.document.write("<body bgcolor='white'>");
	imgWindow.document.write(windowText + "<p>");
	imgWindow.document.write("<form>");
	imgWindow.document.write("<center>");
	imgWindow.document.write("<input type='button' value='Close' onClick='self.close()'>");
	imgWindow.document.write("</center>");
	imgWindow.document.write("</form>");
	imgWindow.document.write("</body>");
	imgWindow.document.write("</html>");
	imgWindow.focus();
}

