﻿//ARF 26/02/2010 · Creación
function rellenaComboPuertos(info, urlBase, sesion, textoSeleccionePuerto){
    
   var urlPuertos = urlBase + "?sesionPassport=" + sesion;
   var buscadorPuertosSalida_xmlPuertosSalida = Sarissa.getDomDocument();           
   buscadorPuertosSalida_xmlPuertosSalida.async = false;                      
   buscadorPuertosSalida_xmlPuertosSalida.load(urlPuertos + "&next=puertosSalida&info=" + info);
   var l_nodeC = buscadorPuertosSalida_xmlPuertosSalida.selectNodes("xml/PuertosSalida/Puerto");
         
   if (l_nodeC.length > 0){
       var opciones = document.getElementById("puertos").length;
       while(document.getElementById("puertos").hasChildNodes()){
            document.getElementById("puertos").removeChild(document.getElementById("puertos").lastChild);
       }              
       var opcion = document.createElement('option');
       opcion.text = "-- " + textoSeleccionePuerto + " --";
       opcion.value = "SINSELECCION";       
       document.getElementById("puertos").options[0] = opcion;       
       for (var indL=0;indL<l_nodeC.length;indL++) {
            var puertoDes = l_nodeC[indL].getAttribute("des");
            var puertoCod = l_nodeC[indL].getAttribute("cod").toUpperCase();                  
            opcion = document.createElement('option');
            opcion.text = puertoDes;
            opcion.value = puertoCod;
            document.getElementById("puertos").options[indL + 1] = opcion;                          
       }              
   }
}

 

