﻿
function calcHcra(form) {
    var txtInsDeduct = isNumeric(form.txtInsDeduct.value) ? Math.abs(form.txtInsDeduct.value) : 0;
    var txtInsCopay = isNumeric(form.txtInsCopay.value) ? Math.abs(form.txtInsCopay.value) : 0;
    var txtScripCopay = isNumeric(form.txtScripCopay.value) ? Math.abs(form.txtScripCopay.value) : 0;
    var txtOtc = isNumeric(form.txtOtc.value) ? Math.abs(form.txtOtc.value) : 0;
    var txtPhysical = isNumeric(form.txtPhysical.value) ? Math.abs(form.txtPhysical.value) : 0;
    var txtDental = isNumeric(form.txtDental.value) ? Math.abs(form.txtDental.value) : 0;
    var txtOrthodontia = isNumeric(form.txtOrthodontia.value) ? Math.abs(form.txtOrthodontia.value) : 0;
    var txtVision = isNumeric(form.txtVision.value) ? Math.abs(form.txtVision.value) : 0;
    var txtHearing = isNumeric(form.txtHearing.value) ? Math.abs(form.txtHearing.value) : 0;
    var txtChiro = isNumeric(form.txtChiro.value) ? Math.abs(form.txtChiro.value) : 0;
    var txtOccTherapy = isNumeric(form.txtOccTherapy.value) ? Math.abs(form.txtOccTherapy.value) : 0;
    var txtPsycho = isNumeric(form.txtPsycho.value) ? Math.abs(form.txtPsycho.value) : 0;
    var txtHandicap = isNumeric(form.txtHandicap.value) ? Math.abs(form.txtHandicap.value) : 0;
    var txtDrugAddict = isNumeric(form.txtDrugAddict.value) ? Math.abs(form.txtDrugAddict.value) : 0;
    var txtMedTransport = isNumeric(form.txtMedTransport.value) ? Math.abs(form.txtMedTransport.value) : 0;
    var txtMedEquip = isNumeric(form.txtMedEquip.value) ? Math.abs(form.txtMedEquip.value) : 0;
    var txtOther = isNumeric(form.txtOther.value) ? Math.abs(form.txtOther.value) : 0;

    var total = (
        txtInsDeduct + 
        txtInsCopay + 
        txtScripCopay + 
        txtOtc + 
        txtPhysical + 
        txtDental + 
        txtOrthodontia + 
        txtVision + 
        txtHearing + 
        txtChiro + 
        txtOccTherapy + 
        txtPsycho + 
        txtHandicap + 
        txtDrugAddict + 
        txtMedTransport + 
        txtMedEquip + 
        txtOther
    );
    
    form.txtTotal.value = roundNum(total,2).toFixed(2);

	return;
}
	
