// JavaScript Documentfunction showPic(whichPic) {	if (document.getElementById) {		var source = whichPic.getAttribute("href");		var placeHolder = document.getElementById("imgholder");		placeHolder.setAttribute("src",source);		// show caption		//showDesc('one');	}}function showDesc(sChapNum) {	if (document.getElementById) {		var paraID = 'chap_' + sChapNum + '_desc';		var childElements = document.getElementById("cutout").childNodes;		for (var i = 0; i < childElements.length; i++) {			if (childElements[i].tagName == 'P') {				if (childElements[i].id == paraID) {					childElements[i].style.display = "block"				} else {					childElements[i].style.display = "none"				}			}		}	}}function showThumbs(whichChap) {	if (document.getElementById) {		var sChapNum = whichChap.parentNode.id;		var chapID = sChapNum + '_thumbs';		var spanElements = document.getElementsByTagName("span");		for (var i = 0; i < spanElements.length; i++) {			if (spanElements[i].id == chapID) {				spanElements[i].style.display = "block"			} else {				spanElements[i].style.display = "none"			}		}		doSwap(whichChap, sChapNum, 'A')	}}function doSwap(whichPic, sChapNum, sPicNum) {	showPic(whichPic);	showDesc(sChapNum);	hiliteThumb(sChapNum,sPicNum)}// toggle the visibility of an elementfunction toggleVis(targetId){	if (document.getElementById) {		target = document.getElementById(targetId);		if (target.style.display == "none") {			target.style.display = "block";		} else {			target.style.display = "none";		}	}}// swap photos and collapse buttons function toggleVisButton(targetId,buttonId){  if (document.getElementById)        {        target = document.getElementById(targetId);        buttonName = document.getElementById(buttonId);            if (target.style.display == "none")                {                target.style.display = "";                }                         else                 {                target.style.display = "none";                }                            if (target.style.display == "none")                {                buttonName.src = "images/nav_close.gif";                }            else                 {                buttonName.src = "images/nav_open.gif";                }        }}// hilite selected thumbnailfunction hiliteThumb(sChapNum,sPicNum) {	if (document.getElementById) {		var aPicNumList = new Array('A','B','C');		var thumbID = 't_' + sChapNum + '_' + sPicNum;		for (var i = 0; i < aPicNumList.length; i++) {			var currThumbID = 't_' + sChapNum + '_' + aPicNumList[i];			var target = document.getElementById(currThumbID);			if (target != null) {				var source = target.getAttribute("src");				if (currThumbID == thumbID) {					target.setAttribute("src",source.replace("1","2"));				} else {					target.setAttribute("src",source.replace("2","1"));				}			}		}	}}// swap photos and collapse buttons function hideVisButton(targetId,buttonId){  if (document.getElementById) {        target = document.getElementById(targetId);        buttonName = document.getElementById(buttonId);        target.style.display = "none";        buttonName.src = "images/nav_close.gif";   }}
