/* author: Montserrat Buend�a Ruiz */ /* Creation date: 14/11/2005 */ /* 0) { select.remove(0); } } // retrieve text of an XML document element, including // elements using namespaces function getElementTextNS(prefix, local, parentElem, index) { var result = ""; if (prefix && isIE) { // IE/Windows way of handling namespaces result = parentElem.getElementsByTagName(prefix + ":" + local)[index]; } else { // the namespace versions of this method // (getElementsByTagNameNS()) operate // differently in Safari and Mozilla, but both // return value with just local name, provided // there aren't conflicts with non-namespace element // names result = parentElem.getElementsByTagName(local)[index]; } if (result) { // get text, accounting for possible // whitespace (carriage return) text nodes if (result.childNodes.length > 1) { return result.childNodes[1].nodeValue; } else { return result.firstChild.nodeValue; } } else { return "n/a"; } } function appendToSelect(select, value, content) { var opt = new Option(content, value); opt.value = value; select.options[select.length] = opt; } function rellenaDirecciones() { var select = document.incidencia.direccion; select.options.length = 0; var items = req.responseXML.getElementsByTagName("item"); // loop through elements, and add each nested // element to Topics select element appendToSelect( select, "", "Especificar direcci�n"); for (var i = 0; i < items.length; i++) { appendToSelect(select, getElementTextNS("", "nombre", items[i], 0), getElementTextNS("", "nombre", items[i], 0)); } fijaDireccion(); } // Coge la direccion de la cookie function cargarDirecciones() { var val = document.incidencia.provincia.value; limpiaDirecciones(); if ( val != 0 ) { loadXMLDoc( "xml/" + val + ".xml" ); } } function verOtraDireccion() { var val = document.incidencia.direccion.value; if (val == 'Otra direcci�n') { otradireccion.style.display='block'; } else { otradireccion.style.display='none'; } } /* ]]> */