var plain_name; var pop; function edition(id){ tpl=open("/editions/"+id+"/","edition","top=20,left=440,height=560,width=400,scrollbars=yes, resizable=yes, titlebar=yes"); tpl.focus(); } function view_contract(id){ tpl=open("/contract/"+id+"/","edition","top=20,left=440,height=560,width=400,scrollbars=yes, resizable=yes, titlebar=yes"); tpl.focus(); } function fill(sel,text){ s=document.getElementById(sel); t=document.getElementById(text); t.value=s.value; } function openpopup(url){ if(pop){ try{ pop.focus(); }catch(e){ } } pop=open(url,"pmb","top=20, left=100, height=600, width=700, scrollbars=1, resizable=1, titlebar=1"); pop.focus(); } function getContainer(id){ v=document.getElementById('list_'+id); return v; } function removeperson(id){ c=getContainer(id); o=c.firstChild; while(true){ if(o.firstChild.checked){ po=o; o=o.nextSibling; c.removeChild(po); }else{ o=o.nextSibling; } if(!o) break; } } function addperson(id,type,step){ c=getContainer(id); switch(type){ case 'shareholders_person': case 'shareholders_proxy': if(step==-1){ rid=getShareholder(c,id); shsel=id; shtype=type; return; } break; } if(!c.lastChild) idx=1; else { n=c.lastChild.firstChild.nextSibling.name; i=n.substr(0,id.length); if(i==id){ v=n.substr(id.length+1); idx=parseInt(v)+1; } } var el=document.createElement("p"); el.className="t tiny"; var ch=document.createElement("input"); ch.type="checkbox"; ch.name='sel'+id+'['+idx+']'; ch.className="chbx"; el.appendChild(ch); var inp=document.createElement("input"); inp.name=id+'['+idx+']'; switch(type){ case 'plain': inp.type="text"; inp.size=60; inp.style.marginLeft='6pt'; inp.className="ininp"; if(plain_name){ inp.value=unescape(plain_name); plain_name=""; } break; default: inp.type="hidden"; inp.value=step; } el.appendChild(inp); sn=document.getElementById('shareholder_name'); if(sn){ s_name=sn.innerHTML; } ss=document.getElementById('shareholder_shares'); if(ss){ s_shares=ss.innerHTML; } switch(type){ case 'plain': break; case 'shareholders_person': var d=document.createElement("span"); d.innerHTML=' '+s_name+', '+s_shares+' shares'; el.appendChild(d); s_name='';s_shares=''; break; case 'shareholders_proxy': var d=document.createElement("span"); d.innerHTML=' '+s_name+', '+s_shares+' shares, represented by "; el.appendChild(d); s_name='';s_shares='';s_proxy=''; break; } c.appendChild(el); }