// JavaScript Document
function refreshDest(FormEnCours, destination, gateway)
{
        var GateEnCours;
        var indice = 0;
        if (gateway)
        {
                GateEnCours                   = gateway;
                FormEnCours.gateway_dep.value = gateway;
        }
        else
        {
                //alert(FormEnCours.gateway_dep.options[FormEnCours.gateway_dep.selectedIndex].value);
                GateEnCours = FormEnCours.gateway_dep.options[FormEnCours.gateway_dep.selectedIndex].value;
        }
    if (GateEnCours == "") {  FormEnCours.dest_dep.length = 1  }
    else
    {
      var ListeEnCours = eval(GateEnCours);
      FormEnCours.dest_dep.length = 1;
    for (var compteur = 0; compteur < ListeEnCours.length; compteur++)
    {
        indice = compteur + 1;
        //alert(eval('nom_' + ListeEnCours[compteur]));

        FormEnCours.dest_dep.options[indice] = new Option( eval('nom_' + ListeEnCours[compteur]));
        FormEnCours.dest_dep.options[indice].value = ListeEnCours[compteur];


//alert(FormEnCours.dest_dep.options[compteur].value);
     if ( ListeEnCours[compteur] == destination) { FormEnCours.dest_dep.selectedIndex = indice  }

      }
    }
//alert('option0' +FormEnCours.dest_dep.options[0].text);
}

function RefreshDest34(form)
{
    var no_ville = form.dest_dep.options[form.dest_dep.selectedIndex].value;
//alert(form.dest_dep.options[form.dest_dep.selectedIndex].value);

        self.location="queryforf.cgi?code_ag=myr&alias=MYR&language=en&gateway_dep="+form.gateway_dep.options[form.gateway_dep.selectedIndex].value+"&departure_day="+form.departure_day.options[form.departure_day.selectedIndex].value+"&departure_month="+form.departure_month.options[form.departure_month.selectedIndex].value+"&dest_dep="+no_ville;
 }

function refreshHotels(FormEnCours, DestEnCours)
{
    if ( DestEnCours == "0" )  { DestEnCours = FormEnCours.dest_dep.value }

//    var ListeEnCours = eval('dest_' + DestEnCours)
    var ListeEnCours = eval('dest_' + DestEnCours)
    FormEnCours.no_hotel.length = 1

    for (var compteur = 0; compteur < ListeEnCours.length; compteur++)
    {
//    	FormEnCours.no_hotel.options[compteur + 1] = new Option( ListeEnCours[compteur] )
        FormEnCours.no_hotel.options[compteur + 1] = new Option( eval('hotel_'+ListeEnCours[compteur]) )
        FormEnCours.no_hotel.options[compteur + 1].value = ListeEnCours[compteur]
    }
		
		if ( (DestEnCours == 'LAS') || (DestEnCours == 'LAX') || (DestEnCours == 'NAS') || (DestEnCours == 'HAV') ){
			FormEnCours.duration.length = 0
      FormEnCours.duration.options[0] = new Option( "3 or 4 days" )
      FormEnCours.duration.options[0].value = "3"
      FormEnCours.duration.options[1] = new Option( "1 week" )
      FormEnCours.duration.options[1].value = "7"
		}
		else{
			FormEnCours.duration.length = 0
      FormEnCours.duration.options[0] = new Option( "1 week" )
      FormEnCours.duration.options[0].value = "7"
      FormEnCours.duration.options[1] = new Option( "2 weeks" )
      FormEnCours.duration.options[1].value = "14"
		}
		
}
 
function refreshStars(FormEnCours, HotelEnCours)
{
    if ( HotelEnCours == "0" )  { HotelEnCours = FormEnCours.no_hotel.value }

      if (HotelEnCours == "") 
      {
        FormEnCours.starrq.length = 1

        FormEnCours.starrq.options[1] = new Option( "2 stars or better" )
        FormEnCours.starrq.options[1].value = "2"
        FormEnCours.starrq.options[2] = new Option( "3 stars or better" )
        FormEnCours.starrq.options[2].value = "3"
        FormEnCours.starrq.options[3] = new Option( "4 stars or better" )
        FormEnCours.starrq.options[3].value = "4"
        FormEnCours.starrq.options[4] = new Option( "5 stars or better" )
        FormEnCours.starrq.options[4].value = "5"

      }
      else
      {  FormEnCours.starrq.length = 1  }
}
