function ci_calc_total() {
		var total;
		total = numeric(document.ci_calc.txt_outstanding_mortgage.value); 
		total = total + numeric(document.ci_calc.txt_outstanding_loans.value);
		total = total + numeric(document.ci_calc.txt_retirement_savings.value);
		total = total + numeric(document.ci_calc.txt_disability_savings.value);
		total = total + numeric(document.ci_calc.txt_spouse_income.value);
		total = total + numeric(document.ci_calc.txt_children_education.value);
		total = total + numeric(document.ci_calc.txt_alternative_medical.value);
		total = total + numeric(document.ci_calc.txt_purchase_services.value);
		total = total + numeric(document.ci_calc.txt_home_vehicle.value);
		total = total + numeric(document.ci_calc.txt_other.value);
		document.ci_calc.txt_total.value = total;



                  document.getElementById('data').innerHTML="<div class='blockquote3'></div><center><hr style='width:60%;color:#fefefe'></center><div class='blockquote3'</div> <div class='divhead'><p style='font-size:12px;text-align:'>Based on the estimated costs you provided above,</p><p>you would need a minimum of &nbsp;<span style='font-size:18px;font-weight:bold;color:#5A80B5;padding-right:5px'>$ " + total + " </span>in coverage</p><p>to look after your financial affairs if you were to suffer a serious <div style='margin-top:12px'>critical illness or disease.</div></p></div>";

        
        




                            
	}
	function bn_calc_total() {
		var total;
		total = numeric(document.bn_calc.txt_office_expenses.value); 
		total = total + numeric(document.bn_calc.txt_business_loans.value);
		total = total + numeric(document.bn_calc.txt_short_term.value);
		total = total + numeric(document.bn_calc.txt_replacement_staff.value);
		total = total + numeric(document.bn_calc.txt_buy_sell.value);
		total = total + numeric(document.bn_calc.txt_access_office.value);
		total = total + numeric(document.bn_calc.txt_other.value);

		document.bn_calc.value = total;


	}
	function numeric(value) {
		var whole_number;
		if (value.length == 0) {
			whole_number = 0;
		} else {
			whole_number = parseInt(value);
		}
		return whole_number;

}



var frmvalidator  = new Validator("ci_calc");
 	frmvalidator.addValidation("txt_outstanding_morgtage","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_outstanding_loans","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_retirement_savings","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_disability_savings","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_spouse_income","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_children_education","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_alternative_medical","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_purchase_services","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_home_vehicle","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_other","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");


var frmvalidator  = new Validator("bn_calc");
 	frmvalidator.addValidation("txt_office_expenses","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_business_loans","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_short_term","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_replacement_staff","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_buy_sell","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_access_office","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");
	frmvalidator.addValidation("txt_other","numeric", "Enter whole numbers in each field. Do not enter commas, decimals or spaces.");

function resetDiv() {
                 var div = document.getElementById('data');
                 div.innerHTML = "" ;
}


