+ var nodes = node.childNodes;
+ var dn = 0;
+ var lastname = '';
+ var i;
+ for (i = 0; i < nodes.length; i++)
+ {
+ if (nodes[i].nodeType != 1)
+ continue;
+ var name = nodes[i].nodeName;
+ if (name == 'recid' || name == 'md-title')
+ continue;
+ if (name != lastname && lastname != 'location')
+ {
+ if (dn)
+ {
+ var tr = paint_details_tr(lastname, dn);
+ target.appendChild(tr);
+ }
+ dn = document.createElement('td');
+ lastname = name;
+ }
+ if (name == 'location')
+ {
+ target.appendChild(paint_details_tr('Location', paint_subrecord(nodes[i])));
+ continue;
+ }
+ if (!nodes[i].childNodes[0])
+ continue;
+ var value = nodes[i].childNodes[0].nodeValue;
+ if (dn.childNodes[0])
+ dn.appendChild(document.createTextNode('; '));
+ var hyl = hyperlink_field(name);
+ var nv;
+ if (hyl)
+ {
+ nv = create_element('a', value);
+ if (hyl == 'URL')
+ {
+ nv.setAttribute('href', value);
+ nv.setAttribute('target', '_blank');
+ }
+ else
+ {
+ nv.setAttribute('href', '#');
+ nv.setAttribute('term', value);
+ nv.setAttribute('searchfield', hyl);
+ nv.onclick = function() { hyperlink_search(this); return false; };
+ }
+ }
+ else
+ nv = document.createTextNode(value);
+ dn.appendChild(nv);
+ }
+ if (dn && lastname != 'location')
+ {
+ var tr = paint_details_tr(lastname, dn);
+ target.appendChild(tr);
+ }
+}
+
+function paint_subrecord(node)
+{
+ var table = document.createElement('table');
+ var zurl = node.getAttribute('id');
+ var tr = paint_details_tr('Source', document.createTextNode(zurl));
+ table.appendChild(tr);
+ paint_data_elements(table, node);
+ return table;
+}
+
+function paint_details(body, xml)
+{
+ clear_cell(body);
+ var table = document.createElement('table');
+ table.setAttribute('cellpadding', 2);
+ paint_data_elements(table, xml.childNodes[0]);
+ body.appendChild(table);
+ body.style.display = 'inline';
+}
+
+function show_details()
+{
+ if (xfetchDetails.readyState != 4)