  function doSearchCruzeiro()
  {
      var busca_tipo_destino = document.getElementById('busca_tipo_destino');
      var busca_tipo_companhia = document.getElementById('busca_tipo_companhia');
      var busca_tipo_navio = document.getElementById('busca_tipo_navio');

      if (busca_tipo_companhia.checked == true)
      {
          var busca_companhia = (document.getElementById('busca_companhia_nacional').checked == true ? document.getElementById('busca_companhia_1') : document.getElementById('busca_companhia_2'));
          if (busca_companhia.selectedIndex <= 0)
          {
              alert('Selecione uma companhia.');
              return false;
          }

      } else if (busca_tipo_navio.checked == true) {
          var busca_navio = document.getElementById('busca_navio');
          if (busca_navio.selectedIndex <= 0)
          {
              alert('Selecione um navio.');
              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 showDestinoNacionalCruzeiros()
  {
      var destinon = document.getElementById('busca_destino_1');
      var destinoi = document.getElementById('busca_destino_2');

      destinon.style.display = 'block';
      destinoi.style.display = 'none';
  }
  function showDestinoInternacionalCruzeiros()
  {
      var destinon = document.getElementById('busca_destino_1');
      var destinoi = document.getElementById('busca_destino_2');

      destinon.style.display = 'none';
      destinoi.style.display = 'block';
  }
  function showCompanhiaNacionalCruzeiros()
  {
      var companhian = document.getElementById('busca_companhia_1');
      var companhiai = document.getElementById('busca_companhia_2');

      companhian.style.display = 'block';
      companhiai.style.display = 'none';
  }
  function showCompanhiaInternacionalCruzeiros()
  {
      var companhian = document.getElementById('busca_companhia_1');
      var companhiai = document.getElementById('busca_companhia_2');

      companhian.style.display = 'none';
      companhiai.style.display = 'block';
  }
  function getEmbarqueCruzeiros(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_3'], escape(result[i]['campo_1_3']));
               busca_embarque.options[busca_embarque.options.length] = option;
          }
      }
      xmlreq.query(handler);
  }
  function showBuscaDestinyCruzeiros()
  {
      var box_pesquisa_destino = document.getElementById('box_pesquisa_destino');
      var busca_destinos_tipo = document.getElementById('busca_destinos_tipo');
      var box_pesquisa_companhia = document.getElementById('box_pesquisa_companhia');
      var box_pesquisa_navio = document.getElementById('box_pesquisa_navio');
      var busca_companhia_tipo = document.getElementById('busca_companhia_tipo');

      box_pesquisa_destino.style.display = 'block';
      busca_destinos_tipo.style.display = 'block';
      box_pesquisa_companhia.style.display = 'none';
      box_pesquisa_navio.style.display = 'none';
      busca_companhia_tipo.style.display = 'none';
  }
  function showBuscaCompanhiaCruzeiros()
  {
      var box_pesquisa_destino = document.getElementById('box_pesquisa_destino');
      var busca_destinos_tipo = document.getElementById('busca_destinos_tipo');
      var box_pesquisa_companhia = document.getElementById('box_pesquisa_companhia');
      var box_pesquisa_navio = document.getElementById('box_pesquisa_navio');
      var busca_companhia_tipo = document.getElementById('busca_companhia_tipo');

      box_pesquisa_destino.style.display = 'none';
      busca_destinos_tipo.style.display = 'none';
      box_pesquisa_companhia.style.display = 'block';
      box_pesquisa_navio.style.display = 'none';
      busca_companhia_tipo.style.display = 'block';
  }
  function showBuscaNavioCruzeiros()
  {
      var box_pesquisa_destino = document.getElementById('box_pesquisa_destino');
      var busca_destinos_tipo = document.getElementById('busca_destinos_tipo');
      var box_pesquisa_companhia = document.getElementById('box_pesquisa_companhia');
      var box_pesquisa_navio = document.getElementById('box_pesquisa_navio');
      var busca_companhia_tipo = document.getElementById('busca_companhia_tipo');

      box_pesquisa_destino.style.display = 'none';
      busca_destinos_tipo.style.display = 'none';
      box_pesquisa_companhia.style.display = 'none';
      box_pesquisa_navio.style.display = 'block';
      busca_companhia_tipo.style.display = 'none';
  }
