<!-- debut du script



var compteur=1;

var total_capital = 0;

var solde_total = 0;

var capital_acc=0;

var interet_acc=0;



function verification(){



if (window.document.calc.paiement.value == 0 || window.document.calc.paiement_2.value == ""){

	alert("Vous devez entrer un paiement désiré.")

	window.document.calc.paiement_2.focus();

}

else

{

	if (window.document.calc.periode.value=="" || window.document.calc.periode.value == " "){

		alert("Vous devez entrer une période.")

		window.document.calc.periode.focus();

	}

	else

	{

		if (window.document.calc.taux.value=="" || window.document.calc.taux.value == " "){

			alert("Vous devez entrer un taux hypothécaire.")

			window.document.calc.taux.focus();

		}

		else

		{

			calcul()

		}



	}



}



}



function place(that, maxlong,champcible2) {



var tour=0;

var trouve="false";

var temp = that.value;

var longueur = temp.length;

var pospoint=0;

var point='false';

var sous="";

var dollars="";



while(tour<longueur){

	caractere = temp.charAt(tour)

	if (caractere==","){

		avant = temp.substring(0,tour);

		apres = temp.substring(tour+1,longueur);

		temp = avant + "." + apres;

		point = 'true';

		pospoint = tour;

	}

	if (caractere==" "){

		avant = temp.substring(0,tour);

		apres = temp.substring(tour+1,longueur);

		temp=avant + apres;		

		tour=tour-1;

		longueur=longueur-1;

	}

	if (caractere=="."){

		point = 'true';

		pospoint = tour;

	}



	tour=tour+1;

};

if (point == 'true'){





	if (longueur == pospoint+1){

		sous = ",00";



		tour=0

		if (longueur>4){

			while (tour<longueur-4){

				dollars = dollars + temp.charAt(tour)

				tour=tour+1;

			}

			dollars = dollars + " " + temp.charAt(tour) + temp.charAt(tour+1) + temp.charAt(tour+2)

		}

		else

		{

			tour=0

			while (tour<longueur-1){

				dollars = dollars + temp.charAt(tour)

				tour=tour+1;

			}

		}

	}

	else

	{

		if (temp.charAt(pospoint+1) != "" ){

			sous = "," + temp.charAt(pospoint+1)



			if (temp.charAt(pospoint+2) != "" ){

			

				tour=0

				sous = sous + temp.charAt(pospoint+2)

				if (longueur>6){

					while (tour<longueur-6){

						dollars = dollars + temp.charAt(tour)

						tour=tour+1;

					}

					dollars = dollars + " " + temp.charAt(tour) + temp.charAt(tour+1) + 					temp.charAt(tour+2)

	

				}

				else

				{	

					tour=0

						while (tour<longueur-3){

						dollars = dollars + temp.charAt(tour)

						tour=tour+1;

						}

				}

			}

			else

			{

				sous = sous + "0"

				tour=0

				if (longueur>5){

					while (tour<longueur-5){

						dollars = dollars + temp.charAt(tour)

						tour=tour+1;

					}

					dollars = dollars + " " + temp.charAt(tour) + temp.charAt(tour+1) + 					temp.charAt(tour+2)	

				}

				else

				{

					tour=0

					while (tour<longueur-2){

						dollars = dollars + temp.charAt(tour)

						tour=tour+1;

					}

				}

			}

		}

	}

}

else

{

	sous = ",00"

	tour=0

	if (longueur>3){

		while (tour<(longueur-3)){

			dollars = dollars + temp.charAt(tour)

			tour=tour+1;

		}

		dollars = dollars + " " + temp.charAt(tour) + temp.charAt(tour+1) + temp.charAt(tour+2)

	}

	else

	{

		tour=0

		while (tour<longueur){

			dollars = dollars + temp.charAt(tour)

			tour=tour+1;

		}

	}	

}



if (dollars==""){

	dollars="0";

}



var temp2 = dollars + sous;



if (champcible2=='paiement'){

	window.document.calc.paiement_2.value = temp2;

	window.document.calc.paiement.value = temp;

}

if (champcible2=='depot'){

	window.document.calc.depot_2.value = temp2;

	window.document.calc.depot.value = temp;

}

if (champcible2=='capital'){

	window.document.calc.capital_2.value = temp2;

	window.document.calc.capital.value = temp;

}






if (champcible2=='solde_01'){

	window.document.calc.solde_01.value = temp2;

	window.document.calc.solde_01_2.value = temp;

}



if (champcible2=='solde_02'){

	window.document.calc.solde_02.value = temp2;

	window.document.calc.solde_02_2.value = temp;

}



if (champcible2=='solde_03'){

	window.document.calc.solde_03.value = temp2;

	window.document.calc.solde_03_2.value = temp;

}



if (champcible2=='solde_04'){

	window.document.calc.solde_04.value = temp2;

	window.document.calc.solde_04_2.value = temp;

}



if (champcible2=='solde_05'){

	window.document.calc.solde_05.value = temp2;

	window.document.calc.solde_05_2.value = temp;

}



if (champcible2=='solde_06'){

	window.document.calc.solde_06.value = temp2;

	window.document.calc.solde_06_2.value = temp;

}



if (champcible2=='solde_07'){

	window.document.calc.solde_07.value = temp2;

	window.document.calc.solde_07_2.value = temp;

}



if (champcible2=='solde_08'){

	window.document.calc.solde_08.value = temp2;

	window.document.calc.solde_08_2.value = temp;

}



if (champcible2=='solde_09'){

	window.document.calc.solde_09.value = temp2;

	window.document.calc.solde_09_2.value = temp;

}



if (champcible2=='solde_10'){

	window.document.calc.solde_10.value = temp2;

	window.document.calc.solde_10_2.value = temp;

}



if (champcible2=='solde_11'){

	window.document.calc.solde_11.value = temp2;

	window.document.calc.solde_11_2.value = temp;

}



if (champcible2=='solde_12'){

	window.document.calc.solde_12.value = temp2;

	window.document.calc.solde_12_2.value = temp;

}



if (champcible2=='solde_13'){

	window.document.calc.solde_13.value = temp2;

	window.document.calc.solde_13_2.value = temp;

}



if (champcible2=='solde_14'){

	window.document.calc.solde_14.value = temp2;

	window.document.calc.solde_14_2.value = temp;

}



if (champcible2=='solde_15'){

	window.document.calc.solde_15.value = temp2;

	window.document.calc.solde_15_2.value = temp;

}



if (champcible2=='solde_16'){

	window.document.calc.solde_16.value = temp2;

	window.document.calc.solde_16_2.value = temp;

}



if (champcible2=='solde_17'){

	window.document.calc.solde_17.value = temp2;

	window.document.calc.solde_17_2.value = temp;

}



if (champcible2=='solde_18'){

	window.document.calc.solde_18.value = temp2;

	window.document.calc.solde_18_2.value = temp;

}



if (champcible2=='solde_19'){

	window.document.calc.solde_19.value = temp2;

	window.document.calc.solde_19_2.value = temp;

}



if (champcible2=='solde_20'){

	window.document.calc.solde_20.value = temp2;

	window.document.calc.solde_20_2.value = temp;

}



if (champcible2=='solde_21'){

	window.document.calc.solde_21.value = temp2;

	window.document.calc.solde_21_2.value = temp;

}



if (champcible2=='solde_22'){

	window.document.calc.solde_22.value = temp2;

	window.document.calc.solde_22_2.value = temp;

}



if (champcible2=='solde_23'){

	window.document.calc.solde_23.value = temp2;

	window.document.calc.solde_23_2.value = temp;

}



if (champcible2=='solde_24'){

	window.document.calc.solde_24.value = temp2;

	window.document.calc.solde_24_2.value = temp;

}



if (champcible2=='solde_25'){

	window.document.calc.solde_25.value = temp2;

	window.document.calc.solde_25_2.value = temp;

}



if (champcible2=='interet_01'){

	window.document.calc.interet_01.value = temp2;

}

if (champcible2=='interet_02'){

	window.document.calc.interet_02.value = temp2;

}

if (champcible2=='interet_03'){

	window.document.calc.interet_03.value = temp2;

}

if (champcible2=='interet_04'){

	window.document.calc.interet_04.value = temp2;

}

if (champcible2=='interet_05'){

	window.document.calc.interet_05.value = temp2;

}

if (champcible2=='interet_06'){

	window.document.calc.interet_06.value = temp2;

}

if (champcible2=='interet_07'){

	window.document.calc.interet_07.value = temp2;

}

if (champcible2=='interet_08'){

	window.document.calc.interet_08.value = temp2;

}

if (champcible2=='interet_09'){

	window.document.calc.interet_09.value = temp2;

}

if (champcible2=='interet_10'){

	window.document.calc.interet_10.value = temp2;

}

if (champcible2=='interet_11'){

	window.document.calc.interet_11.value = temp2;

}

if (champcible2=='interet_12'){

	window.document.calc.interet_12.value = temp2;

}

if (champcible2=='interet_13'){

	window.document.calc.interet_13.value = temp2;

}

if (champcible2=='interet_14'){

	window.document.calc.interet_14.value = temp2;

}

if (champcible2=='interet_15'){

	window.document.calc.interet_15.value = temp2;

}

if (champcible2=='interet_16'){

	window.document.calc.interet_16.value = temp2;

}

if (champcible2=='interet_17'){

	window.document.calc.interet_17.value = temp2;

}

if (champcible2=='interet_18'){

	window.document.calc.interet_18.value = temp2;

}

if (champcible2=='interet_19'){

	window.document.calc.interet_19.value = temp2;

}

if (champcible2=='interet_20'){

	window.document.calc.interet_20.value = temp2;

}

if (champcible2=='interet_21'){

	window.document.calc.interet_21.value = temp2;

}

if (champcible2=='interet_22'){

	window.document.calc.interet_22.value = temp2;

}

if (champcible2=='interet_23'){

	window.document.calc.interet_23.value = temp2;

}

if (champcible2=='interet_24'){

	window.document.calc.interet_24.value = temp2;

}

if (champcible2=='interet_25'){

	window.document.calc.interet_25.value = temp2;

}





if (champcible2=='capital_01'){

	window.document.calc.capital_01.value = temp2;

	window.document.calc.capital_01_2.value = temp;

}

if (champcible2=='capital_02'){

	window.document.calc.capital_02.value = temp2;

	window.document.calc.capital_02_2.value = temp;

}

if (champcible2=='capital_03'){

	window.document.calc.capital_03.value = temp2;

	window.document.calc.capital_03_2.value = temp;

}

if (champcible2=='capital_04'){

	window.document.calc.capital_04.value = temp2;

	window.document.calc.capital_04_2.value = temp;

}

if (champcible2=='capital_05'){

	window.document.calc.capital_05.value = temp2;

	window.document.calc.capital_05_2.value = temp;

}

if (champcible2=='capital_06'){

	window.document.calc.capital_06.value = temp2;

	window.document.calc.capital_06_2.value = temp;

}

if (champcible2=='capital_07'){

	window.document.calc.capital_07.value = temp2;

	window.document.calc.capital_07_2.value = temp;

}

if (champcible2=='capital_08'){

	window.document.calc.capital_08.value = temp2;

	window.document.calc.capital_08_2.value = temp;

}

if (champcible2=='capital_09'){

	window.document.calc.capital_09.value = temp2;

	window.document.calc.capital_09_2.value = temp;

}

if (champcible2=='capital_10'){

	window.document.calc.capital_10.value = temp2;

	window.document.calc.capital_10_2.value = temp;

}

if (champcible2=='capital_11'){

	window.document.calc.capital_11.value = temp2;

	window.document.calc.capital_11_2.value = temp;

}

if (champcible2=='capital_12'){

	window.document.calc.capital_12.value = temp2;

	window.document.calc.capital_12_2.value = temp;

}

if (champcible2=='capital_13'){

	window.document.calc.capital_13.value = temp2;

	window.document.calc.capital_13_2.value = temp;

}

if (champcible2=='capital_14'){

	window.document.calc.capital_14.value = temp2;

	window.document.calc.capital_14_2.value = temp;

}

if (champcible2=='capital_15'){

	window.document.calc.capital_15.value = temp2;

	window.document.calc.capital_15_2.value = temp;

}

if (champcible2=='capital_16'){

	window.document.calc.capital_16.value = temp2;

	window.document.calc.capital_16_2.value = temp;

}

if (champcible2=='capital_17'){

	window.document.calc.capital_17.value = temp2;

	window.document.calc.capital_17_2.value = temp;

}

if (champcible2=='capital_18'){

	window.document.calc.capital_18.value = temp2;

	window.document.calc.capital_18_2.value = temp;

}

if (champcible2=='capital_19'){

	window.document.calc.capital_19.value = temp2;

	window.document.calc.capital_19_2.value = temp;

}

if (champcible2=='capital_20'){

	window.document.calc.capital_20.value = temp2;

	window.document.calc.capital_20_2.value = temp;

}

if (champcible2=='capital_21'){

	window.document.calc.capital_21.value = temp2;

	window.document.calc.capital_21_2.value = temp;

}

if (champcible2=='capital_22'){

	window.document.calc.capital_22.value = temp2;

	window.document.calc.capital_22_2.value = temp;

}

if (champcible2=='capital_23'){

	window.document.calc.capital_23.value = temp2;

	window.document.calc.capital_23_2.value = temp;

}

if (champcible2=='capital_24'){

	window.document.calc.capital_24.value = temp2;

	window.document.calc.capital_24_2.value = temp;

}

if (champcible2=='capital_25'){

	window.document.calc.capital_25.value = temp2;

	window.document.calc.capital_25_2.value = temp;

}



if (champcible2=='capitalacc_01'){

	window.document.calc.capitalacc_01.value = temp2;

}

if (champcible2=='capitalacc_02'){

	window.document.calc.capitalacc_02.value = temp2;

}

if (champcible2=='capitalacc_03'){

	window.document.calc.capitalacc_03.value = temp2;

}

if (champcible2=='capitalacc_04'){

	window.document.calc.capitalacc_04.value = temp2;

}

if (champcible2=='capitalacc_05'){

	window.document.calc.capitalacc_05.value = temp2;

}

if (champcible2=='capitalacc_06'){

	window.document.calc.capitalacc_06.value = temp2;

}

if (champcible2=='capitalacc_07'){

	window.document.calc.capitalacc_07.value = temp2;

}

if (champcible2=='capitalacc_08'){

	window.document.calc.capitalacc_08.value = temp2;

}

if (champcible2=='capitalacc_09'){

	window.document.calc.capitalacc_09.value = temp2;

}

if (champcible2=='capitalacc_10'){

	window.document.calc.capitalacc_10.value = temp2;

}

if (champcible2=='capitalacc_11'){

	window.document.calc.capitalacc_11.value = temp2;

}

if (champcible2=='capitalacc_12'){

	window.document.calc.capitalacc_12.value = temp2;

}

if (champcible2=='capitalacc_13'){

	window.document.calc.capitalacc_13.value = temp2;

}

if (champcible2=='capitalacc_14'){

	window.document.calc.capitalacc_14.value = temp2;

}

if (champcible2=='capitalacc_15'){

	window.document.calc.capitalacc_15.value = temp2;

}

if (champcible2=='capitalacc_16'){

	window.document.calc.capitalacc_16.value = temp2;

}

if (champcible2=='capitalacc_17'){

	window.document.calc.capitalacc_17.value = temp2;

}

if (champcible2=='capitalacc_18'){

	window.document.calc.capitalacc_18.value = temp2;

}

if (champcible2=='capitalacc_19'){

	window.document.calc.capitalacc_19.value = temp2;

}

if (champcible2=='capitalacc_20'){

	window.document.calc.capitalacc_20.value = temp2;

}

if (champcible2=='capitalacc_21'){

	window.document.calc.capitalacc_21.value = temp2;

}

if (champcible2=='capitalacc_22'){

	window.document.calc.capitalacc_22.value = temp2;

}

if (champcible2=='capitalacc_23'){

	window.document.calc.capitalacc_23.value = temp2;

}

if (champcible2=='capitalacc_24'){

	window.document.calc.capitalacc_24.value = temp2;

}

if (champcible2=='capitalacc_25'){

	window.document.calc.capitalacc_25.value = temp2;

}



if (champcible2=='interetacc_01'){

	window.document.calc.interetacc_01.value = temp2;

}

if (champcible2=='interetacc_02'){

	window.document.calc.interetacc_02.value = temp2;

}

if (champcible2=='interetacc_03'){

	window.document.calc.interetacc_03.value = temp2;

}

if (champcible2=='interetacc_04'){

	window.document.calc.interetacc_04.value = temp2;

}

if (champcible2=='interetacc_05'){

	window.document.calc.interetacc_05.value = temp2;

}

if (champcible2=='interetacc_06'){

	window.document.calc.interetacc_06.value = temp2;

}

if (champcible2=='interetacc_07'){

	window.document.calc.interetacc_07.value = temp2;

}

if (champcible2=='interetacc_08'){

	window.document.calc.interetacc_08.value = temp2;

}

if (champcible2=='interetacc_09'){

	window.document.calc.interetacc_09.value = temp2;

}

if (champcible2=='interetacc_10'){

	window.document.calc.interetacc_10.value = temp2;

}

if (champcible2=='interetacc_11'){

	window.document.calc.interetacc_11.value = temp2;

}

if (champcible2=='interetacc_12'){

	window.document.calc.interetacc_12.value = temp2;

}

if (champcible2=='interetacc_13'){

	window.document.calc.interetacc_13.value = temp2;

}

if (champcible2=='interetacc_14'){

	window.document.calc.interetacc_14.value = temp2;

}

if (champcible2=='interetacc_15'){

	window.document.calc.interetacc_15.value = temp2;

}

if (champcible2=='interetacc_16'){

	window.document.calc.interetacc_16.value = temp2;

}

if (champcible2=='interetacc_17'){

	window.document.calc.interetacc_17.value = temp2;

}

if (champcible2=='interetacc_18'){

	window.document.calc.interetacc_18.value = temp2;

}

if (champcible2=='interetacc_19'){

	window.document.calc.interetacc_19.value = temp2;

}

if (champcible2=='interetacc_20'){

	window.document.calc.interetacc_20.value = temp2;

}

if (champcible2=='interetacc_21'){

	window.document.calc.interetacc_21.value = temp2;

}

if (champcible2=='interetacc_22'){

	window.document.calc.interetacc_22.value = temp2;

}

if (champcible2=='interetacc_23'){

	window.document.calc.interetacc_23.value = temp2;

}

if (champcible2=='interetacc_24'){

	window.document.calc.interetacc_24.value = temp2;

}

if (champcible2=='interetacc_25'){

	window.document.calc.interetacc_25.value = temp2;

}





}



function calcul(){

paiement = parseFloat(window.document.calc.paiement.value)

taux = parseFloat(window.document.calc.taux.value);

periode = parseInt(window.document.calc.periode.value);

depot = parseFloat(window.document.calc.depot.value);



for (i=0; i < window.document.calc.frequence.length; i++)

	{  

	if(window.document.calc.frequence[i].selected==true)

		{

		frequence = window.document.calc.frequence[i].value

		}

	}

taux = (taux / frequence) / 100;

np = (frequence * periode);



taux = parseFloat(taux);

paiement = parseFloat(paiement);

np = parseFloat(np);

q=Math.pow((1+taux),np);

q = parseFloat(q);

capital = (((paiement/taux) * (q-1))/q) + depot;



window.document.calc.capital_2.value = (Math.round(capital*100))/100;

place(window.document.calc.capital_2,10,'capital');



solde_total = Math.round(parseFloat(window.document.calc.paiement.value) * np *100)/100;



remplirtableau("debut");

}



function placetauxperiode(that,maxlong) {



var tour=0;

var trouve="false";

var temp = that.value;

var longueur = temp.length;

var pospoint=0;

var point='false';



while(tour<longueur){

	caractere = temp.charAt(tour)

	if (caractere==","){

		avant = temp.substring(0,tour);

		apres = temp.substring(tour+1,longueur);

		temp = avant + "." + apres;

		point = 'true';

		pospoint = tour;

	}

	if (caractere==" "){

		avant = temp.substring(0,tour);

		apres = temp.substring(tour+1,longueur);

		temp=avant + apres;		

		tour=tour-1;

		longueur=longueur-1;

	}

	if (caractere=="."){

		point = 'true';

		pospoint = tour;

	}



	tour=tour+1;

};



if (that.name =="taux"){

	window.document.calc.taux.value = temp

}

else

{

	window.document.calc.periode.value = temp

}

}



function remplirtableau(moment){



taux = parseFloat(window.document.calc.taux.value);

periode = parseInt(window.document.calc.periode.value);



for (i=0; i < window.document.calc.frequence.length; i++)



	{  

	if(window.document.calc.frequence[i].selected==true)

		{

		frequence = window.document.calc.frequence[i].value

		}

	}

taux = (taux / frequence) / 100;

np = (frequence * periode);



var cpt;

var interet;

var capital;

var capital2;

var interet2;



if (moment=="debut"){

	compteur = 1;

	total_capital = 0;

	capital_acc=0;

	interet_acc=0;

	solde_total = parseFloat(parseFloat(window.document.calc.capital.value)-parseFloat(window.document.calc.depot.value)) ;

}







}



//  Fin du script -->