  function doSearchPacote()
  {
      var busca_tipo_destino = document.getElementById('busca_tipo_destino');
      var busca_tipo_tipo = document.getElementById('busca_tipo_tipo');

      if (busca_tipo_tipo.checked == true)
      {
          var busca_tipo_viagem = document.getElementById('busca_tipo_viagem');
          if (busca_tipo_viagem.selectedIndex <= 0)
          {
              alert('Selecione um tipo de viagem.');
              return false;
          }

      } else {
          var busca_destino = (document.getElementById('busca_destino_nacional').checked == true ? document.getElementById('busca_destino_1') : document.getElementById('busca_destino_2'));
          var busca_embarque = document.getElementById('busca_embarque');

          var errs = new Array();
          if (busca_destino.selectedIndex <= 0)
              errs.push('É necessário escolher um destino.');
          if (busca_embarque.selectedIndex <= 0)
              errs.push('É necessário escolher um embarque.');
          if (errs.length > 0)
          {
              alert(errs.join('\n'));
              return false;
          }
      }
      return true;
  }
  function showDestinoNacional()
  {
      var destinon = document.getElementById('busca_destino_1');
      var destinoi = document.getElementById('busca_destino_2');

      destinon.style.display = 'block';
      destinoi.style.display = 'none';
  }
  function showDestinoInternacional()
  {
      var destinon = document.getElementById('busca_destino_1');
      var destinoi = document.getElementById('busca_destino_2');

      destinon.style.display = 'none';
      destinoi.style.display = 'block';
  }
  function getEmbarque(obj)
  {
      var valor = obj.options[obj.selectedIndex].value;
      var busca_embarque = document.getElementById('busca_embarque');
      var option = new Option('Selecione', '');

      busca_embarque.options.length = 0;
      if (valor == '')
      {
          busca_embarque.options[busca_embarque.options.length] = option;
          return;
      }
      option = new Option('Aguarde ...', '');<!---->
      busca_embarque.options[busca_embarque.options.length] = option;

      var handler = new XMLHandler();
      var xmlreq = new XMLClient(URLEMBARQUE);
      xmlreq.addParam('tipo', valor);

      handler.onError = function(e) {};
      handler.onProgress = function() {};
      handler.onInit = function() {};
      handler.onLoad = function (xmlStr)
      {
          var result = eval(xmlStr);
          var option = new Option('Selecione', '');
          var busca_embarque = document.getElementById('busca_embarque');

          busca_embarque.options.length = 0;
          busca_embarque.options[busca_embarque.options.length] = option;

          for (var i=0; i<result.length; i++)
          {
               option = new Option(result[i]['campo_1_4'], escape(result[i]['campo_1_4']));
               busca_embarque.options[busca_embarque.options.length] = option;
          }
      }
      xmlreq.query(handler);
  }
  function showBuscaDestiny()
  {
      var box_pesquisa_destino = document.getElementById('box_pesquisa_destino');
      var box_pesquisa_tipo = document.getElementById('box_pesquisa_tipo');
      var busca_destinos_tipo = document.getElementById('busca_destinos_tipo');

      box_pesquisa_destino.style.display = 'block';
      box_pesquisa_tipo.style.display = 'none';
      busca_destinos_tipo.style.display = 'block';
  }
  function showBuscaTipo()
  {
      var box_pesquisa_destino = document.getElementById('box_pesquisa_destino');
      var box_pesquisa_tipo = document.getElementById('box_pesquisa_tipo');
      var busca_destinos_tipo = document.getElementById('busca_destinos_tipo');

      box_pesquisa_destino.style.display = 'none';
      box_pesquisa_tipo.style.display = 'block';
      busca_destinos_tipo.style.display = 'none';
  }


