// debug alerts thru # 3

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
function makeIdentityCodeHelp()
{
//	alert("snippets.js #2 executing makeIdentityCodeHelp()");

	var mih =
"If you don't recognize the abbreviation, go to <a href='\
http://proteopedia.org";

	var mihpid = getPDBId();
	if (mihpid.length > 0)
		mih += "/wiki/index.php/" + mihpid.toLowerCase();

	mih +=
"' target='_blank'>Proteopedia</a>, and click on the green link \
for the ligand abbreviation. The full name will be displayed, and the group \
will be highlighted in the molecular scene. There are also \
<a href='javascript: toggleDivVisibility(\"midcdhlp\")'>\
other methods</a>.";

	mih +=
"<div id='midcdhlp' style='display:none;background-color:#e0e0e0;'>\n\
Other methods for finding the full name for the 3-character abbreviation \
for a residue/group: \
<ul> \
<li> \
Click <i>Key Resources</i> (upper left panel in <i>FirstGlance</i>), \
then <img src='pdb_.gif'> (in the lower left help panel). \
At the PDB website look for the block <i>Ligand Chemical Component</i> \
(under the default Summary tab). \
</li><li> \
Click <i>Key Resources</i> (upper left panel in <i>FirstGlance</i>), \
then <img src='oca_.gif'> (in the lower left help panel). \
At the OCA website look for <b>ligand</b>. In OCA, the list includes both \
ligands and non-standard residues. \
</li></ul> \
<a href='javascript: toggleDivVisibility(\"midcdhlp\")'>\
Hide</a>.\
</div>\n";

	return mih;
}

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
function toggleDivVisibility(divId)
{
	if (document.getElementById(divId).style.display == 'none')
	{
		document.getElementById(divId).style.display = '';
	}
	else
	{
		document.getElementById(divId).style.display = 'none';
	}
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*
JavaScript Image slideshow:
By JavaScript Kit (www.javascriptkit.com)
Over 200+ free JavaScript here!

// To start show in body of document, call slideit().

INITIAL IMAGE:
<a href="javascript:gotoshow()"><img src="food1.jpg"
name="slideshow1" border=0></a> 

I'M NOT USING THE LINK-PER-IMAGE CAPABILITY, SO:
<img src="food1.jpg" name="slideshow1" border=0>

THIS CAUSES JMOL TO BLANK ON EVERY SLIDE CHANGE FOR FF IN OS X ONLY
(FF ON WIN98 IS OK). THEREFORE DISABLED FOR OS X FF.

*/

var slideimages=new Array();
//var slidelinks=new Array();

function slideshowimages()
{
	for (i=0;i<slideshowimages.arguments.length;i++)
	{
		slideimages[i]=new Image();
		slideimages[i].src=slideshowimages.arguments[i];
	}
}

//function slideshowlinks()
//{
//	for (i=0;i<slideshowlinks.arguments.length;i++)
//		slidelinks[i]=slideshowlinks.arguments[i];
//}

// Not sure what this is for.
//function gotoshow()
//{
//	if (!window.winslide||winslide.closed)
//		winslide=window.open(slidelinks[whichlink])
//	else
//		winslide.location=slidelinks[whichlink]
//
//	winslide.focus()
//}

//configure the speed of the slideshow, in milliseconds
var slideshowspeed=10000;

//var whichlink=0;
var whichimage=0;

var slideShowInitialized = false;

function slideit()
{
	if (!slideShowInitialized)
	{
		// Configure the paths of the images, plus corresponding target links.
		// If there is more than 1 slideshow, put these in the html page(s).

		slideshowimages("pqs_.gif","4enl_consurf_icon.png","gaps2_.gif",
		"1bef_clash.png","pdb_.gif","oca_.gif","proteopedia_w30.png");

		//slideshowlinks("http://food.epicurious.com/run/recipe/view?id=13285",
		//"http://food.epicurious.com/run/recipe/view?id=20010")

		slideShowInitialized = true;
	}

	//alert("snippets.js #3 isMac=" + isMac + ", thisBrowser=" + thisBrowser);
	if (isMac && thisBrowser == "ff")
		return; // see above; causes Jmol blanking on every slide change.

	if (!document.images)
		return;

// left item has no properties in Safari.
	document.images.slideshow1.src=slideimages[whichimage].src;
//	alert("snippets.js #1 slideimages[" + whichimage + "].src = " +
//		slideimages[whichimage].src);
//	document.getElementById('slideshow1').src=slideimages[whichimage].src;

//	whichlink=whichimage;

	if (whichimage<slideimages.length-1)
		whichimage++;
	else
		whichimage=0;

	setTimeout("slideit()",slideshowspeed);
}

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
function writeHelpNeedingUpdate(more)
{
	var hnu =	
'<center><b>Caution</b></center> \
This document has not been updated since version 1.0 of FirstGlance \
in Jmol (' + releaseDateV1 + '). It is awaiting updating for the \
current version '
+ fgijVersion + ' (' + releaseDate + ') and a much improved Jmol.';

	if (typeof(more) != "undefined")
		hnu += " " + more;

	writeTextInPinkBox(hnu);
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
function writeTextInPinkBox(txt)
{
	var tpb = 
'<center><div \
style="background-color:#ffd0d0;padding:6px;width:60%;border:1px solid red;"> \n'
+ txt +
'</div></center>';

	document.writeln(tpb);
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

