function calc(form){
var TdaySelection = document.reser.daySelection.options[document.reser.daySelection.selectedIndex].value;
var TmonthSelection = document.reser.monthSelection.options[document.reser.monthSelection.selectedIndex].value;
var TyearSelection = document.reser.yearSelection.options[document.reser.yearSelection.selectedIndex].value;
var TdaySelection2 = document.reser.daySelection2.options[document.reser.daySelection2.selectedIndex].value;
var TmonthSelection2 = document.reser.monthSelection2.options[document.reser.monthSelection2.selectedIndex].value;
var TyearSelection2 = document.reser.yearSelection2.options[document.reser.yearSelection2.selectedIndex].value;
if (TmonthSelection == "Janvier")
	TmonthSelection = "jan";
if (TmonthSelection == "Février")
	TmonthSelection = "feb";
if (TmonthSelection == "Mars")
	TmonthSelection = "mar";
if (TmonthSelection == "Avril")
	TmonthSelection = "apr";
if (TmonthSelection == "Mai")
	TmonthSelection = "may";
if (TmonthSelection == "Juin")
	TmonthSelection = "jun";
if (TmonthSelection == "Juillet")
	TmonthSelection = "jul";
if (TmonthSelection == "Aout")
	TmonthSelection = "aug";
if (TmonthSelection == "Septembre")
	TmonthSelection = "sep";
if (TmonthSelection == "Octobre")
	TmonthSelection = "oct";
if (TmonthSelection == "Novembre")
	TmonthSelection = "nov";
if (TmonthSelection == "Décembre")
	TmonthSelection = "dec";

if (TmonthSelection2 == "Janvier")
	TmonthSelection2 = "jan";
if (TmonthSelection2 == "Février")
	TmonthSelection2 = "feb";
if (TmonthSelection2 == "Mars")
	TmonthSelection2 = "mar";
if (TmonthSelection2 == "Avril")
	TmonthSelection2 = "apr";
if (TmonthSelection2 == "Mai")
	TmonthSelection2 = "may";
if (TmonthSelection2 == "Juin")
	TmonthSelection2 = "jun";
if (TmonthSelection2 == "Juillet")
	TmonthSelection2 = "jul";
if (TmonthSelection2 == "Aout")
	TmonthSelection2 = "aug";
if (TmonthSelection2 == "Septembre")
	TmonthSelection2 = "sep";
if (TmonthSelection2 == "Octobre")
	TmonthSelection2 = "oct";
if (TmonthSelection2 == "Novembre")
	TmonthSelection2 = "nov";
if (TmonthSelection2 == "Décembre")
	TmonthSelection2 = "dec";
var jour1 = "";
var lejourtest = "";
jour1 = TmonthSelection + " " + TdaySelection + ", " + TyearSelection ;
lejourtest = TmonthSelection + " " + TdaySelection;
jour2 = TmonthSelection2 + " " + TdaySelection2 + ", " + TyearSelection2 ;
jour = Date.parse(jour2)- Date.parse(jour1);
day1 = Math.round(jour/(24*60*60*1000)) ;
document.reser.Jour_location.value = day1;
var moi = 0
var moi1 = 0
moi = TyearSelection;
moi1 = TyearSelection;
jourHdebut1 = datedh1 + ", " + moi;

if (Date.parse(jour1) >= Date.parse(jourHdebut1) )
moi1++;
else
moi--;


jourHdebut1 = datedh1 + ", " + moi;
jourHfin1 = datefh1 + ", " + moi1;
jourMdebut1 = datedb3 + ", " + moi1;
jourMfin1 = datefb3 + ", " + moi1;
jourbassedebut1 = datedb1 + ", " + moi1;
jourbassedebut2 = datedb2 + ", " + moi1;
jourbassefin1 = datefb1 + ", " + moi1;
jourbassefin2 = datefb2 + ", " + moi1;



//alert(jour1 + " : " + Date.parse(jour1) + "\n" + jourbassedebut1 + " : " + Date.parse(jourbassedebut1) + "\n" + jourbassefin1 + " : " + Date.parse(jourbassefin1) + "\n" + jourbassedebut2 + " : " + Date.parse(jourbassedebut2) + "\n" + jourbassefin2 + " : " + Date.parse(jourbassefin2) + "\n");

	saisonHaute = 1;
	saisonBasse = 1;
	saisonMoyene = 1;


if ( Date.parse(jour1) >= Date.parse(jourHdebut1) && Date.parse(jour1) <= Date.parse(jourHfin1))
		{
		saisonHaute = 10;
		saisonBasse = 0;
		saisonMoyene = 0;
		}

if ( Date.parse(jour1) >= Date.parse(jourMdebut1) && Date.parse(jour1) <= Date.parse(jourMfin1))
		{
		saisonHaute = 0;
		saisonBasse = 0;
		saisonMoyene = 10;
		}
if ( Date.parse(jour1) >= Date.parse(jourbassedebut1) && Date.parse(jour1) <= Date.parse(jourbassefin1))
		{	
		saisonHaute = 0;
		saisonBasse = 10;
		saisonMoyene = 0;
		}

if ( Date.parse(jour1) >= Date.parse(jourbassedebut2) && Date.parse(jour1) <= Date.parse(jourbassefin2))
		{	
		saisonHaute = 0;
		saisonBasse = 10;
		saisonMoyene = 0;
 		}


//alert("jour1:" + Date.parse(jour1) + "\n" + "H1:" + Date.parse(jourHdebut1) + "\n" + "H2:" + Date.parse(jourHfin1)+ "\n" + "M1:" + Date.parse(jourMdebut1)+ "\n" + "M2:" + Date.parse(jourMfin1)+ "\n" + "B1:" + Date.parse(jourbassedebut1)+ "\n" + "B2:" + Date.parse(jourbassefin1)+ "\n" + "B3:" + Date.parse(jourbassedebut2)+ "\n" + "B4:" + Date.parse(jourbassefin2)+ "\n" + "H:" + saisonHaute + "\n" + "M:" + saisonMoyene + "\n" + "B:" + saisonBasse +"\n" + "moi1:" + moi1 );


var Tvehicule = document.reser.Vehicule.options[document.reser.Vehicule.selectedIndex].value;
var TDevise = document.reser.Devise.options[document.reser.Devise.selectedIndex].value;
var TJour_location = parseFloat(document.reser.Jour_location.value);
var TAcompte = parseFloat(document.reser.Acompte.value)
Tmontant = 0;
Tmontant1 = 0; 
//alert(datedh1);
//alert(lejourtest);
//alert(jourHdebut1);
//alert(jour1);
//alert(jourHfin1);
//alert(saisonHaute);
//alert(saisonMoyene);
//alert(saisonBasse);
if (saisonBasse > 0 )
{
	//alert('saison basse');
	//alert(contcat);
	//alert(Tvehicule);
	if (TJour_location < 14)
	 	{
		for (i=0; i<contcat ; i++){
				if (Tvehicule == tarhb4[i])
			Tmontant = tarb0[i] * TJour_location ;
			//alert(tarb0[i]);
				}
	}
	
	if ((TJour_location >= 14) && (TJour_location < 21))
	{
		for (i=0; i<contcat ; i++){
				if (Tvehicule == tarhb4[i])
			Tmontant = tarb1[i] * TJour_location ;
				}
	}
	
	if ((TJour_location >= 21) && (TJour_location < 28))
{
		for (i=0; i<contcat ; i++){
				if (Tvehicule == tarhb4[i])
			Tmontant = tarb2[i] * TJour_location ;
				}
	}

	if (TJour_location >= 28)
	{
		for (i=0; i<contcat ; i++){
				if (Tvehicule == tarhb4[i])
			Tmontant = tarb3[i] * TJour_location ;
				}
	}
//teste ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

}

if (saisonMoyene > 0 )
{
	//alert('saison moyenne');
	//alert(contcat);
	//alert(Tvehicule);
if (TJour_location < 14)
	{
		for (i=0; i<contcat ; i++){
				if (Tvehicule == tarhb4[i])
			Tmontant = tarM0[i] * TJour_location ;
				//alert(tarM0[i]);
				}
	}

	if ((TJour_location >= 14) && (TJour_location < 21))
	{
		for (i=0; i<contcat ; i++){
				if (Tvehicule == tarhb4[i])
			Tmontant = tarM1[i] * TJour_location ;
				}
	}

	if ((TJour_location >= 21) && (TJour_location < 28))
	{
		for (i=0; i<contcat ; i++){
				if (Tvehicule == tarhb4[i])
			Tmontant = tarM2[i] * TJour_location ;
				}
	}

	if (TJour_location >= 28)
	{
		for (i=0; i<contcat ; i++){
				if (Tvehicule == tarhb4[i])
			Tmontant = tarM3[i] * TJour_location ;
				}
	}
//teste ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

}
if (saisonHaute > 0 )
{
	//alert('saison haute');
	//alert(contcat);
	//alert(Tvehicule);
	if (TJour_location < 14)
	{
		for (i=0; i<contcat ; i++){
				if (Tvehicule == tarhb4[i])
			Tmontant = tarh0[i] * TJour_location ;
				}
	}

	if ((TJour_location >= 14) && (TJour_location < 21))
	{
		for (i=0; i<contcat ; i++){
				if (Tvehicule == tarhb4[i])
			Tmontant = tarh1[i] * TJour_location ;
				}
	}

	if ((TJour_location >= 21) && (TJour_location < 28))
	{
		for (i=0; i<contcat ; i++){
				if (Tvehicule == tarhb4[i])
			Tmontant = tarh2[i] * TJour_location ;
				}
	}

	if (TJour_location >= 28)
	{
		for (i=0; i<contcat ; i++){
				if (Tvehicule == tarhb4[i])
			Tmontant = tarh3[i] * TJour_location ;
				}
	}

//teste ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

}
Tmontant = Tmontant + Tmontant1;
var Taero = 15;
var Tport = 20;
TTDevise = "Frs";
document.reser.currency.value = "EUR";
document.reser.amount.value = 38.11;
if (TDevise == "Euros")
{	var Taero = 15;
var Tport = 20;
	TTDevise = "Euros";
	document.reser.currency.value = "EUR";
	document.reser.amount.value = 38.11 ;
}



document.reser.Montant_location.value = Tmontant ;

if (document.reser.recuperation[0].checked)
			Tmontant = Tmontant + Taero;
if (document.reser.recuperation[1].checked)
			Tmontant = Tmontant + Tport;
if (document.reser.recuperation[2].checked)
			Tmontant = Tmontant;

document.reser.Devise1.value = TTDevise ;
document.reser.Devise2.value = TTDevise ;
document.reser.Solde_du.value = Tmontant - TAcompte ;
document.reser.amount.value = TAcompte ;


}