// debugging alerts through # 2
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makeWireframeAllCheckbox()
{
	var ckscv = "";
	var ckaw = "";
	var ckhv = "";
	if (!sidechainsVisible)
		ckscv = " checked";
	if (allWireframe)
		ckaw = " checked";
	if (!hydrogensVisible)
		ckhv = " checked";

	var allw =

"<form name='wireframeAllForm'> \
 \
<input type='checkbox' onClick='top.toggleSidechains()'" + ckscv + "> \
Hide sidechains. \
 \
<br><input type='checkbox' onClick='top.toggleWireframeAll()'" + ckaw + "> \
More detail: Show all non-water atoms colored by element. \
 \
<br><input type='checkbox' onClick='top.toggleHydrogens()'" + ckhv + "> \
Hide hydrogens. \
</form>";

	return allw;
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makeSmallWaterCheckbox()
{
	// This is called whenever the checkbox is offered. It always starts
	// with big water.
	waterIsSmall= false;

	var smallw =

"<form name='smallWaterForm'> \
<input type='checkbox' onClick='top.showWaterSmall()'> \
Smaller Water. \
</form>";

	return smallw;
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makeSmallLigandCheckbox()
{
	// This is called whenever the checkbox is offered. It always starts
	// with big ligand.
	top.ligandIsSmall= false;

	var smalll =

"<form name='smallLigandForm'> \
<input type='checkbox' onClick='top.showLigandSmall()'> \
Smaller Ligands+. \
</form>";

	return smalll;
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makeNonStandardCheckbox()
{
	var nsc =
"<form name='ligandForm' id='ligandForm'> \
Show "
	+ makeNotesLink("<b>Non-Standard</b>", "nsr") +
" amino acids and nucleotides as: \
<br>&nbsp; &nbsp; <input type='checkbox' name='starNSR' \
onClick='top.toggleNSRStars()'";

	if (top.starNonStandardResidues)
		nsc += " checked ";

	nsc +=
">Crosses \
<img src='crosses_nucs.gif' title='Crosses on non-standard nucleotides' \
border=1> <img src='crosses_aas.gif' \
title='Cross on a non-standard amino acid' border=1> \
<br>&nbsp; &nbsp; <input type='checkbox' name='bsNSR' \
onClick='top.toggleNonStandardResidues()'";

	if (top.showNonStandardResidues)
		nsc += " checked ";

	nsc +=
">Balls and Sticks \
<br>If the display does not change, there are no non-standard \
residues (NSR). <b>Caution:</b> Some non-standard residues display \
as ligands+, failing to display as NSR: "
	+ makeNotesLink("More..", "nsr") +
"</form>";

	return nsc;
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makeHideRadios(cck, gck, ack)
{
	var hr =
"<input type='radio' name='hidewhat' value='c'" + cck +
	" onClick='changeHideRadio()'>Chain&dagger; &nbsp; &nbsp; \
<input type='radio' name='hidewhat' value='g'" + gck +
	" onClick='changeHideRadio()'>Residue/Group &nbsp; &nbsp; \
<input type='radio' name='hidewhat' value='a'" + ack +
	" onClick='changeHideRadio()'>Atom \
";

	return hr;
}

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makeHelpPrefix(helpname)
{
	var hp = "";
	var hhp = makeHiddenHelpPrefix(helpname);
	var fhp = makeFoundHelpPrefix(helpname);
	var chp = makeContactsHelpPrefix(helpname);

	if ((hhp.length + fhp.length + chp.length) > 0)
	{
		hp += "<center>\n" + hhp;
		if (hhp.length > 0 && fhp.length > 0)
			hp += " &nbsp; ";
		hp += fhp;
		if ((hhp.length + fhp.length) > 0 && chp.length > 0)
			hp += " &nbsp; ";
		hp += chp;
		hp += "</center><hr noshade>";
	}

//	alert("help.js #2: makeHelpPrefix():\n" + hp);
	return hp;
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makeHiddenHelpPrefix(helpname)
{
	if (match(helpname, "makehidehelp"))
		return "";

	var hhp = "";
	var hiddenTot = getHiddenTot();

	if (hiddenTot > 0)
	{
		hhp =
"Portions Hidden (\
<a href='javascript: doViewLink(hideIndex)'>Re-Display..<\/a>)\
";
	}

	return hhp;
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makeFoundHelpPrefix(helpname)
{
//	if (match(helpname, "precontacts"))
//		return "";

	var fhp = "";

	if (toFind != "")
	{
		var tf = toFind.replace(/ /g, "&nbsp;");
		fhp = "Halos&nbsp;around:&nbsp;<b>" + tf + ".</b>";

		if (!match(helpname, "makefindhelp"))
			fhp +=
				" (<a href='javascript: doViewLink(findIndex)'>Change<\/a>)";
	}

	return fhp;
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makeContactsHelpPrefix(helpname)
{
	if (!contactsShowing)
		return "";

	if (match(helpname, "contactsshown"))
		return "";

	var chp = 

	"<a href='javascript: showHelp2(\"makeContactsShownHelp()\")'>Return&nbsp;" +
	"to&nbsp;Contacts<\/a>";

	return chp;
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makeHideHelp()
{
	if (hideMode == "")
		hideMode = "c";

	var cck = gck = ack = "";
	var hidden;
	var hiddenTot = getHiddenTot();

	var toHide;
	var lastHidden;
	if (hideMode == "c")
	{
		cck = " checked ";
		hidden = top.hiddenChains.length;
		toHide = "Chain";
		lastHidden = top.hiddenChains[hidden - 1];
	}
	else if (hideMode == "g")
	{
		gck = " checked ";
		hidden = top.hiddenGroups.length;
		toHide = "Residue/Group";
		lastHidden = top.hiddenGroups[hidden - 1];
	}
	else if (hideMode == "a")
	{
		ack = " checked ";
		hidden = top.hiddenAtoms.length;
		toHide = "Atom";
		lastHidden = top.hiddenAtoms[hidden - 1];
	}

//	alert("help.js #1: hidden = " + hidden);

	var hh =
"<form name='hideForm'> \
<span style='float: right; display: inline;'> \
<input type='button' value='Exit Hiding' onClick='cancelHiding()'> \
</span> \
<b>Hide:</a></b> Click on any \
<br clear='right'><center> " +
makeHideRadios(cck, gck, ack) +
"<br>to <b>hide<\/b> it, or hide "
+ makeHideCheckboxes() +
"<\/center> \
Currently hidden:"
+ listHidden(hiddenTot);

//	hc + "<\/b>&nbsp;Chains, <b>" +
//	hg + "<\/b>&dagger;&nbsp;Residues/Groups, <b>" +
//	ha + "<\/b>&Dagger;&nbsp;Atoms.\

	hh += "<br>These will remain hidden in <b>all views</b>, \
until re-displayed: \
<\/form>";

	if (hidden > 0) hh +=
"<a href='javascript: top.unHideLast()'><b>Re-Display</b><\/a> \
the most recently hidden <b>" + toHide + "<\/b>. \
";

	else hh +=
"<font color='#808080'>(No " + toHide + " hidden to re-display.)<\/font>";

	if (hiddenTot > 0)
		hh +=
"<br> \
<a href='javascript: top.unHideAll()'><b>Re-Display Everything.</b><\/a> ";

	hh +=
"<br><br> \
<a href='javascript: top.centerVisible()'><b>Center Visible Chains</b><\/a> \
&nbsp; &nbsp; &nbsp; \
<a href='javascript: top.doViewLink(top.centerIndex)'><b>Center by Clicking</b><\/a> "
+

//<br> \
//<a href='javascript: top.cancelHiding()'><b>Hide Nothing Else</b><\/a> \

"<br><br><small> \
<b>&dagger; Ligands+</b> are not hidden when you hide a chain, even if they \
belong to that chain. Use the <i>Residue/Group</i> option, or the \
<i>Ligands+</i> button to hide them. \
<br> \
<b>Nonstandard residues</b> are not always hidden with the chain, \
but can be hidden as <i>Residues</i>. \
<br> \
<b>*</b> &quot;Protein&quot;, &quot;DNA&quot;, or &quot;RNA&quot;, \
as the terms are used here, exclude amino acids or nucleotides that are <b>not \
part of a polymer chain</b>. \
<\/small>";

//&dagger; Count of hidden Residues/Groups excludes those in entire hidden chains. \
//<br> \
//&Dagger; Count of hidden Atoms excludes those in entire hidden residues/groups/chains. \

//&#167; squiggle

	return hh;
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makeHideCheckboxes()
{
	var hp = hd = hr = hc = hh = "";
	if (hideProtein) hp = " checked";
	if (hideDNA) hd = " checked";
	if (hideRNA) hr = " checked";
	if (hideCarbohydrate) hc = " checked";
	if (hideHydrogen) hh = " checked";

	var cbs = 
"<table border=0><tr> \
<td><input type='checkbox' onClick='hideChecked(\"p\")' name='p'" + hp + ">Protein* \
</td><td> \
<input type='checkbox' onClick='hideChecked(\"d\")' name='d'" + hd + ">DNA* \
</td><td rowspan=2> \
&nbsp;&nbsp;<input type='checkbox' onClick='hideChecked(\"h\")' name='h'" + hh + ">Hydrogen \
</td></tr><tr><td> \
<input type='checkbox' onClick='hideChecked(\"c\")' name='c'" + hc + ">"
	+ makeNotesLink("Carbohydrate", "predef") +
" &nbsp; \
</td><td> \
<input type='checkbox' onClick='hideChecked(\"r\")' name='r'" + hr + ">RNA* \
</td></tr><\/table> \
";

	return cbs;
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function listHidden(hiddenTot)
{
	var is;
	var curhid = "";
	if (hiddenTot > 0)
		curhid += "<font color='red'><b>";
	else
		return("<br>&nbsp;&nbsp; Nothing");

	var allhid = "";
	if (hideProtein) allhid += "Protein*\n";
	if (hideDNA)
	{
		if (allhid.length > 0) allhid += ", \n";
		allhid += "DNA*\n";
	}
	if (hideRNA)
	{
		if (allhid.length > 0) allhid += ", \n";
		allhid += "RNA*\n";
	}
	if (hideCarbohydrate)
	{
		if (allhid.length > 0) allhid += ", \n";
		allhid += "Carbohydrate "
	+ makeNotesLink("[?]", "predef");
	}
	if (hideHydrogen)
	{
		if (allhid.length > 0) allhid += ", \n";
		allhid += "Hydrogen\n";
	}
	
	if (allhid.length > 0)
		allhid = "<br>&nbsp;&nbsp; All " + allhid;
	curhid += allhid;

	for (is = 0; is < hiddenChains.length; is++)
	{
		if (is == 0) // @@
		{
			if (hiddenChains[0].length > 1) // unnamed Protein or Nucleic chain
			{
				curhid += "<br>&nbsp;&nbsp; The Unnamed ";
			}
			else
			{
				curhid += "<br>&nbsp;&nbsp; Chain"
				if (hiddenChains.length > 1)
					curhid += "s"
				curhid += " ";
			}
		}
		else
			curhid += ", "

		curhid += hiddenChains[is];

		if (is == 0 && hiddenChains[0].length > 1) // unnamed Protein or Nucleic chain
		{
			if (hiddenChains[0].charAt(0) == "N")
				curhid += " Acid";
			curhid += " Chain";
		}
	}
	for (is = 0; is < hiddenGroups.length; is++)
	{
		if (is == 0)
		{
			curhid += "<br>&nbsp;&nbsp; "
			if (hiddenGroups.length == 1)
				curhid += "Residue/Group ";
			else
				curhid += "Residues/Groups ";
		}
		else
			curhid += ", "

		curhid += hiddenGroups[is];
	}
	for (is = 0; is < hiddenAtoms.length; is++)
	{
		curhid += "<br>&nbsp;&nbsp;" + hiddenAtoms[is].substring(
			hiddenAtoms[is].indexOf(" "));

// This made a one-line list, before the element name was included
//		if (is == 0)
//		{
//			curhid += "<br>&nbsp;&nbsp; Atom Serial"
//			if (hiddenAtoms.length > 1)
//				curhid += "s"
//			curhid += " ";
//		}
//		else
//			curhid += ", "
//
//		curhid += "#" + hiddenAtoms[is];
	}

	if (hiddenTot > 0)
		curhid += "<\/b><\/font>";

	return curhid;
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makeHideNoMoreHelp()
{
	// Prior to call, lastHideMode is set to hideMode, then hideMode is blanked.
	// In this implementation, lastHideMode is not used.
	// (See abandoned unnecessarly complicated idea in 0.98/obsolete/unhideh.js)

	var uhh =
"<form name='hideForm'><b>Hiding Exited:</b> \
Clicked atoms will be identified. \
<br> ";

	if (getHiddenTot() > 0)
		uhh +=
"To re-display hidden moieties, at any time, click <b>Re-Display..</b> above. \
";

	else uhh +=
"(Nothing is hidden.)";

	return uhh;
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makeSelectRadios(cck, gck, ack, rck, fck)
{
	var hr =
"<center> \
<input type='radio' name='selectwhat' value='c'" + cck +
	" onClick='changeSelectRadio()'>Chains &nbsp; &nbsp; \
<input type='radio' name='selectwhat' value='g'" + gck +
	" onClick='changeSelectRadio()'>Residues/Groups &nbsp; &nbsp; \
<input type='radio' name='selectwhat' value='a'" + ack +
	" onClick='changeSelectRadio()'>Atoms \
<br> \
<input type='radio' name='selectwhat' value='r'" + rck +
	" onClick='changeSelectRadio()'>Range of residues in one chain (2 clicks) \
<br> \
or <input type='checkbox' onClick='changePreContactsView()' name='selectFound'" +
fck + ">Atoms with Halos</a>. "
	+ makeNotesLink("<b>FAQ</b>", "contactsFAQ", "",
	"Target Selection: Frequently Asked Questions") +
"<\/center> ";

	return hr;
}

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makePreContactsHelp()
{

	if (selectMode == "")
	{
		clearSelectedArrays();
		selectMode = "c";
	}

	// SET CHECKBOXES
	var cck = gck = ack = rck = fck = "";
	if (selectMode == "c")
		cck = " checked ";
	else if (selectMode == "g")
		gck = " checked ";
	else if (selectMode == "a")
		ack = " checked ";
	else if (selectMode == "r")
		rck = " checked ";

	if (selectedFound != "")
		fck = " checked";

	var sfck = ctck = wtck = "";
	if (preContactsView == "sf")
		sfck = " checked";
	else
		ctck = " checked";

	if (selectedWater)
		wtck = " checked";

	var swck = "";
	if (preContactsWater)
		swck = " checked";
	
	var hh = "<form name='contactsForm'><center>";

	if (selectedRangeStart != "")
		hh += "<font color='red'><b>Range starts at "
			+ selectedRangeStart.replace(/:/, " in chain ")
			+ "<br>Click on End of range, or "
			+ "<a href='javascript: cancelRange()'>Cancel</a>"
			+ "</b></font><hr noshade size=5 align='center' width=150>";

	hh +=
"View: \
<input type='radio' name='pCView' value='sf'" + sfck +
	" onClick='changePreContactsView()'>Spacefill &nbsp; or &nbsp; \
<input type='radio' name='pCView' value='ct'" + ctck +
	" onClick='changePreContactsView()'>Cartoon \
<br> \
<img src='bar.gif' align='center'> \
<b>Select Targets for Contacts:</a></b> \
<img src='bar.gif' align='center'> \
</center> \
Whose contacts do you want to see? \
Click on the molecule to select, as the <b>target</b>, one or more:<br> "

	+ makeSelectRadios(cck, gck, ack, rck, fck) +

"then  <br><center>\
<a href='javascript: showContacts()'><b><big>Show \
Atoms Contacting Target</big></b></a>. \
</center> \
<br><b>Click again to deselect.</b> \
<br><b><i>Hide..</i></b> or <b><i>Find..</i></b> (above) \
can be used to make target selection easier. \
<br><input type='checkbox' name='preContactsWater' onClick=\
'changePreContactsWater(\"\")'" + swck + ">Show <b>Water</b>. \
&nbsp; &nbsp; \
<input type='checkbox' name='preContactsWaterTarget' onClick=\
'changePreContactsWaterTarget()'" + wtck + ">Target All Water.";

//What you select will be decorated with only the atoms within \
//<br> \
//&nbsp; <input type='radio' name='within' value='3.5' checked> \
//3.5 &Aring; (out to weak hydrogen bonds) \
//<br> \
//&nbsp; <input type='radio' name='within' value='4.0'> \
//4.0 &Aring; (out to weak salt bridges) \
//<br> \
//&nbsp; <input type='radio' name='within' value='4.5'> \
//4.5 &Aring; (out to weak van der Waals interactions) \
//<br> \
//&nbsp; <input type='radio' name='within' value='7.0'> \
//7 &Aring; (out to weak cation-pi interactions) \

	hh +=
"<br><br> \
Currently selected: \
<br><b> "

	+ listSelected() +

"<br><a href='javascript: top.clearSelected()'><b>Start Over (Deselect All)</b></a> \
</b> \
<\/form>";

	if (preContactsView == "sf")
		hh += "In this view, all atoms are spacefilling.";

	hh +=
"Protein and nucleic acid \
chains are each given a distinct pastel color, while \
<font color='#" + colorLigand + "'><b>Ligands+</b></font> \
and \
<font color='#" + colorSolvent + "'><b>Water</b></font> are colored \
as in <i>Composition</i>. \
";

	if (preContactsView != "sf")
		hh +=
"For further description of this cartoon view, click on \
<i>Cartoon</i> (top panel above).";

	return hh;
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makeContactsShownHelp()
{
	var ck;

	// STOP SELECTING
	selectMode = "";
	// STOP HIDING
	hideMode = "";

	var hh =
"<form name='contactsForm'> ";

	hh += "<center><b>Contacts Shown:</b></center> ";

	hh +=
"The target you selected, \
<br> "

	+ listSelected() +

"<br>is decorated with all* contacting atoms \
("
	+ makeNotesLink("Definitions", "contacts", ".)");


	// CHECKBOXES, CENTERING
//	hh += "<br> &nbsp; &nbsp; ";
	hh += "<center><table border=0><tr><td>";

	if (!labelContacts)
	{
		ck = "";
		if (markContactsTargets)
			ck = " checked";
			hh +=
"<div><input type='checkbox' name='markContactsTargets' title='Marks \
target atoms with * * * * ' \
	onClick='changeContactsTargetsMarks()'" + ck + "> Mark target</div> ";
	}
	else
		hh +=
"<div><img src='unchecked.gif'><font color='#808080'> \
Mark target</font></div> ";

	ck = "";
	if (backboneContacts)
		ck = " checked";
	hh +=
//"<br> &nbsp; &nbsp; \
"<input type='checkbox' name='contactsBackbones' \
	onClick='changeContactsBackbones()'" + ck +
" title='Shows Thin Backbones for All Chains'> Backbones";

	hh += "</td><td> &nbsp; &nbsp; </td><td>";

	ck = "";
	if (labelContacts)
		ck = " checked";
	hh +=
//"<br> &nbsp; &nbsp; \
"<div><input type='checkbox' name='labelContacts' \
	onClick='changeContactsView()'" + ck +
" title='Labels Currently Visible Contacts'> Labels ("
	+ makeNotesLink("?", "contactsLabels", ")",
	"Explanation of Labeling") +
"</div> ";

	hh +=
//"<br> &nbsp; &nbsp; \
"<a href='javascript: centerContacting()' \
title='Centers the Currently Visible Contacts' \
><b>Center Contacts</b></a> \
" +

"</td></tr></table></center><br>";

	// VIEW RADIO BUTTONS
	var cktSF, cktBS, cktCHN, cktCPK;
	var ckcSF, ckcBS, ckcCHN, ckcCPK;
	cktSF = cktBS = cktCHN = cktCPK = "";
	ckcSF = ckcBS = ckcCHN = ckcCPK = "";
	ck = " checked";
	if (targetSF) cktSF = ck; else cktBS = ck;
	if (targetCPK) cktCPK = ck; else cktCHN = ck;
	if (contactingSF) ckcSF = ck; else ckcBS = ck;
	if (contactingCPK) ckcCPK = ck; else ckcCHN = ck;

	var dag, Dag;
	dag = Dag = "";
//	if (targetCPK || contactingCPK)
//		Dag = "&Dagger;";
//	if (!targetCPK || !contactingCPK) // CHAIN
//		dag = "&dagger;";

	var starstar = "";
//	if (!targetSF || !contactingSF)
//		starstar = "**";

// BEGIN SNAPSHOTS TABLE
	if (!contactsRadioViews)
		hh +=
"<center><table border=0><tr><td>\
<div align='center'>Contacts Views&dagger; -- <i>Click Snapshots:</div> \
<hr noshade> \
<a href='javascript: setContactsView(1)'>\
	<img src='contact1.gif' \
		title='Overview: Target & Contacts Spacefilled, Colored by Chain'></a> &nbsp; \
<a href='javascript: setContactsView(2)'>\
	<img src='contact2.gif' \
		title='Target Spacefilled, Contacts Balls and Sticks, Colored by Chain'></a> &nbsp; \
<a href='javascript: setContactsView(3)'>\
	<img src='contact3.gif' \
		title='Target Spacefilled, Contacts Balls and Sticks, Colored by Element'></a> &nbsp; \
<a href='javascript: setContactsView(4)'>\
	<img src='contact4.gif' \
		title='Maximum Detail: Target & Contacts Balls and Sticks, Colored by Element'></a>\
</td></tr></table></center>";
// END SNAPSHOTS TABLE

// BEGIN RADIO BUTTONS TABLE

	else
		hh +=
"<center><table border=0>\
	<tr><td colspan=7 bgcolor='#808080'></tr>\
	<tr>\
		<td rowspan=5>\
<a href='javascript: setContactsView(1)'>View 1</a><sup>&#167;</sup> \
<br> \
<a href='javascript: setContactsView(2)'>View 2</a> \
<br> \
<a href='javascript: setContactsView(3)'>View 3</a> \
<br> \
<a href='javascript: setContactsView(4)'>View 4</a> \
		</td> \
 \
		<td rowspan=5>&nbsp;</td>\
		<td rowspan=5 bgcolor='#808080'></td>\
		<td rowspan=5>&nbsp;</td> \
 \
		<td>Target &nbsp;</td><td>Contacts &nbsp;</td><td>View&dagger;</td>\
	</tr><tr>\
		<td><center>\
<input type='radio' name='targetRendering' value='tsf'" + cktSF +
			" onClick='changeContactsView()'>\
		</center></td><td><center>\
<input type='radio' name='contactsRendering' value='csf'" + ckcSF +
			" onClick='changeContactsView()'>\
		</center></td>\
<td>Spacefilled</td>\
	</tr><tr>\
		<td><center>\
<input type='radio' name='targetRendering' value='tbs'" + cktBS +
			" onClick='changeContactsView()'>\
		</center></td><td><center>\
<input type='radio' name='contactsRendering' value='cbs'" + ckcBS +
			" onClick='changeContactsView()'>\
		</center></td>\
<td>Balls" + starstar + " & Sticks</td>\
	</tr><tr>\
		<td><center>\
<input type='radio' name='targetColoring' value='tcc'" + cktCHN +
			" onClick='changeContactsView()'>\
		</center></td><td><center>\
<input type='radio' name='contactsColoring' value='ccc'" + ckcCHN +
			" onClick='changeContactsView()'>\
		</center></td>\
<td>Colored by Chain" + dag + "</td>\
	</tr><tr>\
		<td><center>\
<input type='radio' name='targetColoring' value='tce'" + cktCPK +
			" onClick='changeContactsView()'>\
		</center></td><td><center>\
<input type='radio' name='contactsColoring' value='cce'" + ckcCPK +
			" onClick='changeContactsView()'>\
		</center></td>\
<td>Colored by Element" + Dag + "</td>\
	</tr>\
	<tr><td colspan=7 bgcolor='#808080'></tr>\
</table></center>";
// END RADIO BUTTONS TABLE

	ck = "";
	if (contactsRadioViews)
		ck = " checked";
	hh +=
"<div align='center'>\
Distances: "

	+ makeNotesLink("How?", "distances", "",
	"How to Measure Distances and Angles") +

"&nbsp; \
<a href='javascript: hideMonitors()' title='Hide Fixed Distances and Angles')'>Hide</a>. \
&nbsp; &nbsp; \
<input type='checkbox' onClick='toggleContactsRadioButtons()'\
name='contactsRadioButtons'" + ck + "><small>More views.</small> \
</div> \
&nbsp;<img src='down_arrow.gif' align='center'> \
<a href='javascript: checkAll(false)'>Uncheck</a> / \
<a href='javascript: checkAll(true)'>Check</a> \
all.</br>\
";

	// SHOW WATER BRIDGES
	var watcol = "#" + colorSolvent;
	if (contactingCPK)
		watcol = "magenta";

	ck = "";
	if (showWaterBridges)
		ck = " checked";

	hh +=
"<input type='checkbox' name='waterBridges' \
	onClick='changeContactsView()'" + ck + "> Show putative "

	+ makeNotesLink("<font color='" + watcol + 
			"'><b>water</b></font> bridges", "waterbridges", "") +

" (target to non-target).<br>";

	// SHOW WATER
	ck = "";
	if (showContactsWater)
		ck = " checked";
	hh +=
"<input type='checkbox' name='contactsWater' \
	onClick='changeContactsView()'" + ck + "> Show \
	<font color='" + watcol + "'><b>water</b></font> \
putatively "

	+ makeNotesLink("hydrogen bonded", "hbonds", "") +

" to target.<br>\
";

	// SHOW HBONDS
	ck = "";
	if (showContactsHBonds)
		ck = " checked";
	hh +=
"<input type='checkbox' name='contactsHBonds' \
	onClick='changeContactsView()'" + ck + "> Show putatively "

	+ makeNotesLink("hydrogen bonded", "hbonds", "") +

" non-water.<br>\
";

	// SHOW HYDROPHOBIC
	ck = "";
	if (showContactsHphob)
		ck = " checked";
	hh +=
"<input type='checkbox' name='contactsHphob' \
	onClick='changeContactsView()'" + ck + "> Show "

	+ makeNotesLink("hydrophobic (apolar van der Waals)", "hphob") +

" interactions.<br>\
";

	// SHOW SALT BRIDGES
	ck = "";
	if (showContactsSB)
		ck = " checked";
	hh +=
"<input type='checkbox' name='contactsSB' \
	onClick='changeContactsView()'" + ck + "> Show putative "

	+ makeNotesLink("salt bridges", "saltbr", ".") +

"<br>\
";

	// SHOW CATION PI
	ck = "";
	if (showContactsCatPi)
		ck = " checked";
	hh +=
"<input type='checkbox' name='contactsCatPi' \
	onClick='changeContactsView()'" + ck + "> Show possible "

	+ makeNotesLink("cation-pi", "catpi", "") +

" interactions.<br>\
";

	// SHOW METALS & MISC
	ck = "";
	if (showContactsMeMi)
		ck = " checked";
	hh +=
"<input type='checkbox' name='contactsMeMi' \
	onClick='changeContactsView()'" + ck + "> Show possible "

	+ makeNotesLink("metal and misc", "memi", ".") +

" bonds.<br>\
";

//-  -  -  -  -  -  -  -  -  -  -  -  -  -  -  

	// SHOW STICKS?
	if (!contactingSF) // need to make form reading, or use hidden input?
	{
		ck = "";
		if (showContactsSticks)
			ck = " checked";
		hh +=
"&nbsp; &nbsp; <input type='checkbox' name='contactsSticks' \
	onClick='changeContactsView()'" + ck + "> Show sticks.<br>\
";
	}

	// HYDROGENS
	ck = "";
	if (hydrogensContacts)
		ck = " checked";
	hh +=
"&nbsp; &nbsp; <input type='checkbox' name='contactsHydrogens' \
	onClick='changeContactsView()'" + ck + "> Show "

	+ makeNotesLink("hydrogens (if present in model)", "hydrogen", ".");

	// NOTES
	hh +=
"<ul> \
<li><b><i>Find..</i></b> or <b><i>Hide..</i></b> \
(above) can be used on the Contacts display. \
<li>Any other view <b>clears the contacts</b> display. \
</ul> \
";

	// "ALL" CONTACTING ATOMS
	hh +=
"*<small>All contacting atoms in the model are shown, regardless of whether they were \
hidden during target selection. NOT SHOWN, however, are \
<a href='http://molvis.sdsc.edu/protexpl/igloss.htm#crystalcontacts' \
target=_blank><font color='#00b000'><b>crystal contacts</b>\
</font></a>.";

	// PRESET VIEWS
	if (contactsRadioViews)
		hh +=
"<br>&#167; Views 1-4 are the most useful of the 16 possible \
settings of the radio buttons."

	hh += "<br>&dagger;";

	// BALLS
	if (!targetSF || !contactingSF)
	{
		hh +=
//"<br>** \
"<br><b>Small balls</b> signify atoms likely noncovalently-bonded \
to the target ("

	+ makeNotesLink("Definitions", "contacts", ").") +

" Slightly larger and darker balls are target atoms likely \
non-covalently bonded to the target-contacting atoms.\n";

		if (showContactsSticks)
			hh += 
"Optionally, residues containing balls are shown as <b>sticks</b>, \
solely for context.\n";

		hh +=
"<br>Use <b><i>Center Atom..</i></b>, <b><i>Zoom</i></b> and \
<b><i>Slab</i></b> (above) to see details with less clutter. ";
	}

	// CHAIN COLORS
	if (!targetCPK || !contactingCPK)
		hh +=
//"<br>&dagger;
"<br><b>Colors:</b> \
Protein and nucleic acid chains are each given a distinct \
pastel color. \
<font color='#" + colorLigand + "'><b>Ligands+</b></font> \
and \
<font color='#" + colorSolvent + "'><b>Water</b></font> are colored \
as in <i>Composition</i>.";

	// ELEMENT COLORS
	if (targetCPK || contactingCPK)
		hh +=
//"<br>&Dagger; \
"<br><b>Colors:</b>\
Atoms are colored by element, except that \
<font color='magenta'><b>water oxygens</b></font> are colored magenta. \
Target atom colors are <b>darker</b>. "
	+ colorByElement;

	hh += "</small><\/form>";

	return hh;
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function listSelected()
{
	var is;
	var cursel = "";

	for (is = 0; is < selectedChains.length; is++)
	{
		if (cursel.length > 0)
			cursel += "<br>"
		if (selectedChains[is].length > 1)
		{
			if (selectedChains[is] == "Protein")
				cursel += "&nbsp; The Unnamed Protein Chain";
			else
				cursel += "&nbsp; The Unnamed Nucleic Acid Chain";
		}
		else
			cursel += "&nbsp; Chain " + selectedChains[is];
	}
	for (is = 0; is < selectedGroups.length; is++)
	{
		if (cursel.length > 0)
			cursel += "<br>"
		cursel += "&nbsp; Residue/Group " + selectedGroups[is];
	}
	for (is = 0; is < selectedAtoms.length; is++)
	{
		if (cursel.length > 0)
			cursel += "<br>"
		cursel += "&nbsp; " +
			selectedAtoms[is].substring(selectedAtoms[is].indexOf(" "));
	}

	if (selectedFound != "")
	{
		if (cursel.length > 0)
			cursel += "<br>"
		cursel += "&nbsp; Halos: " + selectedFound;
	}

	for (is = 0; is < selectedRanges.length; is++)
	{
		if (cursel.length > 0)
			cursel += "<br>"
		cursel += "&nbsp; " +
			"Range: " + selectedRanges[is];
	}

	if (selectedWater)
	{
		if (cursel.length > 0)
			cursel += "<br>"
		cursel += "&nbsp; All Water";
	}

	if (cursel.length == 0)
		cursel = "&nbsp; Nothing";
	else cursel = "<font color='red'>" + cursel + "</font>";

	return cursel;
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makeFindHelp() // mfh
{
	var pfh =
"<form name='findForm' onSubmit='doFind(); return false;'> \
<b>Find:</b> \
<input type='text' size='30' name='toFind' \
value='" + toFind + "'> \
<a href='javascript: clearFindForm()'><b>Clear Halos</b></a> \
<br> \
<div align='center'> \
<img src='halos1.gif' align='right' \
title='Halos on Invisible Atoms Look Like This'> \
<img src='halos2.gif' align='left' hspace=8 \
title='Halos on Spacefilled Atoms Look Like This'> \
<a href='javascript: seeHalosEasily()'><b>See All Halos Easily</b></a> \
&nbsp; &nbsp; \
<a href='javascript: reDisplay(\"\", \"\")' \
title='Restore the Previous View'><b>Undo</b></a> \
</div><br clear='both'> \
In the slot above, enter one or more (separated by <b>commas</b>): \
<ul> \
<li> "

	+ makeNotesLink("<b>Sequence</b>", "seq", "") +

" number(s) (such as <b>10,51</b>). \
<li> Range of "

	+ makeNotesLink("sequence", "seq", "") +

" numbers (such as <b>18-23</b>). \
<li> Amino acid "

	+ makeNotesLink("3-letter names", "aanames", "") +

" (such as <b>PRO,HIS</b>). \
<li> Nucleotide 1-letter names (<b>A,C,G,T,U</b>). \
<li> Name-sequence combinations (<b>SER41, C9</b>). \
<li> To restrict one of the above to a specific \
chain, add colon plus the chain letter \
(such as <b>41<b>:</b>A, C9<b>:</b>D</b>). \
<li> Full name(s) of elements (<b>zinc, selenium</b>). \
<li> "

	+ makeNotesLink("Advanced uses", "advancedFind", ".") +

"</ul> \
After pressing <i>Enter</i>, <b>yellow dot-halos</b> will appear \
around the atoms in the residues listed in the slot above (even if \
the atoms themselves are not visible). \
If <b>no halos</b> appear, either the listed residues don't exist \
in this molecule, or your list is not formatted correctly \
following the above examples. \
<br><br> \
The halos will remain present in all views until you click <i>Clear Halos</i> \
or <i>Reset</i> above. \
</form> \
";

	return pfh;
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makeBePatientHelp()
{
	var bph =
"<form> \
<center><b>FirstGlance in Jmol</a></b></center> \
<big><big><b>Please Be Patient!</b></big> It may take several minutes \
for the Jmol applet to arrive the first time you use \
<i>FirstGlance in Jmol</i>. Subsequent sessions will \
show the molecule much faster. \
(Please <b>don't reload/refresh*</b> until you see the molecule.) \
";

	if (top.usingSignedApplet)
		bph +=
"<br>If you did <font color='red'>not trust</font> the signed Jmol applet, \
close this window because the molecule will never appear. \
";

bph +=
"<center><input type='button' value='OK' \
onClick='top.showHelp(\"makeIntroHelp()\")'></center> \
Please click the button above to go to the <i>Introduction</i>.</big> \
<br><br><big> " + makeProteopediaTeaser() + "</big>\
<br><br> \
(Large molecules or multiple-model NMR data may need \
extra time to arrive.) \
<br> \
*Reloading/refreshing before you see the molecule sometimes prevents the \
molecule from ever appearing. To fix this, just close/quit \
your browser, and restart it. \
</form> \
";

	return bph;
}

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var noClick = "";
/*
" <small>(Currently, this does not work for nucleic acids with the \
Cartoon or Secondary Structure displays, but works with the \
N-&gt;C Rainbow display or on nucleotide bases as Vines. \
A future version will fix this.) <\/small>";
*/
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var macHover =

"<small>(On <b>Macintosh OSX</b>, click on blank background near the molecule \
first.)</small>";

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var identifySubhelp =
"<b>Identify</b> any atom by clicking on it. Its identity will be \
displayed to the lower left of the molecule (and in the browser status bar). "

	+ makeNotesLink("More..", "ident", "") +

" If you don't recognize the abbreviation, click on the <i>PDB</i> \
icon above, and there, the <i>Biology & Chemistry</i> tab, and look under \
<i>Ligands and Prosthetic Groups</i>; or click the \
<i>OCA</i> icon above, and look under <i>ligand</i>. \
";

//After about two seconds of touching an atom, a message will appear its
//identity will be displayed. This works best \
//with <i>spinning toggled off</i>. \
//" + macHover;

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var inspectSubhelp =
"<br><br>Click the <i>Slab</i> button (above) for instructions on how to \
zoom in and see a region of interest, without clutter.";
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var addHeteroSubhelp =
"Clicking the <b>Ligands+</b> or <b>Water</b> buttons adds \
these components to the display, if they are not already visible,\
or hides them if they are.";

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var hideHeteroSubhelp =
"<br><br>Clicking the <b>Ligands+</b> or <b>Water</b> buttons hides \
these components.";

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var drumsSubhelp =
"<br><br>This color scheme is adapted from the \
<a href='http://www.umass.edu/molvis/drums' target='drumswin'> \
Drums Standardized \
Color Schemes for Macromolecules</a>. \
";

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var colorByElement =
"<center><table border=0 cellpadding=5 bgcolor='black'><tr>\
<td><center><big><big><b> \
<font face='sans-serif'> \
" + coloredElements + " \
</font></b></big></big><br> \
(<a href='http://jmol.sourceforge.net/jscolors/' \
target='coewin'><font color='c8c8ff'>more elements..</font></a>) \
</center></td></tr></table></center> \
";

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makeSlabHelp()
{
	var ck10 = ck6 = ck3 = "";

	if (slabThickness == "10")
		ck10 = " checked";
	else if (slabThickness == "6")
		ck6 = " checked";
	else if (slabThickness == "3")
		ck3 = " checked";

	var slh =

"<form name='slabForm'> " +

//<center><table border=0 cellpadding=4 bgcolor='#ff80ff'> \
//<tr><td><b><b>Molecule disappeared? &nbsp; \
//<a href='javascript: doMolViewSpt(\"zoom 300;\")'>&nbsp;Fix!&nbsp;</a> " +
//&nbsp; (" +
//	+ makeNotesLink("More..", "zoombugs", ")") +
//</b></td></tr></table></center> \

"<big><b>Slab</b></big> \ mode hides the front and rear of the \
molecule, leaving visible only a thin central slab, \
parallel to the screen. \
This is best appreciated when <i>spinning is toggled off</i>. \
<center> \
Slab thickness: \
	<input type='radio' name='slabThickness' value='10'" + ck10 +
		" onClick='changeSlabThickness()'>10% \
		&nbsp; \
	<input type='radio' name='slabThickness' value='6'" + ck6 +
		" onClick='changeSlabThickness()'>6% \
		&nbsp; \
	<input type='radio' name='slabThickness' value='3'" + ck3 +
		" onClick='changeSlabThickness()'>3% \
</center> \
 \
<br> \
With slab mode off (so you can see the entire molecule), \
use <i><b>Center Atom..</b></i> (above) to center a region \
of interest. "

+ noClick +

"Centering ensures that the region \
of interest will be visible after you <b>turn slab mode on</b>. Next, <b>Zooming \
in</b> may help see details, and also pushes more of the front and back \
out of the visible slab zone, producing a less obstructed view of the \
centered moiety. \
 \
<br><br>Click <i>Center Atom..</i> (above) to re-center the entire molecule, and \
click <i>Slab</i> again to toggle slab mode off. <br><br>\
";

// + identifySubhelp; NOT IN SLAB!

	return slh;
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makeWaterHelp()
{
	var wath =
"<big><b>Water</b></big> \
oxygens are displayed as \
<img src='waterox.gif' align='left' hspace='3'> \
<font color='red'><b>red</b></font> spheres of van der Waals radii, \
as shown at left. \
 \
(If the <i>Water</i> button does not show any red \
spheres, no water was included in the model.) \
 \
" + makeSmallWaterCheckbox() + " \
 \
Typically, only 10-20% of the water in protein crystals is tightly-enough \
bound to be resolved, so 80-90% of the water present is invisible \
(due to disorder). \
 \
<br><br> \
<img src='hoh.gif' align='left' hspace='3'> \
<b>Hydrogen</b> atoms are not resolved in most \
protein crystallographic results, \
so often the water oxygens lack hydrogens. When hydrogen atoms are \
modeled, they appear as two white atoms \
attached to the red water oxygens, as shown at left. \
";

	return wath;
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makeLigandsHelp()
{
	var ligh =
	
"<big><b>Ligands+</b></big> \
displays the &quot;ligands+&quot; subset of atoms as spheres of van der Waals \
radii, colored by element: "

+ colorByElement +

"&quot;Ligands+&quot; includes all components of the model that are not \
water, and not "

	+ makeNotesLink("chains", "lig", "") +	

" of protein, DNA, or RNA. \
Thus, it includes substrate or inhibitors, prosthetic groups such as \
heme, cofactors such as NAD, \
carbohydrate, metal ions, \
and so forth, \
regardless of whether these are covalently \
or non-covalently bound to the protein or nucleic acid chains. \
It also includes isolated standard amino acids or nucleotides \
that are not members of a "

	+ makeNotesLink("standard protein or nucleic acid chain", "lig", "") +	

" (<b>Caution</b>: Rare ligands may fail to be displayed, but will be displayed \
when you check non-standard residues below. "

	+ makeNotesLink("More..", "lig", ")") +

"<br><br> \
Clicking <i>Ligands+</i> a second time hides the ligands+. "
 + makeSmallLigandCheckbox() 
 + makeNonStandardCheckbox() +	identifySubhelp;

	return ligh;
}

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var centerAtomHelp =
"<form> \
<span style='float: right; display: inline;'> \
<input type='button' value='Exit Centering' onClick='cancelCentering()'> \
</span> <big><b>Center Atom</b></big> (or Entire Molecule) \
 \
</form> \
<b><big><big><font color='red'>Click on any atom </font></big> \
to center it.</big></b> \
<br> \
Mac OSX Firefox: two clicks may be needed. See "

	+ makeNotesLink("Notes", "macff", ".") +

"<br><br>" +

//<b> \
//2. Centering mode remains on until you \
//<center> \
//<big> \
//<a href='javascript: top.cancelCentering()'>Turn Off or Cancel Centering</a>. \
//</big> \
//</center> \
//</b><br> \

"At any time, you may <center>\
<a href='javascript: top.centerAll()'><b>Re-Center the \
Entire Molecule</b></a></center>. \
" + inspectSubhelp;

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var centeringCancelledHelp =
"<big><b>Centering Exited.</b></big> \
 \
<br><br> \
At any time, you may \
<a href='javascript: top.centerAll()'><b>Re-Center the Entire Molecule</b></a>. \
";
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var centerAllHelp =
"<big><b>Center All</b></big> \
centers the entire molecule. This is useful after you have clicked \
on the molecule, which centers the clicked atom. \
 \
<br><br> \
<big>To inspect details in a region of interest,</big> click on an atom \
in the region to center that region, Then zoom in. Turning on \
<b>Slab</b> will hide portions of the molecule distant from the \
centered region, simplifying the view. \
 \
<br><br> \
When finished, click <b>Center All</b> and zoom out if you wish to restore \
an overview of the entire molecule. \
 \
<br><br> \
 \
Protein Explorer (see link above) can be used to capture any view of a \
molecule in a slide with a rotating molecular view, called a MolSlide. \
Please see <a href='http://www.molslides.org' \
target='molslidewin'>MolSlides.Org</a> for \
examples and details. \
";


//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var allModelsHelp =
"<big><b>All Models</b></big> \
enables you to see whether there is more than one model. \
It displays a very thin backbone trace for each model. \
In most cases, you will see the chain(s) for a single model. \
Sometimes, however, you will see multiple models -- \
and in these cases, clicking on the molecule will report \
<b>Model=<i>n</i></b>, where <i>n</i> is the model number. \
<br><br> \
Use the links above to <i>PDB</i> or <i>OCA</i> to find out \
the experimental method. \
About 85% of \
3D macromolecular structure data files (PDB files) result from \
<b>X-ray crystallography</b>, which produces a <b>single model</b>. \
<img src='multmods.gif' align='left' hspace='5'> \
Most of the remaining data files come from solution nuclear magnetic \
resonance spectroscopy (<b>NMR</b>), which typically produces \
<b>multiple models</b>. \
An example \
(<a href='fg.htm?mol=2BBN' target=_blank>2BBN</a>) \
is shown at left. \
In such cases, all the other options in <i>FirstGlance</i> \
show only the first model. \
<br><br> \
In NMR results, the discrepancies between models can result either from \
thermal motion in solution, or from regionally insufficient data. \
Nothing in the published data file distinguishes these two sources \
of the discrepancies. \
<br><br> \
For more information about the currently loaded data file, \
click the links above to the <i>PDB</i>, \
<i>OCA</i>, or <i>More Views..</i>. \
";
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makeVinesHelp()
{
	vh =	

"<big><b>Vines:</b></big> All atoms ";

	var closeparen = "";
	if (!toggleIsDown[waterIndex] || !sidechainsVisible || !hydrogensVisible)
	{
		vh += "(except ";
		closeparen = ")";
	}

	var except = "";
	if (!toggleIsDown[waterIndex])
		except += "water";

	if (!sidechainsVisible)
	{
		if (except.length > 0)
			except += " and ";
		except += "sidechains";
	}

	if (!hydrogensVisible)
	{
		if (except.length > 0)
			except += " and ";
		except += "hydrogen";
	}

	if (!allWireframe)
	{
		if (except.length > 0)
			except += " and ";
		except += "backbone";
	}

	vh += except;

	vh += closeparen +
" are displayed as sticks (or tiny balls, if not \
covalently bonded) colored by element: " +
colorByElement;

	if (!allWireframe)
		vh +=
"<br> \
<b>Backbone</b> atoms are hidden, except for traces connecting protein alpha carbon \
atoms or nucleic acid phosphorus atoms. The backbone for each chain is given a distinct \
pastel color. ";

	vh +=
makeWireframeAllCheckbox() +
addHeteroSubhelp + "<br><br>" + identifySubhelp + inspectSubhelp;

	return vh;

}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var zoomHelp =
"<big><b>Zoom</b></big> \
<br><br>\
In addition to using the zoom-arrow buttons above, \
here are other ways to zoom: \
<ul> \
<li>Click on the background of the molecular rectangle, then use \
the wheel on your mouse. \
<br><li>Hold down the Shift key, then drag up or down on the molecule. \
</ul><center> \
<a href='javascript: scriptToJmol(\"zoom 100;\")'>Fit molecule to window</a>. \
&nbsp; &nbsp; \
<a href='javascript: scriptToJmol(\"center all;\")'>Center entire molecule</a>. \
</center> \
";

//Zooming <b>too large</b> (close to the maximum) may distort the \
//molecule. " +
//(<a href='notes.htm#zoombugs' target='_blank'>More..</a>). \
//"Zoom a bit smaller to correct these distortions. \


//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var chargeHelp =
"<big><b>Charge:</b></big> \
Amino acids are colored  \
<ul><big><font face='sans-serif'> \
<li><font color='#" + colorHydrophobicText + "'><b>Hydrophobic</b></font> \
<li><font color='#" + colorPolarText + "'><b>Polar, uncharged</b></font> \
<li><font color='#" + colorBasic + "'><b>Cationic +</b></font> \
<li><font color='#" + colorAcidic + "'><b>Anionic -</b></font> \
<li><font color='#" + colorBackbone + "'><b>Backbone atoms</b></font> \
</font><\/big> (charged or uncharged) <\/ul> \
Nucleic acid is shown as \
<a href=\"javascript: top.showHelp('cartoonHelp')\">Cartoons</a> \
with each chain given a different color. \
Ligand and solvent are initially hidden. \
<br><br>" +

addHeteroSubhelp + "<br><br>" + identifySubhelp + drumsSubhelp;

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var polarityHelp =
"<big><b>Hydrophobic/Polar:</b></big> \
Amino acids are colored either \
<ul><big><big><font face='sans-serif'> \
<li><font color='#" + colorHydrophobicText + "'><b>Hydrophobic</b></font> or \
<li><font color='#" + colorPolarText + "'><b>Polar</b></font> \
</font><\/big><\/big> (charged or uncharged) <\/ul> \
Nucleic acid is shown as \
<a href=\"javascript: top.showHelp('cartoonHelp')\">Cartoons</a> \
with each chain given a different color. \
Ligand and solvent are initially hidden. \
<br><br>" +

addHeteroSubhelp + "<br><br>" + identifySubhelp + drumsSubhelp;

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Before the black table,
//<ul><big><font face='sans-serif'> \
//<li><font color='#" + colorProtein + "'><b>Protein</b></font> \
//<li><font color='#" + colorDNA + "'><b>DNA</b></font> \
//<li><font color='#" + colorRNA + "'><b>RNA</b></font> \
//<li><font color='#" + colorLigand + "'><b>&quot;Ligand&quot;*</b></font> \
//<li><font color='#" + colorSolvent + "'><b>Solvent**</b></font> \
//</font><\/big><\/ul> \

// Black table with white for zombies.
// <table cellpadding='10' bgcolor='black'><tr><td> \
// <font face='sans-serif'><big> \
// <font color='#" + colorProtein + "'><b>Protein</b></font> \
// <br><font color='#" + colorDNA + "'><b>DNA</b></font> \
// <br><font color='#" + colorRNA + "'><b>RNA</b></font> \
// <br><font color='#" + colorLigand + "'><b>&quot;Ligand&quot;*</b></font> \
// <br><font color='#" + colorSolvent + "'><b>Solvent**</b></font> \
// </big><small> \
// <br><font color='white'><b>?***</b></font> \
// </small> \
// </font> \
// </td></tr></table> \


var compositionHelp =
"<big><b>Composition:</b></big> \
All atoms are shown as spacefilling spheres of van der Waals radii, colored \
as follows: \
<ul><big><font face='sans-serif'> \
<li><font color='#" + colorProtein + "'><b>Protein</b></font> \
<li><font color='#" + colorDNA + "'><b>DNA</b></font> \
<li><font color='#" + colorRNA + "'><b>RNA</b></font> \
<li><font color='#" + colorLigand + "'><b>&quot;Ligand&quot;*</b></font> \
<li><font color='#" + colorSolvent + "'><b>Solvent**</b></font> \
</font><\/big><\/ul> \
 \
<b><font color='#" + colorLigand + "'>* Here, \
<i>&quot;Ligand&quot;</i> includes everything that is not protein, \
DNA, RNA, or solvent. \
</font><font color='#" + colorSolvent + "'> \
<br> \
**<i>Solvent</i> is water plus inorganic sulfate or phosphate ions. \
</font></b> \
" +

hideHeteroSubhelp + "<br><br>" + identifySubhelp + drumsSubhelp;

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var rainbowHelp =
"<big><b>N<img src='arrow.gif'>C Rainbow</b></big> \
<br><br> \
Protein and nucleic acid chains are shown as smooth backbone traces, \
with nucleic acids thicker. \
<font color='#" + colorAminoTerm + "'><b>Amino (N) termini</b></font> \
of proteins and  \
<font color='#" + colorAminoTerm + "'><b>5' termini</b></font> \
of nucleic acids are \
<font color='#" + colorAminoTerm + "'><b>blue</b></font>. \
<font color='#" + colorCarboxyTerm + "'><b>Carboxy (C) termini</b></font> \
of proteins and  \
<font color='#" + colorCarboxyTerm + "'><b>3' termini</b></font> \
of nucleic acids are \
<font color='#" + colorCarboxyTerm + "'><b>red</b></font>. \
Between termini, colors follow a spectral rainbow sequence. \
<br><center><table cellpadding=5 cellspacing=0><tr> \
<td bgcolor='#0000ff'><font color='#ffffff' face='sans-serif'><b>N, 5'</b></font></td> \
<td bgcolor='#00c0ff'>&nbsp;</td> \
<td bgcolor='#00e0b0'>&nbsp;</td> \
<td bgcolor='#50e000'>&nbsp;</td> \
<td bgcolor='#a0e000'>&nbsp;</td> \
<td bgcolor='#e0e000'>&nbsp;</td> \
<td bgcolor='#ffa000'>&nbsp;</td> \
<td bgcolor='#ff0000'><font color='#ffffff' face='sans-serif'><b>C, 3'</b></font></td> \
</tr></table></center> \
<br>" +

addHeteroSubhelp;

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var rocketHelp =
"<big><b>Secondary Structure</b></big> \
<br><br> \
This display affects <b>only protein</b> chains; the previous display of non-protein \
moieties remains unchanged. \
<font color='#" + colorAlphaHelix + "'><b>Alpha helices</b></font> \
are shown as \
&quot;<font color='#" + colorAlphaHelix + "'><b>rockets</b></font>&quot;. \
<font color='#" + colorBetaStrand + "'><b>Beta strands</b></font> \
are shown as \
<font color='#" + colorBetaStrand + "'><b>planks</b></font>. \
 \
<br><br> \
Arroheads point towards the carboxy termini. \
 \
<br><br> \
The entire protein chain is shown as a smoothed backbone trace. \
Random coils are white. \
Make the <b>background black</b> \
with the <i>Background</i> button to make the backbone trace \
easier to see. \
<font color='#" + colorTurn + "'><b>Turns</b></font> may (or may not) be colored \
<font color='#" + colorTurn + "'><b>blue</b></font>. \
 \
<br><br> \
If secondary structure was specified by the authors of the published \
model (PDB file), secondary structure is shown accordingly. \
Otherwise, Jmol determines secondary \
structure objectively using a modified Kabsch-Sander algorithm. \
Authors who specify helices and strands often do not specify turns, \
which is why turns are often not colored blue. \
<br><br>" +

addHeteroSubhelp + drumsSubhelp;

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var cartoonHelp =
"<big><b>Cartoon</b></big> \
<br><br> \
Each chain is a different pastel color. \
<b>Protein</b> alpha helices and beta strands are shown as ribbons, with arrowheads \
pointing towards the carboxy termini. \
Random coil is shown as smoothed backbone traces. \
<b>Nucleic acids</b> are shown as schematic bases extending from smoothed \
backbone traces. \
This display affects only protein and nucleic acid; the previous display \
of other moieties remains unchanged.<br><br>" +

addHeteroSubhelp;

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makeTroubleHelp()
{

	var trh =
"<big><b>Troubleshooting</b></big> \
<br><br> \
<b>Please be patient!</b> \
The first time you use <i>FirstGlance</i>, it might take up to several \
minutes before the molecule appears. This time is required to transfer \
and initialize the Jmol java applet. After the first use, loading \
will be faster. \
 \
<br><br> \
Please <b>don't reload/refresh</b> until after you see the molecule. \
Reloading prematurely may prevent the molecule from ever appearing! \
To fix this, just close (quit) your browser, and restart it. \
 \
<br><br> \
If the white rectangle at right turns <b>completely blank</b> \
(&quot;Jmol&quot; disappears \
from the lower right corner), this means that the PDB file was not \
available. Often, this means that the Protein Data Bank has not released \
the data file yet. You can check this by ";

if (top.validPDBId.length > 0)
 trh +=
"<a href='http://www.rcsb.org/pdb/navbarsearch.do?newSearch=yes&isAuthorSearch=no&radioset=All&inputQuickSearch="
+ top.validPDBId + "' target='rcsbwin'>searching for " + top.validPDBId +
" at RCSB</a>. ";

else trh +=
"searching for the PDB code at <a href='http://www.pdb.org' \
target='rcsbwin'>RCSB</a>. ";

	trh +=
"&quot;Status HPUB&quot; means the entry is supposed to be released \
upon publication of the journal article describing it. \
If it was not, contact info@rcsb.org. \
<br><br> \
FirstGlance <b>requires "

	+ makeNotesLink("java</b>", "java", ".") +

" Some installations of Windows or \
linux may have \
no java. You can install or update free java by going to \
<a href='http://www.java.com' target='javacomwin'>java.com</a>. Updating java is always \
a good idea, especially if FirstGlance does not seem to be working \
properly. "

	+ makeNotesLink("More..", "java", "") +

"<br><br> \
<b>Not all browsers work well with FirstGlance.</b> \
<font color='green'><b>Recommended browsers</b></font> \
are the <i>current versions</i> of: \
<ul> \
<li><b>Windows</b> \
(get/update java from  \
<a href='http://www.java.com' target='javacomwin'>java.com</a>) \
<font color='green'><b> \
	<ul> \
	<li>Internet Explorer 6 or 7\
	<li>Netscape 7 or 8 \
	<li>Firefox 1.5 or later \
	<li>Mozilla \
	</ul></b></font> \
 \
<li><b>Mac OSX</b> \
(Apple <i>Software Upgrades</i> include java. Keeping your \
software upgrades up to date is recommended.) \
	<ul> \
<b><font color='green'><li>Safari</font></b> (see important "

	+ makeNotesLink("Notes", "safari", ")") +

"<b><font color='green'><li>Firefox 1.5</font></b> (imperfect; see "

	+ makeNotesLink("Notes", "macff", ")") +

"	</ul> \
 \
<li><b>linux</b><font color='green'><b> \
	<ul><li>Mozilla Firefox</ul></b></font> \
</ul> \
 \
<i>FirstGlance in Jmol</i> may not work properly in any browser \
not listed above. It  \
<font color='red'>does not work</font> in these browsers: \
<font color='red'> \
<ul><li>Netscape Communicator 4.x \
<li>Konqueror \
<li>Opera \
</ul></font> \
";

	return trh;

}


//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makeIntroHelp()
{
	
	var introHelp =
"<center>Introduction<\/center> \
<a href='javascript: top.showHelp(\"licenseHelp\")'> \
<img src='nsf4c_50bt.gif' align='right' border='0' \
title='Supported by the Division of Undergraduate Education of the \
US National Science Foundation'></a> \
<big><b>FirstGlance in Jmol</b></big> \
is a simple, free tool for macromolecular visualization. \
The initial display is \
<a href=\"javascript: top.showHelp('cartoonHelp')\"><b>Cartoon</b></a> \
plus \
<a href=\"javascript: top.showHelp('makeLigandsHelp()')\"><b>Ligands+</b></a>. "

+

"(Unusual moieties, when present, are "
	+ makeNotesLink("<b>crosses</b>", "nsr") + "* or "
	+ makeNotesLink("<b>dots</b>", "anomalous") + "&dagger;.) " +

"Click on the links and buttons above to see different \
aspects of the molecular structure. \
 \
<ul> \
<li> <b>Rotate</b> the molecule by dragging near it with the mouse. \
<li>" + identifySubhelp +

//"<li><b>Center</b> a region of interest by <b>clicking</b> on it. "

"<li><b>Center</b> a region of interest using <i>Center Atom</i> above. "

+ noClick +

"You can then inspect details by <b>zooming</b> in. \
Regions distant from the centered moiety can be <b>hidden</b> by \
toggling <i>Slab</i> on. (When finished, \
<i>Center Atom</i> offers the option to re-center the entire molecule.) \
 \
<br><br> \
 \
<li>Click the PQS button above to visualize <b>specific oligomers</b> or \
single molecules. \
 \
<li>Click <b>More Views..</b> above \
for advanced techniques, and views that go beyond those offered above. \
 \
<li>For <b>more information</b> about the molecule (name, species, \
sequence, etc.), click on the PDB or OCA links above. \
 \
<br><br> \
 \
<li>For a <b>quick tour</b> of what <i>FirstGlance</i> can do, \
visit the <b><a href='snaps/index.htm' target=_blank>Snapshot Gallery</a></b>. \
\
<li><b>Snapshots of your work</b> can easily be \
<a href='slides.htm' target=_blank><b>pasted \
into a Powerpoint presentation</b></a>. \
 \
<li><a href='about.htm' target='aboutwin'><b>About FirstGlance in Jmol</b></a> \
has instructions on setting up links to display molecules, \
troubleshooting, copyright, acknowledgements, version history, and more. \
 \
<li> " + makeProteopediaTeaser() + "\
</ul><hr noshade> \
* Crosses represent "

	+ makeNotesLink("non-standard residues", "nsr") +

". To hide or highlight them, click on <i>More Views</i> in \
the upper left panel. \
<br> \
&dagger; Dots represent "

	+ makeNotesLink("anomalous atoms", "anomalous") +

". To hide or highlight them, click on <i>More Views</i> in \
";

	return introHelp;
}

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makeMoreViewsHelp()
{

	var ack = ucck = bbck = aack = aadots = aass = "";
	if (axesOn) ack = "checked ";
	if (unitcellOn) ucck = "checked ";
	if (boundboxOn) bbck = "checked ";
	if (showAnomalous) aack = " checked";
	if (anomalousDots) aadots = " checked";
	else aass = " checked";
	
	var moreHelp =
"<center><b>More Views<\/b><\/center> \
 \
<ul> \
<li>" + makeNonStandardCheckbox() +

"</li><li><a href='javascript: doCatPiSB()'><b>Show \
All Protein Cation-Pi Interactions \
and Salt Bridges</b></a> throughout the molecule. " +

"</li><li><form name='anomalousForm'>\
<input type='checkbox' name='showAA' onClick='doAnomalousAtoms()'" +
aack + ">Show "

	+ makeNotesLink("<b>Anomalous atoms</b>", "anomalous") +

" as<br>\
<input type='radio' name='renderAA' value='d' onClick='doAnomalousAtoms()'" +
aadots + ">dots, or<br>\
<input type='radio' name='renderAA' value='s' onClick='doAnomalousAtoms()'" +
aass + ">dots with spacefilled atoms. \
</form>" +

"</li><li><b>" + makeNotesLink("Sequences", "seq") +
"</b> are available. \
</li><li>To evaluate the <b>Quality of the Molecular Model</b> \
	(<a href='http://www.umass.edu/microbio/chime/pe_alpha/protexpl/igloss.htm#qualitymodel' \
			target='igwin'><font color='#00b000'><b>More..</font></b></a>): \
	<ul> \
	<li><a href='javascript: top.colorTemperature()'><b>Color \
		by Uncertainty</b></a> \
		(&quot;temperature&quot;, &quot;disorder&quot;, &quot;B factor&quot;). \
		<a href='http://www.umass.edu/microbio/chime/pe_alpha/protexpl/igloss.htm#temperature' \
			target='igwin'><font color='#00b000'><b>More..</font></b></a> \
 \
	</li><li><a href='http://molprobity.biochem.duke.edu/' \
	target='aacwin'><b>All-Atom Contact Analysis</b></a> \
with the MolProbity Server \
	(<a href='http://www.umass.edu/microbio/chime/pe_alpha/protexpl/favlit.htm#aac' \
	target='favlitwin'><b>More..</b></a>) corrects \
	ASN, GLN and HIS rotamers, detects atomic clashes and compares the overall \
	&quot;clash score&quot; with those for similar-resolution models, \
	performs Ramachandran analysis, and more. \
 \
	</li><\/ul> \
</li><li>You can "

	+ makeNotesLink("<b>measure distances or angles</b>", "distances", "") +

" between atoms. " +

//click \
//&quot;Jmol&quot; \
//(to lower right of molecule) \
//and on the menu that pops up, select About Jmol, Mouse Manual. \

"<br> \
<a href='javascript: hideMonitors()'><b>Hide distances and angles.</b></a> \
<br><br> \
 \
</li><form name='setForm' id='setForm'> \
<li><input type='checkbox' name='axes' onClick='toggleAxes()' \
" + ack + ">Show Atomic Coordinate Axes. \
</li><li><input type='checkbox' name='unitcell' onClick='toggleUnitcell()' \
" + ucck + ">Show Crystallographic Unit Cell. \
&nbsp; <small>(Shows nothing for NMR models.)</small> \
</li><li><input type='checkbox' name='boundbox' onClick='toggleBoundbox()' \
" + bbck + ">Show Bound Box. \
</li></form> \
 \
<li>Jmol's extensive <b>menu</b> \
(click &quot;Jmol&quot; to the lower right of the molecule) \
enables you to select subsets of atoms, then apply custom \
displays or colors, and much more. \
 \
</li><li>Jmol has a \
<a href='http://www.stolaf.edu/people/hansonr/jmol/docs' \
target='jmolscriptmanualwin'><b>powerful \
command language</b></a>. To send commands to the Jmol applet (in \
FirstGlance), \
click Jmol (to lower right of molecule) \
and on the menu that pops up, select Console, Open. \
 \
</li></ul>";

	moreHelp +=
"For more depth than <i>FirstGlance</i> offers, use the links above \
to <i>PDB</i> or <i>OCA</i>, \
or try out the resources linked below. \
 \
<ul> \
 \
<li>";
//------PE--------
if (top.validPDBId.length > 0)
	moreHelp += top.validPDBId + " in " +
"<a href='http://www.umass.edu/microbio/chime/pe_alpha/protexpl/pe.htm?id="
+ top.validPDBId + "'>" +
"Protein Explorer</a>";

else
	moreHelp +=
"<a href='http://www.umass.edu/microbio/chime/pe_alpha/protexpl/' \
target='pewin'> \
Protein Explorer</a> ";

	moreHelp +=
" (more help for beginners, more depth for advanced users; requires \
<a href='http://www.umass.edu/microbio/chime/getchime.htm' \
target='getchimewin'>Chime</a>). \
";

//------PQS--------
	moreHelp +=
"<li>Visualize specific oligomers, or a single copy ";

if (top.validPDBId.length > 0)
	moreHelp += "of " + validPDBId +
" with <a href='http://pqs.ebi.ac.uk/pqs-bin/macmol.pl?filename=" +
top.validPDBId + "' target='pqswin'>PQS</a>.";

else
	moreHelp +=
" with <a href='http://pqs.ebi.ac.uk/' target='pqswin'>PQS</a>.";

//------CONSURF--------
moreHelp +=
"<li>Visualize evolutionary conservation ";

if (top.validPDBId.length > 0)
	moreHelp +=
"on " + top.validPDBId + " with \
<a href='http://consurf.tau.ac.il/index.html?id=" +
top.validPDBId + "' target='consurfwin'>ConSurf<\/a>.";

else
	moreHelp +=
" with <a href='http://consurf.tau.ac.il/' \
target='consurfwin'>ConSurf<\/a>.";

//------DIPOLES--------
moreHelp +=
"<li>Visualize dipole moments ";

if (top.validPDBId.length > 0)
	moreHelp +=
"of " + top.validPDBId + " with the \
<a href='http://bioportal.weizmann.ac.il/dipol-bin/dipol2j.cgi?pdb_id=" +
top.validPDBId + "' target='dipolewin'>Dipole Moment Server<\/a>.";

else
	moreHelp +=
" with the <a href='http://bioportal.weizmann.ac.il/dipol' \
target='dipolewin'>Dipole Moment Server<\/a>.";

moreHelp += "<li>";

//------IMB-JENA--------
if (top.validPDBId.length > 0)
	moreHelp += top.validPDBId + " at " +
"<a href=\"http://www.imb-jena.de/cgi-bin/ImgLib.pl?CODE="
+ top.validPDBId + "\" target='jenawin'>IMB-Jena<\/a>";

else
	moreHelp +=
"<a href=\"http://www.imb-jena.de/IMAGE_PDB_SEARCH.html\" \
target='jenawin'>IMB-Jena<\/a>";


moreHelp +=
" (a more advanced viewer in Jmol)";

//------MOLVISINDEX--------
moreHelp +=
"<li>World Index of Molecular Visualization Resources: \
<a href='http://www.molvisindex.org' target='molvisindexwin'>MolVisIndex.Org</a>. \
";

//------MOLVIZ--------
moreHelp +=
"<li><a href='http://www.molviz.org' target='molvizwin'>MolviZ.Org</a> \
(tutorials on DNA, \
hemoglobin, lipid bilayers, etc.; links to many molecular visualization \
resources) \
 \
</ul> \
 \
Click <a href='about.htm' target='aboutwin'><b>About \
FirstGlance in Jmol</b><\/a> \
for full documentation, including troubleshooting, \
linking to or installing, license and copyright, \
contributors, and versions. \
";

// <li><a href=\"\"></a> \

//	showSptInWindow(moreHelp.replace(/\</g, "&lt;").replace(/\>/g, "&gt;"));

	return moreHelp;

}

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var helpFooter =
"<br><br> \
<hr noshade> \
Copy this view and paste it into a <b>presentation</b>. \
<a href='slides.htm' target=_blank> \
How?</a> \
<br><br>" + makeProteopediaTeaser() + "\
<br><br>\
Return to \
<a href=\"javascript: top.returnToIntro()\">Introduction</a> \
(atom identification, centering, related resources, \
troubleshooting, license, etc.). \
To <b>reset</b> to the default view, click <i>Reset</i> (above). \
";

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var nohelp = "To Be Written ...";

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var licenseHelp =
"<big><b>Copyright, Licenses & Acknowledgements</b></big> \
<br><br> \
<img src='nsf4c_50bt.gif' align='right'> \
FirstGlance in Jmol is copyright &copy; 2005, 2006 by \
<a href='http://www.umass.edu/molvis/martz' target='emwin'>Eric \
Martz</a>. FirstGlance in Jmol is freely available, \
including its source code*. \
No restrictions are placed on its use or redistribution, except that \
all derivatives must display a prominent link to the home website \
of <i>FirstGlance in Jmol</i> (bioinformatics.org/firstglance) stating \
&quot;Portions adapted from \
<a href='http://www.bioinformatics.org/firstglance' target='fgijwin' \
>FirstGlance \
in Jmol</a>&quot;. Specifically, proprietary, commercial derivatives of \
<i>FirstGlance in Jmol</i> are permitted provided they meet the \
above requirement. \
 \
<br><br> \
 \
<!-- Creative Commons License --> \
<a rel='license' href='http://creativecommons.org/licenses/by/2.5/' \
target='cclicwin'><img alt='Creative Commons License' border='0' \
src='somerights20.gif' align='left' hspace='8' /></a> \
This work is licensed under a <a rel='license' href='http://creativecommons.org/licenses/by/2.5/' \
target='cclicwin'>Creative Commons Attribution 2.5 License</a>. \
<!-- /Creative Commons License --> \
 \
<br><br> \
*<b>Source Code</b> is available from the project home website, \
<a href='http://bioinformatics.org/firstglance' \
target='fghomewin'>bioinformatics.org/firstglance</a>. \
 \
<br><br> \
FirstGlance in Jmol would not be possible without the \
free, open-source java applet \
<a href='http://www.jmol.org' target='jmolwin'>Jmol</a>. Thanks \
are due many people who have selflessly contributed their time \
and expertise to creating Jmol. Special thanks are due <b>Miguel \
Howard</b> for the quality and quantity of his programming contributions \
to the Jmol project, and to <b><a href='http://www.stolaf.edu/people/hansonr/'>\
Robert Hanson</a></b> for his contributions \
to Jmol, and for creating and maintaining \
the indispensible Jmol reference manual. \
<a href='http://sourceforge.net/projects/jmol' target='jmolwin'><b>Jmol \
is licensed</b></a> under the \
<a href='http://www.gnu.org/copyleft/lesser.html' target='gnuwin'>GNU \
&quot;Library&quot; or Lesser General Public License</a>. \
Briefly, this means that Jmol is free, that its source code is openly \
available, and that all derivatives of Jmol itself (the &quot;library&quot;) \
must also be free and have open source code. However, proprietary \
commercial products may utilize Jmol, so long as Jmol itself is unmodified, \
and is redistributed in accord with the terms of the license. \
 \
<br><br> \
Special thanks to Frieda Reichsman \
(<a href='http://moleculesinmotion.com'>moleculesinmotion.com</a>) \
for a large number of insightful suggestions that improved FirstGlance \
substantially. \
 \
<br><br> \
Thanks to Jeff Bizzaro and <a href='http://bioinformatics.org'> \
bioinformatics.org</a> for providing a home for this project. \
Thanks to <a href='http://www.sdsc.edu/~bourne/'>Phil Bourne</a> \
and the <a href='http://www.sdsc.edu'>San \
Diego Supercomputer Center</a> for providing a very fast \
server, and to Andy Sanderson for configuring it. \
 \
<br><br> \
Thanks to <a href='http://bip.weizmann.ac.il/about/people.html'> \
Jaime Prilusky</a> for contributing the "

	+ makeNotesLink("CGI program", "uploads", "") +

" and server that accepts an uploaded \
PDB file, and displays it in FirstGlance. Also for determining most of \
the carbohydrates present in the Protein Data Bank. Also for developing \
and maintaining the OCA browser, which provides mirror sites for \
FirstGlance in Jmol. \
 \
<br><br> \
Thanks to Guoli Wang and Roland L. Dunbrack for their \
<a href='http://dunbrack.fccc.edu/Guoli/s2c/' target=_blank>S2C</a> \
server, linked to "
	+ makeNotesLink("Sequence Notes", "seq") +
". Thanks to Jaime Prilusky for providing an installation of S2C \
that responds quickly, and is updated routinely. \
 \
<br><br> \
Thanks, for good ideas and technical help, to Miguel Howard, Bob Hanson, \
Cris Necocea, Jaime Prilusky, \
Frieda Reichsman, Tim Driscoll, Michael Maroney, Andreas Bohne, Thomas \
Luetteke, and Joel Sussman. \
Thanks to Miguel Howard for enhancements \
to Jmol requested for the FirstGlance project. \
 \
<br><br> \
Development of FirstGlance in Jmol was supported by a grant from the \
Division of Undergraduate Education of the <a href='http://www.nsf.gov'> \
US National Science Foundation</a> \
(Award 9980909), and by the <a href='http://www.umass.edu'> \
University of Massachusetts</a>. \
";

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function checkAll(result)
{
	document.contactsForm.contactsWater.checked = result;
	document.contactsForm.waterBridges.checked = result;
	document.contactsForm.contactsHBonds.checked = result;
	document.contactsForm.contactsHphob.checked = result;
	document.contactsForm.contactsSB.checked = result;
	document.contactsForm.contactsCatPi.checked = result;
	document.contactsForm.contactsMeMi.checked = result;

//	if (!contactingSF)
//		document.contactsForm.contactsSticks.checked = result;

//	document.contactsForm.contactsHydrogens.checked = result;

	changeContactsView();
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makeCatPiSBHelp()
{
	// STOP SELECTING
	selectMode = "";
	// STOP HIDING
	hideMode = "";

	var ckcp, cksb, ckcoe, ckcoc, ckbb;
	ckcp = cksb = ckcoe = ckcoc = ckbb = "";
	var cpsb;
	if (showCatPi)
	{
		ckcp = " checked ";
		cpsb = "Cation-Pi Interactions"
	}
	else
	{
		cksb = " checked ";
		cpsb = "Salt Bridges"
	}

	if (colorCatPiSBChain)
		ckcoc = " checked";
	else
		ckcoe = " checked";

	if (showCatPiSBBackbones)
		ckbb = " checked";

	var hh =
"<form name='catPiSBForm'> ";

	hh += "<center><b>Salt Bridges / Cation-Pi Orbital Interactions</b></center> \
<br> \
<input type='radio' name='catPiSB' value='s' \
onClick='showCatPiSB(\"\")'" + cksb + "> \
Show Protein "

	+ makeNotesLink("Salt Bridges", "saltbr", "") +

"<br> \
<input type='radio' name='catPiSB' value='c' \
onClick='showCatPiSB(\"\")'" + ckcp + "> Show Protein "

	+ makeNotesLink("Cation-Pi Interactions", "catpi", "*") +

"<br>Color Protein " + cpsb +
"<br> &nbsp; <input type='radio' name='colorCatPiSB' value='e' \
onClick='showCatPiSB(\"\")'" + ckcoe + "> by Element \
\
<br> &nbsp; <input type='radio' name='colorCatPiSB' value='c' \
onClick='showCatPiSB(\"\")'" + ckcoc + "> by Chain \
\
<br><input type='checkbox' name='backbonesCatPiSB'" + ckbb +

" onClick='showCatPiSB(\"\")'> Show Backbones \
\
<br><br> \
These interactions are shown for <b>protein chains only</b>. <i>FirstGlance</i> \
does not show interactions involving ligands or nucleic acids. \
<br><br> \
*<b>Caution:</b> Some cation-pi interactions shown may not be \
energetically significant, while some energetically signficant \
interactions may fail to be shown. Consult \
<a href='http://capture.caltech.edu/' target=_blank><b>CaPTURE</b></a> \
for a definitive list. "

	+ makeNotesLink("More..", "catpi", ".");


	hh += "</form>";

	return hh;
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makeBadPDBFileHelp()
{
	var bfh =
'<big>We are sorry, but <font color="red"><big><b>';

	if (usePDBId)
		bfh += validPDBId;
	else
		bfh += pdbToLoad;

	bfh += ' is not available</b></big></font>';

	if (usePDBId)
		bfh += ' from the Protein Data Bank.\n\
If the PDB identification code above is <i>correct</i>, then most likely \n\
the atomic coordinates (PDB file) have not yet been released \n\
to the public. Often there is a delay of up to a week between publication \n\
and release of the coordinates. To find out, please \n\
<a href="' + rcsbPDBURLHead + validPDBId + '" target="_blank"><b>check the \n\
status of '
 + validPDBId +
' at the Protein Data Bank</b></a>.';

	else
		bfh += '. There may be an error in the filename or URL.'

	bfh += ' FirstGlance in Jmol is unable to display the molecule\n\
as specified. (You may close this window.)</big>'; 

	return bfh;
}

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makeProteopediaTeaser()
{
	var ppt =
"<img src='new.gif' align='left'>\
<a href='javascript: \
top.showHelp(\"makeProteopediaHelp()\")'>\
<img src='proteopedia_w60boldface.png' align='right' border='0'></a>Share \
custom molecular views linked to explanations \
-- with ease -- at <a href='javascript: \
top.showHelp(\"makeProteopediaHelp()\")'>Proteopedia.Org</a>! \
";

	return ppt;
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function makeProteopediaHelp()
{
	var pph =
"<a href='http://proteopedia.org' target='_blank'>\
<img src='proteopedia_w100boldface.png' align='right' border='0'> \
<a href='http://proteopedia.org' target='_blank'><b>Proteopedia.Org</b></a>, \
is a \
<a href='http://en.wikipedia.org/wiki/Wiki' target='_blank'>wiki</a> \
with easy tools for authoring and sharing customized interactive molecular scenes in \
<a href='http://en.wikipedia.org/wiki/Jmol' target='_blank'>Jmol</a>. \
Like \
<a href='http://wikipedia.org' target='_blank'>Wikipedia.Org</a>, \
the <i>Proteopedia</i> wiki enables anyone to create or add to articles \
and molecular scenes. Molecular scenes (views) obtained in <i>FirstGlance \
in Jmol</i> can be \
<a href='http://proteopedia.org/wiki/index.php/Help:Copying_FirstGlance_Scenes_into_Proteopedia' \
target='_blank'>saved and installed in <i>Proteopedia</i></a>. \
<br><br> \
There is an automatically-generated page for every entry in the \
<a href='http://proteopedia.org/wiki/index.php/Protein_Data_Bank' \
target='_blank'>PDB</a>. \
";

if (top.validPDBId.length > 0)
	pph += 'See <a href="http://proteopedia.org/wiki/index.php/' +
		top.validPDBId.toLowerCase() + '" target="_blank"><b>' +
		top.validPDBId.toLowerCase() + ' at Proteopedia.Org</b></a>.' +
		' You are invited to add molecular scenes and text to this page.';

	pph +=
"<br><br>Green links in the text of Proteopedia articles display new molecular scenes, \
connecting them to their descriptions. \
Unlike in Wikipedia, articles in Proteopedia can be protected from editing \
by others, and are signed by the real names of their authors. Articles in \
Proteopedia can be used as supplementary materials for journal articles, \
educational tutorials, or as reference material. \
Take a look at \
<a href='http://proteopedia.org' target='_blank'><b>Proteopedia.Org</b></a>. \
";

	return pph;
}
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
