function inheritance_calculator(c)
{var I=strip_common_elements(document.getElementById(c).assets_business.value);
 var ad=strip_common_elements(document.getElementById(c).assets_home.value);
 var L=strip_common_elements(document.getElementById(c).assets_savings.value);
 var A=strip_common_elements(document.getElementById(c).assets_investments.value);
 var J=strip_common_elements(document.getElementById(c).assets_policies.value);
 var K=strip_common_elements(document.getElementById(c).assets_pensions.value);
 var X=strip_common_elements(document.getElementById(c).assets_other.value);
 var w=strip_common_elements(document.getElementById(c).liabilities_mortage.value);
 var D=strip_common_elements(document.getElementById(c).liabilities_loans.value);
 var C=strip_common_elements(document.getElementById(c).liabilities_other.value);
 var aE=0; var aD=0;var bk=0;
 
 if(!I)
 {I="0";}
 
 if(!ad){ad="0";}
 if(!L){L="0";}
 if(!A){A="0";}
 if(!J){J="0";}
 if(!K){K="0";}
 if(!X){X="0";}
 if(!w){w="0";}
 if(!D){D="0";}
 if(!C){C="0";}
 
 var d=new Array;
 var e=0;
 
 if(!check_number_valid(I)){d[e]="\tThe business asset field";e++;}
 if(!check_number_valid(ad)){d[e]="\tThe home field";e++;}
 if(!check_number_valid(L)){d[e]="\tThe savings field";e++;}
 if(!check_number_valid(A)){d[e]="\tThe investments field";e++;}
 if(!check_number_valid(J)){d[e]="\tThe life policies field";e++;}
 if(!check_number_valid(K)){d[e]="\tThe pensions field";e++;}
 if(!check_number_valid(X)){d[e]="\tThe other assets field";e++;}
 if(!check_number_valid(w)){d[e]="\tThe mortgage field";e++;}
 if(!check_number_valid(D)){d[e]="\tThe loans field";e++;}
 if(!check_number_valid(C)){d[e]="\tThe other liabilities field";e++;}
 if(d.length>0){var f;f=(d.length>1)?"The following fields are incorrect. Please check the fields and try again:\n\n":"The following field is incorrect. Please check the fields and try again:\n\n";

for(i=0;i<d.length;i++)
 {
  bY+=d[i];f+="\n";} 
  document.getElementById(c).net_assets.value='';
  document.getElementById(c).taxable_assets.value='';
  document.getElementById(c).tax_liability.value='';
  alert(f);
  return false;
 }
 
 I=parseFloat(I);ad=parseFloat(ad);L=parseFloat(L);A=parseFloat(A);J=parseFloat(J);K=parseFloat(K);X=parseFloat(X);w=parseFloat(w); D=parseFloat(D);
 C=parseFloat(C);aE=((parseFloat(I)+parseFloat(ad)+parseFloat(L)+parseFloat(A)+parseFloat(J)+parseFloat(K)+parseFloat(X))-(parseFloat(w)+parseFloat(D)+parseFloat(C)));
 
 aD=(aE-I<=325000)?0:aE-325000 - I; //updated 22/06/2011
 bk=((aD/100)*40);
 document.getElementById(c).net_assets.value=format_number_output(aE,2,',','£');
 document.getElementById(c).taxable_assets.value=format_number_output(aD,2,',','£');
 document.getElementById(c).tax_liability.value=format_number_output(bk,2,',','£');
 return false;
}
