function display_FL_DR(flag)
{
   if( ! flag)
   {
      FO.HotelLevel.selectedIndex = 0;
      FO.Hotel.selectedIndex = 0;
      FO.HotelLevel.disabled = true;
      FO.Hotel.disabled = true;
   }
   else
   {
      FO.HotelLevel.disabled = false;
      FO.Hotel.disabled = false;
      /* * * getDestHotels(FO.Hotel, FO.Destination.value, FO.HotelLevel.value); * * * 30 / 04 / 2007 * */
   }
}
function validationForm40083()
{
   var retStr = '';
   if((FO.Destination.length > 0) && (FO.Destination.value == "0")) retStr += (FO.Destination.em1 + '\n');
   if((FO.DateFrom.value.length == 0)) retStr += (FO.DateFrom.em1 + '\n');
   if(retStr != '')
   {
      alert(retStr);
      return false;
   }
   else if ( ! checkFormDates(FO)) return false;
   return true;
}
function getDestHotels(ob, DestCode, LEVEL, xmlPageURL, reload)
{
   ClearCombo(ob);
   if(DestCode != "0")
   {
      var x = (reload) ? xmlFly.load(xmlPageURL) : null;
      xmlList = (LEVEL != 0) ? xmlFly.selectNodes("hotels/hotel[@level='"+LEVEL+"']") : xmlList = xmlFly.selectNodes("hotels/hotel");
      if(xmlList.length > 0) BuildCombo40083(ob, xmlList);
      if(ob.length == 2)
      {
         ob.selectedIndex = 1;
         ob.disabled = true;
      }
      else ob.disabled = false;
   }
}
function BuildCombo40083(ob, xList)
{
   for(var i = 0; i < xList.length; i ++ )
   {
      elem = document.createElement("OPTION");
      elem.value = xList.item(i).attributes[1].value;
      elem.text = xList.item(i).attributes[0].value;
      ob.add(elem);
   }
}
function Initialize()
{
   if(typeof FO.DateFrom == "object")
   {
      if( ! FO.DateFrom.value.length)FO.DateFrom.value = parseDateInToCalendarFormat(new Date());
   }
   if((FO.Destination.value != '0') && (FO.Destination.value != ''))
   {
      var x = ((FO.HotelLevel.value != '0') && (FO.HotelLevel.value != '')) ? FO.HotelLevel.value : null;
      FO.Destination.onchange();
      if(x != null)FO.HotelLevel.value = x;
      FO.HotelLevel.onchange();
      if(GLOB_Hotel.length && FO.Hotel.length > 1) FO.Hotel.value = GLOB_Hotel;
   }
   var e = ((GLOB_isTypeSelected != '0') && (GLOB_isTypeSelected != '') && (GLOB_isTypeSelected != undefined)) ? GLOB_isTypeSelected : null;
   if(e != null)
   {
      switchTheObjHotel(e);
      document.getElementById("hotel" + e).checked = true;
   }
   //FO.Destination.focus();
}
function changeHotel()
{
   var theObj = document.getElementById("Destination");
   var theObjHotel = theObj.options[theObj.selectedIndex].hotel;
   var theRadio = document.getElementById("hotel" + theObjHotel);
   switchTheObjHotel(theObjHotel);
   if(theObjHotel != "0") theRadio.checked = true;
}
function switchTheObjHotel(theObjHotel)
{
   switch (theObjHotel)
   {
      case "1" :
         changeRadio('hotelFLight', 'hotelOnly');
         changeRadio('hotelFLight', 'hotelCar');
         changeRadio('hotelFLight', 'hotelAll');
         display_FL_DR(true);
         disableThis('hotelGrade', false, 'DontDoo');
         disableThis1('hotelName', false, 'DontDoo');
         break;
      case "2" :
         changeRadio('hotelOnly', 'hotelFLight');
         changeRadio('hotelOnly', 'hotelCar');
         changeRadio('hotelOnly', 'hotelAll');
         display_FL_DR(true);
         disableThis('hotelGrade', false, 'DontDoo');
         disableThis1('hotelName', false, 'DontDoo');
         break;
      case "3" :
         changeRadio('hotelCar', 'hotelOnly');
         changeRadio('hotelCar', 'hotelFLight');
         changeRadio('hotelCar', 'hotelAll');
         display_FL_DR(false);
         disableThis('hotelGrade', false, 'Doo');
         disableThis1('hotelName', false, 'Doo');
         break;
      case "4" :
         changeRadio('hotelAll', 'hotelOnly');
         changeRadio('hotelAll', 'hotelFLight');
         changeRadio('hotelAll', 'hotelCar');
         display_FL_DR(true);
         disableThis('hotelGrade', false, 'DontDoo');
         disableThis1('hotelName', false, 'DontDoo');
         break;
   }
}
