
var tabPrixShutleRoissy=[[23.90,35.80,53.7,71.6,74.5,89.4,104.3,119.2],[32.26,64.53,80.66,96.79,112.92,129.06,145.19,161],[53.27,106.54,133.18,159.81,186.45,213.09,239.72,265.83]];
// r ttttttt          t      roissy-paris		  jjjjjjjjjjjjjjjjjjjjjjj               roissy -orly  dfg                    roissy disney
var tabPrixShutleOrly=[[23.90,35.80,53.7,71.6,74.5,89.4,104.3,119.2],[32.26,64.53,80.66,96.79,112.92,129.06,145.19,161],[53.27,106.54,133.18,159.81,186.45,213.09,239.72,265.83]];
var tabPrixShutleParis=[[23.90,35.80,53.7,71.6,74.5,89.4,104.3,119.2],[23.90,35.80,53.7,71.6,74.5,89.4,104.3,119.2],[53.27,106.54,133.18,159.81,186.45,213.09,239.72,265.83]];
var tabPrixShutleDisney=[[53.27,106.54,133.18,159.81,186.45,213.09,239.72,265.83],[53.27,106.54,133.18,159.81,186.45,213.09,239.72,265.83],[53.27,106.54,133.18,159.81,186.45,213.09,239.72,265.83]];
var tabPrivateRoissy=[[76.9,86.9,99.9],[76.9,86.9,99.9],[79.90,90.29,103.8],[134.90,152.44,175.25]]
var tabPrivateOrly=[[76.9,86.9,99.9],[79.90,90.29,103.8],[84.90,95.94,110.29],[134.90,152.44,175.25]]
var tabPrivateParis=[[76.9,86.9,99.9],[76.9,86.9,99.9],[79.90,90.29,103.8],[134.90,152.44,175.25]]
var tabPrivateDisney=[[79.90,90.29,103.8],[84.90,95.94,110.29],[84.90,95.94,110.29],[149.90,169.39,194.73]]
var tabPrivateBeauvais=[[134.90,152.44,175.25],[134.90,152.44,175.25],[134.90,152.44,175.25],[149.90,169.39,194.73]]


function fNumPrixPrivate(depart, dest,car ){
//	alert(car)
car=car+1
	switch (depart) 
	{
	case 0:
	return (tabPrivateRoissy[dest][car-1]);
		break;
	case 1:
	return (tabPrivateOrly[dest][car-1]);
		break;
	case 2:
	return (tabPrivateParis[dest][car-1]);
		break;
	case 3:
	return (tabPrivateDisney[dest][car-1]);
	break;
	case 4:
	//alert(tabPrivateBeauvais[dest][car-1])
	return (tabPrivateBeauvais[dest][car-1]);
	break;
	//return (tabPrixShutle[dest][sieges-1]);
	}
}
function fNumPrixShuttle(depart, dest,sieges ){
	switch (depart) 
	{
	case 0:
	return (tabPrixShutleRoissy[dest][sieges-1]);
		break;
	case 1:
	return (tabPrixShutleOrly[dest][sieges-1]);
		break;
	case 3:
	return (tabPrixShutleDisney[dest][sieges-1]);
		break;
	case 2:
	return (tabPrixShutleParis[dest][sieges-1]);
	break;
	//return (tabPrixShutle[dest][sieges-1]);
	}
}
function fActualiserDestination(valCliquee) {
	//alert(valCliquee)
	document.forms[0].destination.options.length=0;//efface tout
	//var ligne=new Option('lib','val');
	//document.forms[0].destination.options[document.forms[0].destination.options.length]=ligne;
	
	var ligneRoissy= new Option('Roissy CDG Airport','Roissy CDG')
	var ligneOrly=new Option('Orly Airport','Orly')
	var ligneParis=new Option('Paris or Inner Suburbs','Paris')
	var ligneDisney=new Option('Disneyland','Disneyland')
	//document.forms[0].destination.options[document.forms[0].destination.options.length]=ligne;
switch (valCliquee) 
	{
	case 'Roissy CDG':
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneParis;	
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneOrly;
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneDisney;
	break;
	case 'Orly':
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneParis;
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneRoissy;
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneDisney;
	break;
	case 'Disneyland':
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneRoissy;
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneOrly;
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneParis;
	
	break;
	case 'Paris':
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneRoissy;
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneOrly;
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneDisney;
	
	break;
	
	}
document.forms[0].destination.selectedIndex=0
}


function Ajouter(form) {
			var ligne=new Option(form.libelle.value,form.valeur.value);
		form.liste.options[form.liste.options.length]=ligne;
	}
function Inserer(form) {
		var o=new Option(form.libelle.value,form.valeur.value);
		if(form.liste.options.selectedIndex>=0) {
			form.liste.options.length++;
			for (var i=form.liste.options.length-1;i>form.liste.options.selectedIndex;i--) {
				var p=new Option(form.liste.options[i-1].text,form.liste.options[i-1].value);
				form.liste.options[i]=p;
			}
			form.liste.options[form.liste.options.selectedIndex]=o;
		} else {
			alert("Insertion impossible. Sélectionnez une ligne");
		}
	}
function Supprimer(list) {
		if (list.options.selectedIndex>=0) {
			list.options[list.options.selectedIndex]=null;
		} else {
			alert("Suppression impossible : aucune ligne sélectionnée");
		}
	}

function SupprimerTout(list) {
		list.options.length=0;
	}
function FromClick (){
fActualiserDestination(document.forms[0].pickup.value)

fNumGetPrice()
}

function fNumGetPrice(){
//coefpromo=0.95
if (document.getElementById('trip').selectedIndex==0) 
	{document.getElementById('badgePrivate').style.display="none"
	
} 
else{
	document.getElementById('badgePrivate').style.display="block"
}
nbSeats=document.getElementById('Seats').value
if (nbSeats==1){
	txtSeats=" seat "}
else{
	txtSeats=" seats "}
txtArrival=document.getElementById('pickup').value
prix=fNumPrixShuttle(document.getElementById('pickup').selectedIndex,document.getElementById('destination').selectedIndex,document.getElementById('Seats').value)
if (document.getElementById('trip').selectedIndex==0) 
	{nVoyage=1
	txtPrixBarre=""
	document.getElementById("prixTotal").style.paddingTop='38px'
} 
else{
	nVoyage=1.95
	document.getElementById("prixTotal").style.paddingTop='10px'
numPrixNormal=2*prix
txtPrixBarre='<span>'+  numPrixNormal.toFixed(2) + '</span>'+ '<br />'
}
numPrix=nVoyage*prix
txtPrix=numPrix.toFixed(1)

txtPrix=parseFloat(txtPrix).toFixed(2)
//alert(prix)//
//alert(nVoyage)//
//alert("numPrix 1:" + parseFloat(monPrix).toFixed(1))
//alert("numPrix 2:" +parseFloat(monPrix).toFixed(2))
//alert(numPrix.toFixed(1).toFixed(2))

//txtPrix=numPrix.toFixed(2)
strMessage="<h5>" + document.getElementById('trip').value + " from " + document.getElementById('pickup').value + " to " + document.getElementById('destination').value + ", " + nbSeats + txtSeats + "for :</h5>"
numPerSeat= numPrix/nbSeats
txtprixUnitaire="!! &euro; " + numPerSeat.toFixed(2) + " per seat !!"
txtprixTotal=txtPrixBarre  + " &euro; " + txtPrix + ""
document.getElementById("prixTotal").innerHTML= txtprixTotal
document.getElementById("prixUnitaire").innerHTML= txtprixUnitaire 
document.getElementById("priceShuttle").innerHTML=strMessage
//alert(document.getElementById("prixTotal").innerHTML)
//alert(document.getElementByName("TotalPrice").value)
//document.forms[2].amount.value=txtPrix
document.forms[0].TotalPrice.value=txtPrix
//document.getElementById("tableauArrivalText").innerHTML=txtArrival
//document.getElementById("truc").innerHTML= txtprixTotal
//document.getElementById("tableauDepartureText").innerHTML=txtArrival
//document.getElementById("seats2").innerHTML=nbSeats
//document.forms[0].arrival2.value=txtArrival
}


function FromClickPrivate (){
fActualiserDestinationPrivate(document.forms[0].pickup.value)
fNumGetPricePrivate()
}
function fActualiserDestinationPrivate(valCliquee) {
	//alert(valCliquee)
	document.forms[0].destination.options.length=0;//efface tout
	//var ligne=new Option('lib','val');
	var ligneRoissy= new Option('Roissy CDG Airport','Roissy CDG')
	var ligneOrly=new Option('Orly Airport','Orly')
	var ligneParis=new Option('Paris or Inner Suburbs','Paris')
	var ligneDisney=new Option('Disneyland','Disneyland')
	var ligneBeauvais=new Option('Beauvais Airport','Beauvais')
	//document.forms[0].destination.options[document.forms[0].destination.options.length]=ligne;
switch (valCliquee) 
	{
	case 'Roissy CDG':
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneParis;	
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneOrly;
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneDisney;
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneBeauvais;
	break;
	case 'Orly':
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneParis;
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneRoissy;
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneDisney;
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneBeauvais;
	break;
	case 'Disneyland':
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneParis;
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneRoissy;
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneOrly;
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneBeauvais;
	break;
	case 'Paris':
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneRoissy;
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneOrly;
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneDisney;
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneBeauvais;
	break;
	case 'Beauvais':
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneParis;
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneRoissy;
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneOrly;
	document.forms[0].destination.options[document.forms[0].destination.options.length]=ligneDisney;
	break;
	}
document.forms[0].destination.selectedIndex=0
document.forms[0].destination.style.width="160px"
}

function fNumGetPricePrivate(){
//coefpromo=0.95
		

if (document.getElementById('trip').selectedIndex==0) 
	{document.getElementById('badgePrivate').style.display="none"
	
} 
else{
	document.getElementById('badgePrivate').style.display="block"
}
//nVoyage=document.getElementById('trip').selectedIndex +1
nbSeats=(document.getElementById('Seats').selectedIndex*2)+4
//alert(nbSeats)
if (nbSeats==1){
	txtSeats=" seat "}
else{
	txtSeats=" seats "}
txtArrival=document.getElementById('pickup').value
prix=fNumPrixPrivate(document.getElementById('pickup').selectedIndex,document.getElementById('destination').selectedIndex,document.getElementById('Seats').selectedIndex)
//alert(prix)//
if (document.getElementById('Seats').selectedIndex==0)
{document.getElementById('imgPrivate').src="./images/merquil small.png"
	document.getElementById('imgPrivate').height="100"}
else if(document.getElementById('Seats').selectedIndex==1) {
	document.getElementById('imgPrivate').src="images/crisler small.png"
	document.getElementById('imgPrivate').height="80"
	}
else {document.getElementById('imgPrivate').src="images/Viano metal small.png"
	document.getElementById('imgPrivate').height="100"
}
if (document.getElementById('trip').selectedIndex==0) 
	{nVoyage=1
	txtPrixBarre=""
	document.getElementById("prixTotal").style.paddingTop='38px'
} 
else{
	nVoyage=1.95
	document.getElementById("prixTotal").style.paddingTop='10px'
numPrixNormal=2*prix
txtPrixBarre='<span>'+  numPrixNormal.toFixed(2) + '</span>'+ '<br />'
}
numPrix=nVoyage*prix
txtPrix=numPrix.toFixed(1)
txtPrix=parseFloat(txtPrix).toFixed(2)
//alert(nVoyage)//
//alert(numPrix)
//txtPrix=numPrix.toFixed(2)
strMessage="<h5>" + document.getElementById('trip').value + " from " + document.getElementById('pickup').value + " to " + document.getElementById('destination').value + " in Private " + document.getElementById('Seats').value+ nbSeats  + txtSeats + " for :</h5>"
//strMessage="<h5>bla</h5>"
numPerSeat= numPrix/nbSeats
txtprixUnitaire="&euro; " + numPerSeat.toFixed(2) + " per seat"
txtprixTotal=txtPrixBarre  + " &euro; " + txtPrix + ""

document.getElementById("prixTotal").innerHTML= txtprixTotal
document.getElementById("prixUnitairePrivate").innerHTML=txtprixUnitaire 
document.getElementById("priceShuttle").innerHTML=strMessage
document.forms[0].TotalPrice.value=txtPrix

//alert(document.getElementById("prixTotal").innerHTML)
//alert(document.getElementByName("TotalPrice").value)
//document.forms[2].amount.value=txtPrix


}
