CONTACTS status flags: (there is no flag "preContacts") currentView = makePreContactsSpt() // use match() markContactsTargets true selectMode c=Chains, g=Residue, etc. BECOMES BLANK when contactsShowing=true contactsShowing true/false currentView = makeContactsShowingSpt() labelContacts --------------- the view link stores makePreContactsSpt() and makePreContactsHelp() When the view link is clicked both of the above are executed by --------- doViewLink() which before executing them if contacts are already showing (preContacts local to doViewLink()) confirms starting over if the new view is unrelated (not one to modify contacts e.g. find, hide, center, or a harmless one, e.g. more views or troubleshooting) then contactsShowing = false; markContactsTargets = false; if we are doing preContacts, resetContacts() which must be done before showing help. SHOWS HELP executes and shows makePreContactsHelp() (done before the script) if selectMode == "", clearSelectedArrays() and selectMode = "c". sets contactsView = "sf" clearSelectedArrays(); spt += "select none; define ~targ_current selected;\n"; DOES THE SCRIPT finally doMolViewSpt(makePreContactsSpt()) ---------------------------- doMolViewSpt() in scripts.js (for preContacts) does several things unrelated to contacts then calls ScriptToJmol() (top.js) does makeMarkContactsTargetSpt() then unchangedScriptToJmol() (top.js) ---------------------------- makePreContactsSpt() does not change any settings ---------------------------- The final view is done with makeGenerateContactsSpt() which clears hidden and then does makeDefineContactsSpt() + makeContactsViewSpt() all in scripts.js makeContactsViewSpt() uses bond-type checkboxes to select each checked category setting ~cont_targ and ~cont_current (balled atoms) redisplays anything hidden during contact target selection with clearHidden().