// ===========================================================================
// This file, chapter.js, must be provided for each chapter.htm.
// Each chapter.js file contains the settings and content for one chapter.
// Each chapter should be in a separate directory (folder).
// Each chapter directory should contain one and only one chapter.htm file.
//
// Lines beginning "//" are comments for authors. They are ignored by JTAT.
// ===========================================================================

  // ========== SECTION I: PROVIDE SLIDERS? ============

  // These control whether this Chapter has a Slab ("Cut")
  // slider, in addition to a Zoom slider, or neither.
  // You cannot have a Slab slider without also having the Zoom slider.
  // The label on the slab slider (typically "Cut" or "Slab")
  // is defined in _jsutil/config2.js
showZoomSlider = true;
showSlabSlider = false;

  // ========== SECTION II: CHAPTER TITLE, INTRODUCTION ============

  // CHAPTER TITLE IS REQUIRED
chapterTitle = 'Animations & Movies';

  // CHAPTER SUBTITLE IS OPTIONAL
chapterSubtitle = '';

  // OPTIONAL INTRODUCTION FOR THIS CHAPTER
// Be sure to include paragraphs within <p></p> tags. This gives them margins.
chapterIntro =
'<p class="aboutJTAT">The purposes of this page are to demonstrate \n\
the inclusion in a JTAT tutorial of (i) animations in Jmol, and (ii) \n\
true movies, and to distinguish these two. \n\
</span></p><p> \n\
This page shows an animation, and a movie, of the lac repressor protein \n\
bending the DNA operon as the binding goes from nonspecific \n\
to specfic sequence recognition. \n\
<a href="http://atlas.proteinexplorer.org/morphs/lacrep" \n\
target="_blank">More about the science of these animations..</a> \n\
</p> \n\
<p><span class="aboutJTAT">Of course it makes little sense to have both a true \n\
movie (below) and an animation (in Jmol at left) of the same \n\
thing, but these are here merely to illustrate these two technologies.\n\
</span> \n\
<span class="forAuthors"> \n\
The distinctions between true movies and animations in Jmol are explained \n\
in the \n\
<a href="../../_docs/jtatdocs.htm#animvmov" \n\
target="_blank">Instructions for Authors</a>. \n\
</span></p> \n\
<span class="aboutJTAT"> \n\
<center><big>True Movies</big></center> \n\
<p>Below is a small true movie that happens to fit comfortably \n\
in the JTAT control panel. \n\
Such small movies can be placed anywhere in the JTAT control panel. \n\
Unlike the animations in Jmol at left, you can\'t rotate, zoom,  \n\
or quickly change the colors or rendering \n\
in such a true movie. \n\
</p></span> \n\
<center><a href="lacrepan.htm" target="_blank">\
<img src="../images4all/lacrep_anim_small.gif" align="center" \n\
title="Click for Larger Movie"></a></center> \n\
<p> \n\
<span class="aboutJTAT"> \n\
Larger true movies can be shown \n\
in a separate window. \n\
Click on the small movie above to see a \n\
<a href="lacrepan.htm" target="_blank">larger movie</a> \n\
in a separate window. \n\
</span> \n\
<span class="forAuthors"> \n\
See the Authoring Instructions for \n\
<a href="../../_docs/jtatdocs.htm#animvmov" \n\
target="_blank">when true movies are better than animations in Jmol</a> \n\
and \n\
<a href="../../_docs/jtatdocs.htm#movies" \n\
target="_blank">how to make true movies</a>. \n\
</span><\/p> \n\
';

  // ========== SECTION III: NAVIGATION (NEXT, PREVIOUS, CONTENTS, RESET) ============

  // The 3 URL's below must be relative to the current chapter.
  // The position and style of the navigation bar are set in config.js

  // Leave blank if there is only one chapter, and no contents page.
contentsButtonGoesTo = "../contents/contents.htm";

  // If the View buttons define the orientation/zoom, 
  // no Reset button is needed, so provideResetButton should be false.
  // In contrast, some chapters are designed to maintain the orientation and
  // zoom set previously by the user when a new view is displayed.
  // These need a Reset button, so provideResetButton should be true.
  // When provided, a Reset button runs reset.spt in the chapter's directory.
  // It allows Reset to do something different than the "View 1" button does.
provideResetButton = false; // ignored when isContents.

  // Leave blank if this is the first chapter.
previousChapterButtonGoesTo = "../ch_view2/chapter.htm";

  // Leave blank if this is the last chapter.
nextChapterButtonGoesTo = "../ch_comp/chapter.htm";


  // ========== SECTION IV: MOLECULAR VIEW BUTTONS ============

// Molecular View Button ===== ===== ===== ===== ===== ===== ===== ===== =====

	setupButton(1,                 // NUMBER OF MOLECULES
		"../molecules4all/1osl_19_1l1m_9_morph.pdb", // ATOMIC COORDINATE FILE
		"script view01.spt;",        // VIEW SCRIPT
		blackBackground, // blackBackground or whiteBackground
		spinningOff);  // spinningStart, spinningOn, spinningSame, or spinningOff

	// TEXT BEFORE MOLECULAR VIEW DESCRIPTION
	buttons[buttonNumber][iPreButtonText] =
'<center class="aboutJTAT"><big>Animations in Jmol</big></center>';

	// MOLECULAR VIEW DESCRIPTION
	buttons[buttonNumber][iButtonText] =
ckey("ff9090", "DNA", "/") + ckey("a0a0ff", "DNA", ", ") +
ss_key(", ") +
ckey("ff8000", "Disulfide bond", ".") +
' \n\
<center><table cellpadding="5" border="0"><tr><td valign="center"> \n\
Animation Controls \n\
<a href="javascript: jmolScript(\'animation pause;\', \'1\')"><img \n\
src="../../_imgutil/pause.gif" border="0" \n\
align="absmiddle" title="Stop or Pause Animation"></a> \n\
<a href="javascript: jmolScript(\'animation resume;\', \'1\')"><img \n\
src="../../_imgutil/play.gif" border="0" \n\
align="absmiddle" title="Play or Resume Animation"></a> \n\
</td></tr></table></center> \n\
 \n\
<br> \n\
<span class="aboutJTAT">Because this animation is in Jmol, \n\
it can be rotated and viewed from any perspective, while animating. \n\
Also, animation can be stopped and started with the controls above. \n\
Further, the color scheme and rendering \n\
can be changed by using different <i>View</i> scripts applied to the same atomic \n\
coordinate data file (see <i>View 2</i>). If desired, the speed of animation can be changed. \n\
The atomic coordinate data file is typically smaller than a movie \n\
as large as this Jmol. \n\
</span> \n\
';

/*
Using this causes Jmol to fail to load! Evidently it would have to be
executed after Jmol loads, e.g. onLoad in initChapter().

<div name="jtatCheckbox1" id="jtatCheckbox1"> \n\
<script language="javascript"> \n\
	jmolSetTarget("1");
  jmolCheckbox("frame pause", "frame resume", "Animate", true); \n\
</script> \n\
</div> \n\
*/

	// MOLECULAR VIEW DETAILS
	buttons[buttonNumber][iDetailsTitle] = "File Sizes";
	buttons[buttonNumber][iDetailsText] = '<span class="aboutJTAT"> \n\
The atomic coordinate (PDB) file containing the morph animation data is \n\
less than one-tenth the size of the large movie (accessed by clicking \n\
on the small movie above). The PDB file is less than half a megabyte \n\
(gzipped), while the large multi-GIF movie is about five megabytes. \n\
The PDB file begins with model 9 of 1osl, and ends with model 14 of 1l1m, \n\
with 12 intermediate linear interpolations, for a total of 14 frames. \n\
</span> \n\
';

	// TEXT AFTER MOLECULAR VIEW DESCRIPTION
	buttons[buttonNumber][iPostButtonText] = '';

// Molecular View Button ===== ===== ===== ===== ===== ===== ===== ===== =====

	setupButton(1,                 // NUMBER OF MOLECULES
		"../molecules4all/1osl_19_1l1m_9_morph.pdb", // ATOMIC COORDINATE FILE
		"script view02.spt;",        // VIEW SCRIPT
		blackBackground, // blackBackground or whiteBackground
		spinningOff);  // spinningStart, spinningOn, spinningSame, or spinningOff

	// TEXT BEFORE MOLECULAR VIEW DESCRIPTION
	buttons[buttonNumber][iPreButtonText] = '';

	// MOLECULAR VIEW DESCRIPTION
	buttons[buttonNumber][iButtonText] =
'Animation \n\
<input type="checkbox" checked onclick="this.checked? \n\
jmolScript(\'frame resume;\', \'1\'): \n\
jmolScript(\'frame pause;\', \'1\');" title="Toggle Animation"> \n\
showing the formation of hydrogen bonds in both the \n\
major and minor grooves of the DNA. Bonding of protein into the minor groove \n\
opens it and thus bends the DNA. \n\
<br> \n\
' +
ckey("ff9090", "DNA", "/") + ckey("a0a0ff", "DNA", ", ") +
ckey("ff00ff", "Protein", "/") + ckey("00ff00", "Protein", ", ") +
ckey("ff8000", "Disulfide bond", ". ") +
'\n\
Hydrogen-bonding elements: \n\
' +
element_key("n o h", "", ".") +
' \n\
<br> \n\
<span class="aboutJTAT"> \n\
Here, a checkbox is used as an animation control. In View 1, \n\
graphic buttons are used. As an author, you can choose whichever \n\
you prefer. \n\
</span> \n\
';

	// MOLECULAR VIEW DETAILS
	buttons[buttonNumber][iDetailsTitle] = 'Animation Controls';
	buttons[buttonNumber][iDetailsText] =
'<span class="aboutJTAT"> \n\
The <b>graphic</b> animation controls are probably best because they are \n\
universal symbols. They don\'t indicate whether the animation is on \n\
or off, but their use is obvious. The <b>checkbox</b> takes up less space. \n\
But at present, clicking the View button does not force a checkmark into the \n\
checkbox, so animation can occur when the checkbox is not checked -- slightly \n\
confusing. Additional javascript could be added to improve this. \n\
<br><br> \n\
Note that a single animation control, anywhere in the control panel, \n\
controls all animations in the chapter. \n\
That is, the controls are not restricted to the one \n\
view from the closest view button, so only one set of controls is needed \n\
in a chapter (but more could be included, for convenience, in a long \n\
chapter). \n\
</span> \n\
';

	// TEXT AFTER MOLECULAR VIEW DESCRIPTION
	buttons[buttonNumber][iPostButtonText] =
'<p class="forAuthors"> \n\
The Authoring Instructions have more about \n\
<a href="../../_docs/jtatdocs.htm#animations" \n\
target="_blank">making and using animations in Jmol</a>. \n\
</p> \n\
';

// End of View Buttons ===== ===== ===== ===== ===== ===== ===== ===== =====

	// CHAPTER CONCLUSION
	chapterConclusion =
'<p>More information: </p>\n\
<ul> \n\
<li><a href="http://atlas.proteinexplorer.org/morphs/lacrep" \n\
target="_blank">Lac repressor binding to DNA: specific vs. nonspecific.</a></li> \n\
<li><a href="http://atlas.proteinexplorer.org/morphs/lacrep" \n\
target="_blank">Methods used to construct this linear interpolation morph.</a></li> \n\
<li><a href="http://proteopedia.org/wiki/index.php/Morphs" \n\
target="_blank">Molecular morphing.</a></li> \n\
</ul> \n\
';

  // ========== END OF chapter.js ============
