+function paint_details_tr(name, dn)
+{
+ //emit a table row
+ var dname = displayname(name);
+ var ln = create_element('b', dname);
+ var tln = document.createElement('td');
+ tln.setAttribute('width', 70);
+ tln.setAttribute('valign', 'top');
+ tln.appendChild(ln);
+ var tr = document.createElement('tr');
+ tr.appendChild(tln);
+ tr.appendChild(dn);
+ return tr;
+}
+
+function paint_details(body, xml)
+{
+ clear_cell(body);
+ //body.appendChild(document.createElement('br'));
+ var nodes = xml.childNodes[0].childNodes;
+ var i;
+ var table = document.createElement('table');
+ table.setAttribute('cellpadding', 2);
+ var dn = 0;
+ var lastname = '';
+ 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)
+ {
+ if (dn)
+ {
+ var tr = paint_details_tr(lastname, dn);
+ table.appendChild(tr);
+ }
+ dn = document.createElement('td');
+ lastname = name;
+ }
+
+ if (!nodes[i].childNodes[0])
+ continue;
+ var value = nodes[i].childNodes[0].nodeValue;
+ if (dn.childNodes[0])
+ value = '; ' + value;
+ var nv = document.createTextNode(value);
+ dn.appendChild(nv);
+ }
+ if (dn)
+ {
+ var tr = paint_details_tr(lastname, dn);
+ table.appendChild(tr);
+ }
+ body.appendChild(table);
+ body.style.display = 'inline';
+}
+