<!--
function calcola_rata_prestito(){
with(document.calcolo_rata_prestito){
var A1=parseFloat(calcolo_rata_prestiti_6.value.replace(/\,/g,"").replace(/\$/g,""));
if(isNaN(A1)) A1=0;
var A2=parseFloat(calcolo_rata_prestiti_5.value.replace(/\,/g,"").replace(/\$/g,""));
if(isNaN(A2)) A2=0;
Atotal=""+(A1/100/A2) ;
if(Atotal.indexOf(".")!=-1) Atotal=""+Atotal.substring(0,Atotal.lastIndexOf(".")+9);
nextPlc=Atotal.indexOf(".");
if(nextPlc==-1) nextPlc=Atotal.length;
while(nextPlc > 3) {
Atotal=Atotal.substring(0,nextPlc-3)+","+Atotal.substring(nextPlc-3);
nextPlc=Atotal.indexOf(",");}
rata.value=""+Atotal+"";
var B1=parseFloat(rata.value.replace(/\,/g,"").replace(/\$/g,""));
if(isNaN(B1)) B1=0;
Btotal=""+(1+B1) ;
if(Btotal.indexOf(".")!=-1) Btotal=""+Btotal.substring(0,Btotal.lastIndexOf(".")+9);
nextPlc=Btotal.indexOf(".");
if(nextPlc==-1) nextPlc=Btotal.length;
while(nextPlc > 3) {
Btotal=Btotal.substring(0,nextPlc-3)+","+Btotal.substring(nextPlc-3);
nextPlc=Btotal.indexOf(",");}
calcola_rate_prestiti_1.value=""+Btotal+"";
var C1=parseFloat(calcola_rate_prestiti_1.value.replace(/\,/g,"").replace(/\$/g,""));
if(isNaN(C1)) C1=0;
var C2=parseFloat(calcolo_rate_prestiti_4.value.replace(/\,/g,"").replace(/\$/g,""));
if(isNaN(C2)) C2=0;
var C3=parseFloat(calcolo_rata_prestiti_5.value.replace(/\,/g,"").replace(/\$/g,""));
if(isNaN(C3)) C3=0;
Ctotal=""+(Math.pow(C1,C2*C3)) ;
Ctotal+=((Ctotal.indexOf(".")!=-1)?"":".")+"000000000";
if(Ctotal.indexOf(".")!=-1) Ctotal=""+Ctotal.substring(0,Ctotal.lastIndexOf(".")+9);
nextPlc=Ctotal.indexOf(".");
if(nextPlc==-1) nextPlc=Ctotal.length;
while(nextPlc > 3) {
Ctotal=Ctotal.substring(0,nextPlc-3)+","+Ctotal.substring(nextPlc-3);
nextPlc=Ctotal.indexOf(",");}
calcola_rate_prestiti_2.value=""+Ctotal+"";
var D1=parseFloat(calcolo_rate_prestiti_3.value.replace(/\,/g,"").replace(/\$/g,""));
if(isNaN(D1)) D1=0;
var D2=parseFloat(rata.value.replace(/\,/g,"").replace(/\$/g,""));
if(isNaN(D2)) D2=0;
var D3=parseFloat(calcola_rate_prestiti_2.value.replace(/\,/g,"").replace(/\$/g,""));
if(isNaN(D3)) D3=0;
Dtotal=""+(D1*(1/((1/D2)-(1/(D2*D3))))) ;
Dtotal+=((Dtotal.indexOf(".")!=-1)?"":".")+"000";
if(Dtotal.indexOf(".")!=-1) Dtotal=""+Dtotal.substring(0,Dtotal.lastIndexOf(".")+3);
nextPlc=Dtotal.indexOf(".");
if(nextPlc==-1) nextPlc=Dtotal.length;
while(nextPlc > 3) {
Dtotal=Dtotal.substring(0,nextPlc-3)+","+Dtotal.substring(nextPlc-3);
nextPlc=Dtotal.indexOf(",");}
result.value=""+Dtotal+"";
}
return true;
}
//-->