/* [url] contiene la dirección completa de donde se obtiene información (parcial)
 * [elementId] contiene el id del elemento html a actualizar */
function remoteProcedureToSelect( url, elementId, elfrom ) {
    xmlhttp = GetXmlHttpObject();
    if ( xmlhttp == null ) {
        /* Die in silent mode */;
        return;
    }
    xmlhttpNodeId = elementId;
    xmlhttp.onreadystatechange = function() {
        if ( xmlhttp.readyState == 4 ) {
            response = xmlhttp.responseXML.documentElement;
            
                /* check to see if we have any results for the
                 * searched keyword */
            if(response.childNodes.length) {
                el = document.getElementById( xmlhttpNodeId );
                for( i=0; i <= el.options.length; i++ ) {
                    el.options[i] = null;
                }
                el.options.length = 0;
                
                    /* we retrieve the new functions' names from the
                       document element as an array */
                resultsXml = response.getElementsByTagName( "agencia" );
                for( i = 0; i < resultsXml.length; i++ ) {  
                    value = resultsXml.item(i).firstChild.data;
                    id = resultsXml.item(i).getAttribute( "id" );
                    el[i] = new Option( value, id );
                }
            }
        }
    }
    xmlhttp.open( 'GET',
                  url + elfrom.options[elfrom.selectedIndex].value, true);
    xmlhttp.send( null );
    return false;
}

