
/* - 65ferie.js - */
menu_bus = '<a class="dropmenu-item" href="'+portal_url+'/search?travelform=BUSREJSER">Busrejser</a>';
menu_plane = '<a class="dropmenu-item" href="'+portal_url+'/search?travelform=FLYREJSER">Flyrejser</a>';
menu_cruise = '<a class="dropmenu-item" href="'+portal_url+'/search?travelform=KRYDSTOGTER">Krydstogter</a>';

if (menu_rejseform) {
  menu_rejseform.unshift(menu_cruise);
  menu_rejseform.unshift(menu_plane);
  menu_rejseform.unshift(menu_bus);
}


function load_DestinationField()
{
  departure_select=document.booking_form.DeparturePlaceID;
  destination_select=document.getElementById('DestinationID');
  destination_select.options.length=1;
  if (departure_select.value=='header')
  {
     destination_select.disabled=true;     
  }
  else
  {
     url = "get_destination_list?code="+departure_select.value;
     var xmlhttp = new XMLHttpRequest();
     xmlhttp.open("GET", url, false);
     xmlhttp.send('');
     if (window.ActiveXObject) 
         {
         var parser=new DOMParser();
         var doc=parser.parseFromString(xmlhttp.responseText,"text/xml");
         x = doc.documentElement;
         items = x.getElementsByTagName('destination');
         }
     else
         {
         xml = xmlhttp.responseXML;
         items = xml.getElementsByTagName('destination');
         }
     count = items.length;
     if (count > 0)
      {
        for (var i=1;i<=count;i++)
          {
            destination_select.options.length++;
            destination_select.options[destination_select.options.length-1].value=items[i-1].getAttribute('id');
            destination_select.options[destination_select.options.length-1].text=items[i-1].getAttribute('name');
          }
        destination_select.disabled=false; 
      }
  }
  
}    


function toggle_submit_button()
{
  destination_select=document.getElementById('DestinationID');
  submit_button=document.getElementById('find_travel_submit');
  if (destination_select.value=='header')
  {submit_button.disabled = true}
  else
  {submit_button.disabled = false}
  
}    




