// JavaScript Document
function tableau1()
   {

    var capital = document.choix1.capital.value;
    var nombre  = document.choix1.nombre.value;
    var taux    = document.choix1.taux.value;
    var echeance = document.choix1.ech.value ;

    var lien = "echeance="+ echeance + "&taux=" + taux + "&capital=" + capital + "&nbecheance=" + nombre;

    var ul = "/cgi-bin/php.cgi/a_votre_service/informations_pratiques/calculs/prets/amorti.phtml?" + lien ;
    self.location.href= ul;
   }


function tableau2()
   {

    var capital = document.choix2.capital.value;
    var nombre  = document.choix2.nombre.value;
    var taux    = document.choix2.taux.value;
    var echeance = document.choix2.echeance.value ;

    var lien = "echeance="+ echeance + "&taux=" + taux + "&capital=" + capital + "&nbecheance=" + nombre;

    var ul = "/cgi-bin/php.cgi/a_votre_service/informations_pratiques/calculs/prets/amorti.phtml?" + lien ;
    self.location.href= ul;
   }


function calcul1()
    {
    var capital = document.choix1.capital.value;
    var nombre  = document.choix1.nombre.value;
    var taux    = document.choix1.taux.value;

    // Calcul echeance

    i = taux / 1200.0;
    m = capital*i*Math.pow(1+i,nombre)/(Math.pow(1+i,nombre)-1);

    // Affichage résultat
    document.choix1.ech.value = Math.round(m*100.0) / 100.0;

    return;
    }

function calcul2()
    {
    var echeance = document.choix2.echeance.value;
    var nombre   = document.choix2.nombre.value;
    var taux     = document.choix2.taux.value;

    // Calcul echeance

    i = taux / 1200.0;
    capital = echeance/(i*Math.pow(1+i,nombre)/(Math.pow(1+i,nombre)-1));

    // Affichage résultat
    document.choix2.capital.value = Math.round(capital*100.0) / 100.0;

    return;
    }

