function processTriFlight(sortingMode, sortingDirection, sortOnReturnList) {
	var actionForm = document.getElementById("actionForm");
	actionForm.sortingModeFlight.value = sortingMode;
	actionForm.sortingDirectionFlight.value = sortingDirection;
	actionForm.actionToDo.value = "sort";
	actionForm.sortOnReturnList.value = sortOnReturnList;
	waitForRequestDone();
}

function changeToDefaultView(){
	var actionForm = document.getElementById("actionForm");
	actionForm.actionToDo.value = "changeToDefaultView";
	waitForRequestDone();
}

function processFlightBooking(supplierCode, idFare , idP2PPA , idP2PPR){
	if(supplierCode == "SPD"){
		showWaitDisplay("wait", "changeFlight", false);
	}else{
		makeDocumentUnclickable();
	}
	var actionForm = document.getElementById("actionForm");
	actionForm.actionToDo.value = "booking";
	actionForm.idFare.value = idFare;	
	actionForm.idP2PPAller.value = idP2PPA;
	actionForm.idP2PPRetour.value = idP2PPR;
	document.forms['actionForm'].action = "/result-search-flight.htm";
	waitForRequestDone();
}

function processFlightBookingGo(idFareGtB, currentP2PPId){
	makeDocumentUnclickable();
	var actionForm = document.getElementById("actionForm");
	actionForm.actionToDo.value = "bookingGtB";
	actionForm.idFareGtB.value = idFareGtB;
	actionForm.idP2PP.value = currentP2PPId;
	waitForRequestDone();	
}

function processFlightBookingBack(supplierCode, idFareGtB, currentP2PPId){
	if(supplierCode == "SPD"){
		showWaitDisplay("wait", "changeFlight", false);
	}else{
		makeDocumentUnclickable();
	}
	var actionForm = document.getElementById("actionForm");
	actionForm.actionToDo.value = "bookingGtB";
	actionForm.idFareGtB.value = idFareGtB;
	actionForm.idP2PP.value = currentP2PPId;
	document.forms['actionForm'].action = "/result-search-flight.htm";
	waitForRequestDone();	
}

function onClickFlightBoard(via , cpyCode){
	if(via != null){
		makeDocumentUnclickable();
		var actionForm = document.getElementById("actionForm");
		actionForm.actionToDo.value = "flightBoard";
		actionForm.via.value = via;
		actionForm.cpy.value = cpyCode;
		waitForRequestDone();
	}
}

function fillDeparture(aGeo) {

    if (aGeo != null) {
        var codeInput = document.getElementById("departureCode");
        codeInput.value = aGeo.iataCode;
    }
    responseReceived++;
}

/**
 *
 * @param aGeo
 * @return
 */
function fillArrival(aGeo) {

    if (aGeo != null) {
        var codeInput = document.getElementById("arrivalCode");
        codeInput.value = aGeo.iataCode;
    }
    responseReceived++;
}

