function prrLoad() { // read the current relations var rels = byId('prodrelations').value.split('|||'); for(var i=0; i1; i++) { var rel = rels[i].split(',', 3); prrAdd(rel[0], rel[1], rel[2]); } prrEmpty(); // bind the add-link byName(byClass(byId('relation_new'), 'td', 'tc_add')[0], 'a')[0].onclick = prrFormAdd; // dropdown dsInit(byName(byClass(byId('relation_new'), 'td', 'tc_prod')[0], 'input')[0], '/xml/producers.xml?q=', function(item, tr) { tr.appendChild(tag('td', { style: 'text-align: right; padding-right: 5px'}, 'p'+item.getAttribute('id'))); tr.appendChild(tag('td', shorten(item.firstChild.nodeValue, 40))); }, function(item) { return 'p'+item.getAttribute('id')+':'+item.firstChild.nodeValue; }, prrFormAdd); } function prrAdd(rel, pid, title) { var sel = tag('select', {onchange: prrSerialize}); var ops = byName(byClass(byId('relation_new'), 'td', 'tc_rel')[0], 'select')[0].options; for(var i=0; i