User:BorisTM/protein.js

//

var cp=0; /* -- stores the Current Position -- */ var dc; /* -- domain color -- */ var dn; /* -- domain number -- */ var et; /* -- end of all tags -- */ var pl; /* -- stores "ps.length" -- */

function build_pro_TABLE(cell_padding,cell_spacing,style_class) { new_TABLE=document.createElement("TABLE"); new_TABLE.setAttribute("cellpadding",cell_padding); new_TABLE.setAttribute("cellspacing",cell_spacing); new_TABLE.className=style_class; }

function build_pro_TD(class_name) { new_TD=document.createElement("TD"); new_TR.appendChild(new_TD); if (class_name) new_TD.className=class_name; }

function build_pro_TR(class_name) { new_TR=document.createElement("TR"); new_TABLE.appendChild(new_TR); build_pro_TD(class_name); }

function build_protein_table { if (ps) { pl=ps.length; if (pl>1) { obj=document.getElementById("Structure"); if (obj) { obj=obj.parentNode.nextSibling.nextSibling.nextSibling; build_pro_TABLE(0,15,"pro_table"); obj.parentNode.insertBefore(new_TABLE,obj); new_TABLE.setAttribute("align","center"); build_pro_TR; build_pro_TABLE(0,0); new_TD.appendChild(new_TABLE); i1L=Math.ceil((pl-1)/50); i3F=1; dn=0; dc=1; for (i1=1; i1<=i1L; i1++) { build_pro_TR("pro_td"); new_TD.innerHTML=""+i3F+" "; build_pro_TD("pro_td_seq"); in_html=" "; for (i2=1; i2<=5; i2++) { in_html += ""; i3L=i3F+9; for (i3=i3F; i3<=i3L; i3++) { if ((i3) > (pl-1)) break; et=""; if (ama_c[cp]==(i3)){ in_html += ""; et=" "+et; cp += 2; }							in_html += ps.charAt(i3)+et; if (i3==dom_c[dn]){ dn += 2; dc += 2; if (i3 != i3L) in_html += " "; }						}						switch (i2){ case 5: in_html += " "; break; default: in_html += " "; }						if ((i3)>(pl-1)) break; i3F += 10; }					in_html += " "; new_TD.innerHTML=in_html; }			}		}	} }

//