var HeaderScp = "load bdna.pdb; moveto 0 {-858 308 -410 111.1} 100.0 0.0 0.0 {-0.07799959 -0.10200024 -0.0050001144} 25.5";




// study panel -------------
var NucSettings="Atoms,0.4,Bonds,0.15,Dots,|mol;Nucleotide;all|,Element,|col;Base;shapely|";

var dxAdeScp = "load ade5Pdxy.pdb; moveto 0 { 673 -107 -732 125.57} 100.0 0.0 0.0  {0.57185006 -0.33210003 0.13614988} 8.141462 {0.0 0.0 0.0} 1.237769 -1.9065288 50.0; isBase={(atomno>=12 AND atomno<=21) OR (atomno>=32 AND atomno<=35)};{@isBase}.property_typeIndx=1; isPO4={(atomno>=1 AND atomno<=4) OR atomno=22 OR atomno=31 OR atomno=36};{@isPO4}.property_typeIndx=2; isCarb={(atomno>=5 AND atomno<=11) OR (atomno>=23 AND atomno<=30)};{@isCarb}.property_typeIndx=3; select all; spacefill 0.4; wireframe 0.15";
var dxAdeMsg = "Deoxy-Adenosine-5-phosphate";

var GuaScp = "load gua5P.pdb; moveto 0 { -918 80 388 141.61} 100.0 0.0 0.0  {-0.19769979 0.19269991 0.29104996} 8.057315 {0.0 0.0 0.0} 2.3814003 0.07957994 50.0; CONNECT (atomno=1)(atomno=24) single; wireframe 0.15; isBase={(atomno>=13 AND atomno<=23) OR (atomno>=33 AND atomno<=36)};{@isBase}.property_typeIndx=1; isPO4={atomno<=4 OR atomno=24 OR atomno=32 OR atomno=38};{@isPO4}.property_typeIndx=2; isCarb={(atomno>=5 AND atomno<=12) OR (atomno>=25 AND atomno<=31) OR atomno=37};{@isCarb}.property_typeIndx=3; select all; spacefill 0.4; wireframe 0.15";
var GuaMsg = "Guanosine-5-phosphate";

var CytScp = "load cyt5P.pdb; moveto 0 { -961 229 151 156.72} 100.0 0.0 0.0 {0.15950012 0.09099996 -0.03850007} 7.908721 {0.0 0.0 0.0} -0.6284497 -1.054292 50.0; isBase={(atomno>=13 AND atomno<=20) OR (atomno>=30 AND atomno<=33)};{@isBase}.property_typeIndx=1; isPO4={atomno<=4  OR atomno=21 OR atomno=29 OR atomno=35};{@isPO4}.property_typeIndx=2; isCarb={(atomno>=5 AND atomno<=12) OR (atomno>=22 AND atomno<=28) OR atomno=34};{@isCarb}.property_typeIndx=3; select all; spacefill 0.4; wireframe 0.15";
var CytMsg = "Cytosine-5-phosphate";

var dxThyScp = "load thy5Pdxy.pdb; moveto 0 { -951 269 152 156.6} 100.0 0.0 0.0  {-0.40299964 -0.18264997 0.27764994} 7.698847 {0.0 0.0 0.0} 1.7855296 3.2023313 50.0;  isBase={(atomno>=12 AND atomno<=20) OR (atomno>=31 AND atomno<=35)};{@isBase}.property_typeIndx=1; isPO4={atomno<=4  OR atomno=21 OR atomno=30 OR atomno=36};{@isPO4}.property_typeIndx=2; isCarb={(atomno>=5 AND atomno<=11) or (atomno>=22 AND atomno<=29)};{@isCarb}.property_typeIndx=3; select all; spacefill 0.4; wireframe 0.15";
var dxThyMsg = "Deoxy-Thymidine-5-phosphate";


var UraScp = "load ura5P.pdb; select atomno=1,atomno=33; CONNECT (selected) DELETE; moveto 0 { -921 54 386 137.36} 95.41 -0.2 3.29  {-0.5015 -0.074 -0.59450006} 6.9  {0.0 0.0 0.0} -0.21644443 0.04749298 50.0; isBase={(atomno>=13 AND atomno<=20) OR (atomno>=30 AND atomno<=32)};{@isBase}.property_typeIndx=1; isPO4={atomno<=4 OR atomno=21 OR atomno=29 OR atomno=34};{@isPO4}.property_typeIndx=2; isCarb={(atomno>=5 AND atomno<=12) OR (atomno>=22 AND atomno<=28) OR atomno=33}; {@isCarb}.property_typeIndx=3; spacefill 0.4; wireframe 0.15";
var UraMsg = "Uridine-5-phosphate";

var BPSettings="Atoms,0.4,Bonds,0.15,H-Bonds,0.15,Dots,|mol;Nucleotide;all|,Element,|col;Base;shapely|";
var ATBPScp= "load ATpair.pdb; select atomno=1 OR atomno=32; CONNECT (selected) single; moveto 0 { 162 338 927 59.2}  100.0 3.04 -4.09  /* center, rotationRadius */ {0.74799967 -0.1164999 0.13450003} 11.937467 {0.0 0.0 0.0} 0.8212401 -1.775078 50.0; select all; hbonds calculate; hbonds 0.15;spacefill 0.4; wireframe 0.15";
var ATBPMsg="Adenine-Thymine pair";

var GCBPScp= "load GCpair.pdb; select atomno=1 OR atomno=33; CONNECT (selected) single; moveto 0 { 162 338 927 59.2}  100.0 3.04 -4.09  /* center, rotationRadius */ {0.74799967 -0.1164999 0.13450003} 11.937467  {0.0 0.0 0.0} 0.8212401 -1.775078 50.0; select all; hbonds calculate; hbonds 0.15; spacefill 0.4; wireframe 0.15";
var GCBPMsg="Guanine-Cytosine pair";

var UABPScp= "load UApair.pdb;  select all; connect (selected) aromatic modify; calculate aromatic; moveto 0 { -90 -100 991 162.64} /* zoom, translation */  100.0 0.0 0.12  /* center, rotationRadius */ {0.74799967 -0.1164999 0.13450003} 11.937467 {0.0 0.0 0.0} 2.9048634 1.4195558 50.0; select all; hbonds calculate; hbonds 0.15; spacefill 0.4; wireframe 0.15";
var UABPMsg="Uracil-Adenine pair";

var BkbSettings="Atoms,0.4,Bonds,0.15,Dots,Ribbon,Trace,|mol;Strand;all|,Element,|col;Base;shapely|";
var BkbScp="load bdna.pdb; spacefill 0.4; wireframe 0.15; hide all; display visible OR [G]1:A OR [C]2:A; select base; color atoms shapely; moveTo 0 { 288 711 -642 137.55} 324.32 -45.56 -118.61  {-0.07799959 -0.10200024 -0.0050001144} 25.542456 {atomno=26} -45.343945 -118.75693 50.0; delay 0.5; moveTo 2 { 746 504 -436 92.43} 324.32 -28.74 -135.36 {-0.07799959 -0.10200024 -0.0050001144} 25.542456 {0 0 0} -27.934595 -135.58023 50.0; select atomno=8 OR atomno=9;for(var i = 1; i <= 6; i = i + 1); color bonds yellow; delay 0.5; color bonds magenta; delay 0.5; end for; restrict visible; select {:A.C1* OR :A.C2* OR :A.C3* OR :A.C4* OR :A.C5*}; set labelOffset 0 0; font label 20; color label gold; label %a; select visible;";
var BkbMsg="Phosphodiester bond";

var Bkb2Settings="Atoms,0.4,Bonds,0.15,Dots,Trace,150,|mol;Strand;all|,Element,|col;Base;shapely|";
var Bkb2Scp="load bdna.pdb; spacefill 0.4; select :A.H1 OR :A.H2 OR :A.H3; color atoms shapely; spacefill 0; hide all; display visible OR [G]1:A OR [C]2:A; select base; spacefill 0; color atoms shapely; moveto 0 { 746 504 -436 92.43} 324.32 -28.74 -135.36  {-0.07799959 -0.10200024 -0.0050001144} 25.542456 {visible} -27.934595 -135.58023 50.0; select atomno=8 or atomno=9; color bonds magenta; delay 0.5; display visible OR [G]3:A; delay 0.5; moveto 0.5 { 925 276 -262 80.9} 234.37 -11.09 -76.81 {-0.07799959 -0.10200024 -0.0050001144} 25.542456 {0.0 0.0 0.0} -10.557395 -76.88092 50.0; display visible OR [A]4:A; delay 1; moveto /* time, axisAngle */ 1.0 { -53 -672 738 179.0} /* zoom, translation */  220.39 1.17 -61.41  /* center, rotationRadius */ {-0.07799959 -0.10200024 -0.0050001144} 25.542456 /* navigation center, translation, depth */ {0.0 0.0 0.0} 0.86259574 -61.501343 50.0; display visible OR [A]5:A; delay 1; moveto /* time, axisAngle */ 1.0 { 531 584 -614 131.73} /* zoom, translation */  171.19 -1.63 -38.09  /* center, rotationRadius */ {-0.07799959 -0.10200024 -0.0050001144} 25.542456 /* navigation center, translation, depth */ {0.0 0.0 0.0} -1.3536115 -38.17696 50.0; display visible OR [A]6:A OR [T]7:A; delay 1; moveTo /* time, axisAngle */ 1.0 { 993 72 -90 105.1} /* zoom, translation */  144.33 0.7 -20.97  /* center, rotationRadius */ {-0.07799959 -0.10200024 -0.0050001144} 25.542456 /* navigation center, translation, depth */ {0.0 0.0 0.0} 0.97058374 -21.001162 50.0; display visible OR [T]8:A OR [T]9:A; delay 1; moveto /* time, axisAngle */ 1.0 { 993 63 -97 105.19} /* zoom, translation */  106.6 1.4 -5.46  /* center, rotationRadius */ {-0.07799959 -0.10200024 -0.0050001144} 25.542456 /* navigation center, translation, depth */ {0.0 0.0 0.0} 1.5962547 -5.5144734 50.0; display visible OR [G]10:A OR [C]11:A OR [G]12:A; select :A; trace 150; color trace gold; ";
var Bkb2Msg="A single DNA strand";

var Bkb3Settings="Atoms,0.4,Bonds,0.15,H-Bonds,0.15,Dots,Trace,150,|mol;Strand;all|,Element,|col;Base;shapely|";
var Bkb3Scp="display visible OR :B; select :B; trace 150; color trace gold; select :B.H1 OR :B.H2 OR :B.H3; spacefill 0; select all; hbonds calculate; hbonds 0.15; color hbonds magenta";
var Bkb3Msg="DNA double helix";

var RNASettings="Atoms,0.4,Bonds,0.15,Dots,Trace,Ribbon,|mol;RNA;all|,Backbone,Sidechain,Element,|col;Base;shapely|";
var RNAScp = "load ribozyme.pdb; moveto 0 { -1 987 160 86.27} /* zoom, translation */  100.0 0.0 0.0  /* center, rotationRadius */ {24.3405 -0.75699997 33.146} 22.60893 /* navigation center, translation, depth */ {0.0 0.0 0.0} -87.33384 22.876339 50.0; select all; color atoms shapely";
var RNAMsg = "RNA molecule";

var tRNASettings="Atoms,0.4,Bonds,0.15,Dots,Trace,200,Ribbon,|mol;RNA;all|,Backbone,Sidechain,Element,|col;Base;shapely|";
var tRNAScp = "load 1ehz.pdb; moveto 0  { -221 804 551 137.64} 129.0 -11.13 -4.75  {60.992996 51.431 25.178501} 51.9 {0.0 0.0 0.0} 77.38453 61.054626 50.0; select all; hide selected; select rna; subset selected; display selected; trace 200; color trace green; select rna; spacefill 0; wireframe 0.2";
var tRNAMsg = "RNA molecule tRNA";


var OrnSettings="Atoms,0.4,Bonds,0.15,Dots,Trace,Ribbon,|mol;DNA;all|,Backbone,Sidechain,Element,|col;Base;shapely|";
var OrnScp= "load trinuc.pdb; hide :B; subset :A; spacefill 0.5; moveto 0 { 366 -831 419 46.46} /* zoom, translation */  127.27 20.09 18.73  /* center, rotationRadius */ {-0.13849974 -0.10200024 15.210501} 13.165577 /* navigation center, translation, depth */ {0.0 0.0 0.0} 55.49537 -7.0655155 50.0; select sidechain OR :A.H1; delay 0.5; spacefill 0.3; delay 0.5; spacefill 0.2; delay 0.5; spacefill 0.1; delay 0.5; spacefill 0; color bonds gray; select {:A.C3* OR :A.C5*}; set labelOffset 0 0; font label 20; color label gold; label %a; draw line1 diameter 0.5 ARROW  {-8.727989 5.109993 22.509233} {-3.6724434 10.079859 17.226017} {3.449131 10.235315 11.770248}; color $line1 yellow ";
var OrnMsg = "Orientation of trinucleotide"

var Orn2Settings="Atoms,0.4,Bonds,0.15,Dots,H-Bonds,0.15,Trace,Ribbon,|mol;DNA;all|,Backbone,Sidechain,Element,|col;Base;shapely|";
var Orn2Scp="load trinuc.pdb; hide :B; spacefill 0.5; moveto 0  { -33 -471 -882 71.94} /* zoom, translation */  127.27 -14.02 24.81  /* center, rotationRadius */ {-0.13849974 -0.10200024 15.210501} 13.165577 /* navigation center, translation, depth */ {0.0 0.0 0.0} 13.1209755 45.94646 50.0; select sidechain OR :A.H1 OR :B.H1; spacefill 0; color bonds gray; select {:A.C3* OR :A.C5* OR :B.C3* OR :B.C5*}; set labelOffset 0 0; font label 20; color label gold; label %a; draw line1 diameter 0.5 ARROW  {-8.727989 5.109993 22.509233} {-3.6724434 10.079859 17.226017} {3.449131 10.235315 11.770248}; color $line1 yellow; moveto /* time, axisAngle */ 2 { 381 -789 482 48.27} /* zoom, translation */  93.96 3.27 2.73  /* center, rotationRadius */ {-0.13849974 -0.10200024 15.210501} 13.165577 /* navigation center, translation, depth */ {0.0 0.0 0.0} 28.99669 -19.00728 50.0; display visible or :B; select all; hbonds calculate; hbonds 0.15; color hbonds magenta; draw line2 diameter 0.5 ARROW {-0.47668076 -10.164974 9.013031} {7.859913 -7.5148773 15.116369} {8.966885 0.31711006 20.33403}; delay 1; moveto 3 { -846 125 519 86.22} /* zoom, translation */  93.96 3.27 2.85  /* center, rotationRadius */ {-0.13849974 -0.10200024 15.210501} 13.165577 /* navigation center, translation, depth */ {0.0 0.0 0.0} 18.047262 51.88727 50.0; moveto 3 { 819 -527 228 79.06} /* zoom, translation */  93.96 3.27 2.85  /* center, rotationRadius */ {-0.13849974 -0.10200024 15.210501} 13.165577 /* navigation center, translation, depth */ {0.0 0.0 0.0} 22.555372 -47.35002 50.0;";
var Orn2Msg = "Double stranded trinucleotide";

var Orn3Settings="Atoms,0.4,Bonds,0.15,Dots,Trace,Ribbon,DNA,Backbone,Sidechain,Element,|col;Base;shapely|";
var Orn3Scp="load bdna.pdb; set labelGroup; moveto 0 { -841 351 412 107.34} /* zoom, translation */  100.0 0.0 0.12  /* center, rotationRadius */ {-0.07799959 -0.10200024 -0.0050001144} 25.542456 /* navigation center, translation, depth */ {0.0 0.0 0.0} -0.061070807 0.01725417 50.0; select (sidechain OR :A.H1 OR :B.H1 OR :A.H2 OR :B.H2 OR :A.H3 OR :B.H3); spacefill 0; color bonds gray; select  not (sidechain OR :A.H1 OR :B.H1 OR :A.H2 OR :B.H2 OR :A.H3 OR :B.H3); spacefill 0.8; select {:A.C3* OR :A.C5* OR :B.C3* OR :B.C5*}; set labelOffset 0 0; font label 16 bold; color label gold; label %a; select atomno=1 OR atomno=389; set labelOffset 0 0; font label 20 bold; color label blue; label 5' end; select atomno=362 OR atomno=747; set labelOffset 0 0; font label 20 bold; color label blue; label 3' end; select {*}";
var Orn3Msg="A longer DNA double helix";

var MaMSettings="Atoms,0.4,Bonds,0.15,Dots,Trace,Ribbon,DNA,Backbone,Sidechain,Element,|col;Base;shapely|";
var MaMScp="load bdna.pdb; moveto 0 { -385 -680 -624 146.04}  100.0 0.0 0.12  {-0.07799959 -0.10200024 -0.0050001144} 25.542456 {0.0 0.0 0.0} 0.08018613 0.0855501 50.0; measure 354 516; measure 454 195; font measure 20; set measure 3; color measure magenta; set measurementNumbers OFF; select atomno=507; color label magenta; set labeloffset 20 -30; font label 20 bold; label Minor|Groove;  select atomno=189; set labeloffset -50 -100; color label magenta; font label 20 bold; label Major|Groove;";
var MaMMsg="Major and minor grooves";
//{6.7874603 -2.245514 -6.7429657} {-3.0184479 7.4188538 -12.11953}

var MaM2Settings="Atoms,0.4,Bonds,0.15,Dots,Trace,Ribbon,DNA,Backbone,Sidechain,Element,|col;Base;shapely|";
var MaM2Scp="load bdna.pdb; hbonds calculate; hbonds 0.15; color hbonds magenta; moveto 0 { -385 -680 -624 146.04} /* zoom, translation */  100.0 0.0 0.12  /* center, rotationRadius */ {-0.07799959 -0.10200024 -0.0050001144} 25.542456 /* navigation center, translation, depth */ {0.0 0.0 0.0} 0.08018613 0.0855501 50.0; measure 354 516; measure 454 195; font measure 20; set measure 3; color measure magenta; set measurementNumbers OFF; select atomno=507; color label magenta; set labeloffset 20 -30; font label 20 bold; label Minor|Groove;  select atomno=189; set labeloffset -50 -100; color label magenta; font label 20 bold; label Major|Groove; delay 0.5; label off; hide [G]1:A OR [C]12:B OR [C]1:B OR [G]12:A; delay 0.5; hide hidden or [C]2:A OR [G]11:B OR [G]2:B OR [C]11:A; delay 0.5; hide hidden or [G]3:A OR [C]10:B OR [C]3:B OR [G]10:A; delay 0.5; hide hidden or [A]4:A OR [T]9:B OR [A]4:B OR [T]9:A; delay 0.5; hide hidden or[A]5:A OR [T]8:B OR [A]5:B OR [T]8:A; delay 0.5; hide  hidden or [A]6:A OR [T]7:B;moveto /* time, axisAngle */ 2.0 { 121 5 993 53.64} /* zoom, translation */  229.02 0.0 0.0  /* center, rotationRadius */ {-0.936 -0.040999997 -1.718} 26.853096 /* navigation center, translation, depth */ {0.0 0.0 0.0} 2.6853502 -2.7937646 50.0; center atomno=565; measure 556 203; measure 195 548; font measure 16; set measure 3; color measure magenta; select atomno=579; color label magenta; font label 20 bold; set labelOffset 0 -30; label Minor Groove; select atomno=577; set labelOffset 0 20; color label magenta; font label 20 bold; label Major Groove";
var MaM2Msg="Assymmetry across nucleotide pair"


var OpnSettings="Atoms,2.0,Bonds,0.15,H-Bonds,Dots,Trace,Ribbon,Protein,DNA,Element,|col;Base/Amino;shapely|";
var OpnScp="load 1osl_modif.mol; select nucleic; spacefill off; wireframe off; trace 200; color trace orange; select bases; spacefill 2.0; color [x6495ED]; select protein; wireframe 0.15; spacefill 2.0; color [xDDA0DD]; moveto 0 1 0 0 100;"; 
var OpnMsg="DNA-protein complex"

var ZnFSettings="Atoms,2.0,Bonds,0.15,H-Bonds,Dots,Trace,Ribbon,Protein,DNA,4o Structure,Element,|col;Base/Amino;shapely|";
var ZnFScp="load 1DH3.pdb; moveto 0 { 878 -452 160 172.1}  98.94 -1.56 7.64  {59.0575 7.7299995 50.5005} 51.680565  {0.0 0.0 0.0} -39.50622 -61.241196 50.0; select hetero; hide selected; subset not selected; select nucleic; spacefill 1.2; wireframe 0.15; color atoms chain; select bases; spacefill 1.0; color atoms shapely; select protein; color atoms chain; wireframe 0.15; spacefill 2.0; "; 
var ZnFMsg="Zinc-finger regulatory protein"


var MutMMSettings="Atoms,0.4,Bonds,0.15,H-Bonds,Dots,Trace,Ribbon,DNA,Element,|col;Base;shapely|";
var MutMMScp="load 1fky.pdb; moveto 0 { 271 -432 860 97.84}  100.0 0.1 0.11   {-0.13000011 0.23499966 0.5739999} 22.769438  {0.0 0.0 0.0} 0.6947739 -1.1004386 50.0; spacefill 0.4; hbonds calculate";
var MutMMMsg="A Thymine - Cytosine mismatch"
var MutMM2Settings="Atoms,0.4,Bonds,0.15,H-Bonds,Dots,Trace,Ribbon,DNA,Element,|col;Base;shapely|";
var MutMM2Scp="load 1fky.pdb; moveto 0 { 271 -432 860 97.84}  100.0 0.1 0.11   {-0.13000011 0.23499966 0.5739999} 22.769438  {0.0 0.0 0.0} 0.6947739 -1.1004386 50.0; spacefill 0.4; hbonds calculate; moveTo  2.0 {24 944 328 147.06} 209.87 0.3 0.33 {-0.13000011 0.23499966 0.5739999} 22.769438  {0.0 0.0 0.0} -1.5483481 2.5712936 50.0; mut={[DT]17:B OR [DC]6:A}; select not @mut; color atoms darkslategray; for(var i = 0.4; i >= 0; i = i - 0.05); spacefill @i; delay 0.25; end for; select @mut";
var MutMM2Msg="A thymine - cytosine mismatch"

var MutTDSettings="Atoms,0.4,Bonds,0.15,H-Bonds,Dots,Trace,Ribbon,200,DNA,Element,|col;Base;shapely|";
var MutTDScp="load 1ql5.pdb; spacefill 0.4; hbonds calculate; hbonds 0.15; color hbonds magenta; ribbons 200";
var MutTDMsg="A thymine dimer"

var MutdePurSettings="Atoms,1.5,Bonds,0.15,H-Bonds,Dots,Trace,Ribbon,DNA,Element,|col;Base;shapely|";
var MutdePurScp="load dePur.pdb; select [G]10:A; translateSelected {1 0 0}; moveto 0 { -999 25 26 94.03} /* zoom, translation */  100.0 0.1 0.11  /* center, rotationRadius */ {-0.07799959 -0.10200024 -0.0050001144} 25.542456 /* navigation center, translation, depth */ {0.0 0.0 0.0} 0.14124456 0.0046459087 50.0; delay 0.5; moveto 2 { -999 16 34 94.06} /* zoom, translation */  160.72 0.41 -42.51  /* center, rotationRadius */ {-0.07799959 -0.10200024 -0.0050001144} 25.542456 /* navigation center, translation, depth */ {0.0 0.0 0.0} 0.53664553 -42.61627 50.0;";
var MutdePurMsg="Nucleotide depurination"


// inquiry panel -------------
var NucAtoms=Array("","the nitrogenous base","the phosphate","the carbohydrate");
var AdeAns="True,false,True,false"
var AdeScp = "load ade5P.pdb; moveto 0 { -442 500 -745 173.36} 100.0 0.0 0.0  {0.57185006 -0.33210003 0.13614988} 8.141462  {0.0 0.0 0.0} 0.7933314 -1.5587488 50.0; isBase={(atomno>=12 AND atomno<=22) OR (atomno>=32 AND atomno<=35)};{@isBase}.property_typeIndx=1; isPO4={(atomno>=1 AND atomno<=4) OR atomno=23 OR atomno=31 OR atomno=37};{@isPO4}.property_typeIndx=2; isCarb={(atomno>=5 AND atomno<=12) OR (atomno>=24 AND atomno<=30) OR atomno=36};{@isCarb}.property_typeIndx=3; select all; spacefill 0.4; wireframe 0.15";
var AdeMsg = "Nucleotide #1";

var dxCytAns="false,True,false,True"
var dxCytScp = "load cyt5Pdxy.pdb; moveto 0 { -961 229 151 156.72} 100.0 0.0 0.0 {0.15950012 0.09099996 -0.03850007} 7.908721 {0.0 0.0 0.0} -0.6284497 -1.054292 50.0; isBase={(atomno>=13 AND atomno<=20) OR (atomno>=30 AND atomno<=33)};{@isBase}.property_typeIndx=1; isPO4={atomno<=4  OR atomno=21 OR atomno=29 OR atomno=35};{@isPO4}.property_typeIndx=2; isCarb={(atomno>=5 AND atomno<=12) OR (atomno>=22 AND atomno<=28) OR atomno=34};{@isCarb}.property_typeIndx=3; select all; spacefill 0.4; wireframe 0.15";
var dxCytMsg = "Nucleotide #2";

var Ura2Ans="false,True,false,True"
var Ura2Scp = "load ura5P.pdb; select atomno=1,atomno=33; CONNECT (selected) DELETE; moveto 0 { -921 54 386 137.36} 95.41 -0.2 3.29  {-0.5015 -0.074 -0.59450006} 6.9  {0.0 0.0 0.0} -0.21644443 0.04749298 50.0; isBase={(atomno>=13 AND atomno<=20) OR (atomno>=30 AND atomno<=32)};{@isBase}.property_typeIndx=1; isPO4={atomno<=4 OR atomno=21 OR atomno=29 OR atomno=34};{@isPO4}.property_typeIndx=2; isCarb={(atomno>=5 AND atomno<=12) OR (atomno>=22 AND atomno<=28) OR atomno=33}; {@isCarb}.property_typeIndx=3; select all; spacefill 0.4, wireframe 0.15";
var Ura2Msg = "Nucleotide #3";

var dxGuaAns="True,false,false,True"
var dxGuaScp = "load gua5Pdxy.pdb;select atomno=1,atomno=23; CONNECT (selected) single; wireframe 0.15; moveto 0 { -442 500 -745 173.36} 100.0 0.0 0.0  {0.57185006 -0.33210003 0.13614988} 8.141462  {0.0 0.0 0.0} 0.7933314 -1.5587488 50.0; isBase={(atomno>=12 AND atomno<=22) OR (atomno>=33 AND atomno<=36)};{@isBase}.property_typeIndx=1; isPO4={(atomno>=1 AND atomno<=4) OR atomno=23 OR atomno=32 OR atomno=37};{@isPO4}.property_typeIndx=2; isCarb={(atomno>=5 AND atomno<=11) OR (atomno>=25 AND atomno<=31)};{@isCarb}.property_typeIndx=3; select all; spacefill 0.4; wireframe 0.15";
var dxGuaMsg = "Nucleotide #4";


var BP2Settings="Atoms,0.4,Bonds,0.15,Dots,|mol;Nucleotide;all|,Element,|col;Base;shapely|";
var GCBP2Ans="false,True,false,True,True,false,false,false,True,True,false,false"
var GCBP2Scp= "load GCpair.pdb; select atomno=1 OR atomno=33; CONNECT (selected) single; moveto 0 { 162 338 927 59.2}  100.0 3.04 -4.09   {0.74799967 -0.1164999 0.13450003} 11.937467  {0.0 0.0 0.0} 0.8212401 -1.775078 50.0; select all; wireframe 0.15; select base AND [G]; {selected}.property_typeIndx=1; select base AND [C]; {selected}.property_typeIndx=2; select atomno=34 OR atomno=52;{selected}.property_BPIndx=1; select atomno=31 OR atomno=53;{selected}.property_BPIndx=2; select atomno=17 OR atomno=69;{selected}.property_BPIndx=3; select all; spacefill 0.4; wireframe 0.15"
var GCBPMsg="Base Pair #1"

var UABP2Ans="True,false,True,false,false,True,false,True,false,false,false,True"
var UABP2Scp= "load UApair.pdb; select all; connect (selected) aromatic modify; calculate aromatic; moveto 0 { -90 -100 991 162.64}  100.0 0.0 0.12  {0.74799967 -0.1164999 0.13450003} 11.937467 {0.0 0.0 0.0} 2.9048634 1.4195558 50.0; select all; wireframe 0.15; select base AND [A]; {selected}.property_typeIndx=1; select base AND [U]; {selected}.property_typeIndx=2; select atomno=19 OR atomno=70;{selected}.property_BPIndx=1; select atomno=55 OR atomno=37;{selected}.property_BPIndx=2; select all; spacefill 0.4; wireframe 0.15"
var UdABPMsg="Base Pair #2"

var dCGBPAns="True,False,false,True,false,false,True,false,True,True,false,false"
var dCGBPScp= "load dCGpair.pdb; select all; connect (selected) aromatic modify; calculate aromatic; moveto 0  { 111 -120 -987 151.26} 95.43 -8.43 -4.7  {4.9855 -0.055500507 1.128} 12.426773 {0.0 0.0 0.0} 9.015533 -14.305583 50.0; select all; wireframe 0.15; select base AND [G]; {selected}.property_typeIndx=1; select base AND [C]; {selected}.property_typeIndx=2; select atomno=428 OR atomno=90;{selected}.property_BPIndx=1; select atomno=442 OR atomno=78;{selected}.property_BPIndx=2; select atomno=443 OR atomno=77;{selected}.property_BPIndx=3; select all; spacefill 0.4; wireframe 0.15; center atomno=442"
var dCGBPMsg="Base Pair #3"

var ATBP2Ans="false,True,false,True,True,false,false,True,false,false,True,false"
var ATBP2Scp= "load ATpair.pdb; select atomno=1 OR atomno=32; CONNECT (selected) single; moveto 0 { 162 338 927 59.2}  100.0 3.04 -4.09  /* center, rotationRadius */ {0.74799967 -0.1164999 0.13450003} 11.937467 {0.0 0.0 0.0} 0.8212401 -1.775078 50.0; select all; wireframe 0.15; select base AND [A]; {selected}.property_typeIndx=1; select base AND [T]; {selected}.property_typeIndx=2; select atomno=33 OR atomno=51;{selected}.property_BPIndx=1; select atomno=18 OR atomno=70;{selected}.property_BPIndx=2; select atomno=31 OR atomno=54;{selected}.property_BPIndx=3; select all; spacefill 0.4; wireframe 0.15"
var ATBP2Msg="Base Pair #4"

var EndsSettings="Atoms,0.4,Bonds,0.15,Dots,Trace,Ribbon,|mol;DNA;all|,Backbone,Sidechain,Element,|col;Base;shapely|";
var EndsScp= "load sixnuc.pdb; spacefill 0.5; moveto 0  { 111 -40 993 69.73} /* zoom, translation */  141.5 10.75 19.96  /* center, rotationRadius */ {-0.13849974 -0.10200024 15.210501} 13.165577 /* navigation center, translation, depth */ {0.0 0.0 0.0} 8.291955 9.815286 50.0; center atomno=498; select (atomno>=392 AND atomno<=399) OR (atomno>=409 AND atomno<=415);{selected}.property_typeIndx=1; select (atomno>=551 AND atomno<=558) OR (atomno>=569 AND atomno<=575);{selected}.property_typeIndx=2;select (atomno>=389 AND atomno<=391); {selected}.property_typeIndx=3"
var EndsMsg = "A short DNA strand"

var Ends2Settings="Atoms,1.5,Bonds,0.15,Dots,|mol;Nucleotide;all|,Backbone,Sidechain,White,Element,|col;Base;shapely|";
var Ends2Scp="load bdna.pdb; select dna; hide not selected; subset dna; spacefill 100%; color atoms white; select (atomno>=392 AND atomno<=399) OR (atomno>=409 AND atomno<=415) OR (atomno>=4 AND atomno<=11)OR (atomno>=23 AND atomno<=29);{selected}.property_typeIndx=1; select (atomno>=742 AND atomno<=749) OR (atomno>=759 AND atomno<=765) OR (atomno>=357 AND atomno<=364)OR (atomno>=377 AND atomno<=383);{selected}.property_typeIndx=2;select (atomno>=1 AND atomno<=3) OR (atomno>=389 AND atomno<=391); {selected}.property_typeIndx=3;";
var Ends2Msg="DNA double helix"


var TD2Settings="Atoms,1.5,Bonds,0.15,H-Bonds,Dots,Trace,Ribbon,DNA,White,Element,|col;Base;shapely|";
var TD2Scp="load ThyDim.pdb; restrict :A,:B; subset (:A OR :B);moveto 0 { 365 -829 -423 107.03}  100.0 0.0 0.0  {15.796 28.115501 49.885498} 20.521908 {0.0 0.0 0.0} 103.14577 20.080023 50.0; select [DT]5:B OR [DT]6:B; {selected}.property_typeIndx=1; select all; spacefill 1.5; color atoms white" //thymine dimer (dimer)
var TD2Ans="false,True,false,false,false,True,false,false"
var TD2Msg="Mutation #1"

var AGMM2Settings="Atoms,0.9,Bonds,0.15,H-Bonds,Dots,Trace,Ribbon,DNA,Element,|col;Base;shapely|";
var AGMM2Scp="load 112D.pdb; restrict :A,:B; subset (:A OR :B); moveto 0 { 456 872 178 108.35}  100.0 0.0 0.0  {15.459001 20.382 7.9139996} 26.71705 {0.0 0.0 0.0} -26.074202 45.136738 50.0; select all; spacefill 0.9"; 
var AGMM2Ans="True,false,false,false,True,false,True,false"
var AGMM2Msg="Mutation #2"

var dePyrSettings="Atoms,1.5,Bonds,0.15,H-Bonds,Dots,Trace,Ribbon,DNA,Element,|col;Base;shapely|";
var dePyrScp="load dePyr.pdb; select [C]10:B; translateSelected {0 1 0}; select all; spacefill 100%; moveto 0 { -455 798 -396 101.73} /* zoom, translation */  100.0 0.1 0.11  /* center, rotationRadius */ {-0.07799959 -0.10200024 -0.0050001144} 25.542456 /* navigation center, translation, depth */ {0.0 0.0 0.0} 0.0068328665 0.013589539 50.0;"
var dePyrAns="false,false,false,True,false,false,false,True"
var dePyrMsg="Mutation #3"

var GGMMSettings="Atoms,1.5,Bonds,0.15,H-Bonds,Dots,Trace,Ribbon,DNA,Element,|col;Base;shapely|";
var GGMMScp="load ggmm.pdb" //80GG mismatch
var GGMMAns="True,false,false,false,false,false,True,false"
var GGMMMsg="Mutation #3"



function showCrbnNum(){
jmolScript("select {@isCarb AND carbon}; set labelOffset 0 0; set labelFront; color label gold; font label 20; label %a; select ALL");
}


function setNucAnswers(NucType){
	// for amino acid models set sidechain type checkbox values

var aAnswers = window[NucType+'Ans'].split(",");	
for (i=0;i<=aAnswers.length-1;i++){
	document.getElementById("qNuc"+(i+6)).value=aAnswers[i];
	}
}

function setBPAnswers(BPType){
	// for base pair models set asnswer checkbox values
var aAnswers = window[BPType+'Ans'].split(",");	
for (i=0;i<=6;i++){
	document.getElementById("qBP"+i).value=aAnswers[i];
	}
for (i=7;i<=11;i++){
	document.getElementById("q2BP"+i).value=aAnswers[i];
	}	
}

function setMutAnswers(MutType){
	// for base pair models set asnswer checkbox values
var aAnswers = window[MutType+'Ans'].split(",");	
for (i=0;i<=8;i++){
	document.getElementById("qMut"+i).value=aAnswers[i];
	}
}

var atmCount=0
var frstAtmNm=0
var frstAtmIdx=0
function IsPickCorrect (atomID){
	// examine atom selected and determine if it is correct	

document.getElementById(tallyGroup+"Attempts").value= Number(document.getElementById(tallyGroup+"Attempts").value)+1;	
if (quesGroup == 'Nuc'){
			// get the custom typeIndx property of the atom
	var typeIndx=jmolEvaluate("{atomno="+atmNm+"}.property_typeIndx");
			// to pick target is the the last character of toSelect (pP1, pP2, AA1, AA2, etc.)		
	var indx= toSelect.charAt(toSelect.length-1);
				// typeIndx property serves as index for atoms description array
		var AtomType = window[quesGroup + 'Atoms'][typeIndx];
				// ignore any undefined atoms
		if (typeIndx === 0) {return 'x';}
				// now look to see if the typeIndx property of the selected atom == pick target
				// and respond accordingly
		if (typeIndx+""===indx){
				document.getElementById(tallyGroup+"Correct").value = Number(document.getElementById(tallyGroup+"Correct").value)+1;
				return("Correct! This is "+AtomType+".");
				} 
		else{
				return("Oops! This is "+AtomType+".|Try Again.");
				}
			}
else if (quesGroup == 'NucCbn'){
			// get the custom typeIndx property of the atom
	var typeIndx=jmolEvaluate("{atomno="+atmNm+"}.property_typeIndx");
			// picking is for different carbon atoms of the carbohydrates
	if (SelatmName.search(toSelect)!= -1){
			document.getElementById(tallyGroup+"Correct").value = Number(document.getElementById(tallyGroup+"Correct").value)+1;
			return("Correct! This is the "+SelatmName+" carbon.");				
		}
	else{
			return("Oops! This is not the "+toSelect+"' carbon.");				
		}
	}
else if (quesGroup == 'findPur'){
			// this is for nucleotide pairs where students click on the purine 
			// get the custom typeIndx property of the atom
	var typeIndx=jmolEvaluate("{atomno="+atmNm+"}.property_typeIndx");
	if (typeIndx === 0) {
		return "This is not the nitrogenous|base of the nucleotide";
		}
	else if (typeIndx == 1){
		document.getElementById(tallyGroup+"Correct").value = Number(document.getElementById(tallyGroup+"Correct").value)+1;		
		return "Correct! This purine is a|"+molAbbr[grpID][0]+" base";
		}
	else if (typeIndx == 2){
		return "Oops! This is a|"+molAbbr[grpID][0]+" base";	
		}	
	}
else if (quesGroup == 'findBP'){
			// this is for nucleotide pairs where students click on the atoms forming H-bonds
			// get the custom typeIndx property of the atom
	var typeIndx=jmolEvaluate("{atomno="+atmNm+"}.property_BPIndx");
	if (typeIndx === 0) {
		return "This atom is not |involved in hydrogen bonding";
		}
	else {
		if (atmCount === 0){		
			atmCount=1;
			frstAtmNm=atmNm;		
			frstAtmIdx=typeIndx;		
			return "Good. Now click on the atom|to which it will bond.";
			}
		else{
			if (atmNm == frstAtmNm){
					return "Click on a different atom.";
				}
			else {
					if(frstAtmIdx == typeIndx){
						jmolScript("select atomno="+frstAtmNm+" OR atomno="+atmNm+"; CONNECT (selected) HBOND; hbond 0.2; color hbonds magenta");
						document.getElementById(tallyGroup+"Correct").value = Number(document.getElementById(tallyGroup+"Correct").value)+1;
						atmCount=0
						return "Correct! These atoms will hydrogen bond.";
						}
					else{
						atmCount=0
						return "Oops! These atoms do not|hydrogen bond.|Start again.";
					}
				}
			}
		}	
	}
else if (quesGroup == 'findEnds'){
	
			// this is for finding 3' and 5' ends
			// get the custom typeIndx property of the atom
	var typeIndx=jmolEvaluate("{atomno="+atmNm+"}.property_typeIndx");
	if (typeIndx == 3) {
		return "Oops. This is the |phosphate at the 5' end.";
		}
	if (toSelect == "5" && typeIndx == 1){	
			document.getElementById("EndsCorrect").value = Number(document.getElementById("EndsCorrect").value)+1;
			return "Correct. This is the |deoxyribose at the 5' end.";
			}	
	else if (toSelect =="3" && typeIndx == 2){
			document.getElementById("EndsCorrect").value = Number(document.getElementById("EndsCorrect").value)+1;
			return "Correct. That is the |deoxyribose at the 3' end.";
			}	
	else {
		return "This is not part of the |deoxyribose at the "+toSelect+"' end";
		}
	}
}

