<!--

/*
  This JavaScript code, and all associated software and file structures, calling or called 
  by this code, are copyrighted material, and may not be copied or duplicated in any manner 
  whatsoever without prior written authorization.  All applicable trademarks, registrations, 
  & copyrights are property of Phil Astrella, Registry Enterprises.
*/


var	iSaveSrc, iSaveName, iFlag=false, pnRec, pnRecPage, 
	thisNavImagePage	= getPageName(),
	thisNavImageSource	= "about/about",
	thisNavImageTitle	= "",
	thisNavImageDesc	= "";



// identify page nav image & caption

for (nx = 0 ; nx < pageNavImageList.length ; nx++)
  {
	if (pageNavImageList[nx].indexOf("::") == -1) { continue };
	pnRec = pageNavImageList[nx].split("::");
	if ((pnRec[0] != thisNavImagePage) && (pnRec[0].indexOf("*") == -1)) { continue };
	if (pnRec[0].indexOf("*") != -1)
	  {
	    pnRecPage = pnRec[0].substring(0,pnRec[0].indexOf("*"));
	    if (thisNavImagePage.indexOf(pnRecPage) != 0) { continue };
	  }
	thisNavImageSource	= pnRec[1];
	thisNavImageTitle	= pnRec[2];
	thisNavImageDesc	= pnRec[3];
	break
  }

if ((thisNavImageSource == "random") || (thisNavImageSource.indexOf("/") == -1))
  {
	var randomNavImageIndex = Math.round(Math.random()*(randomNavImageList.length-2));
	var randomNavImageRec	= randomNavImageList[randomNavImageIndex].split("::");
	thisNavImageSource	= randomNavImageRec[0];
	thisNavImageTitle	= (randomNavImageRec[1].length < 2) ? ""
				: "<div align=center class='caption2' style='color:dimgray'>"
				  + "<nobr><b>&#147;"+randomNavImageRec[1]+"&#148;</b></nobr>"
				  + "</div>" ;
	thisNavImageDesc	= ((thisNavImageTitle.length < 1) || 
				   (randomNavImageRec[2].length < 2)) ? ""
				: "<div align=justify class='caption2' style='color:dimgray'>"
				  + randomNavImageRec[2]+"</div>";
	thisNavImageCaption	= compressString(thisNavImageTitle+thisNavImageDesc);
  } else
  {
	thisNavImageTitle	= (thisNavImageTitle.length < 2) ? ""
				: "<div align=center class='caption2' style='color:dimgray'>"
				  + "<nobr><b>&#147;"+thisNavImageTitle+"&#148;</b></nobr>"
				  + "</div>" ;
	thisNavImageDesc	= (thisNavImageDesc.length < 2) ? ""
				: "<div align=justify class='caption2' style='color:dimgray'>"
				  + thisNavImageDesc+"</div>";
	thisNavImageCaption	= compressString(thisNavImageTitle+thisNavImageDesc);
  }



function preloadImages(piPrefix)
  {
    var piPath = (piPrefix == "random") ? randomNavImageSource : ""+piPrefix ;
    var piList = new Array(
	piPath+"_D2R.jpg",	piPath+"_D3R.jpg",	piPath+"_D4R.jpg",
	piPath+"_D5R.jpg",	piPath+"_D6R.jpg",	piPath+"_D7R.jpg",
	"");
    imagePreload(piList)
  }


function imagePreload(ip)
  {
    iList = new Array();
    for (ix = 0; ix < ip.length ; ix++)
      {
	if (ip[ix].indexOf(".") != -1)
	  {
	    iList[ix]		= new Image();
	    iList[ix].src	= "images/"+ip[ix];
	    iList[ix].name	= (ip[ix].indexOf("/") != -1)
			? ip[ix].substring(ip[ix].lastIndexOf("/")+1,ip[ix].indexOf(".")-1)
			: ip[ix].substring(0,ip[ix].indexOf(".")-1);
	    iList[ix].ext	= ip[ix].substring(ip[ix].indexOf("."),ip[ix].length);
	  }
      }
    if (iList.length > 0) { iFlag = true }
  }


function imageMouseOver(iName)
  {
    if (iFlag)
      {
	for (ix = 0 ; ix < iList.length ; ix++)
	  {
	    if (iList[ix].name == iName)
	      {
		iSaveName	= iList[ix].name;
		iSaveSrc	= document.images[iSaveName].src;
		document.images[iSaveName].src = iList[ix].src
		break
	      }
	  }
      }
  }


function imageMouseOut()
  {
    if (iFlag) { document.images[iSaveName].src = iSaveSrc }
  }


function setupNavImages(sniPrefix,sniNoNav)
  {
    var sniLoc = ""+document.location;
    document.write("<TABLE cellSpacing=0 cellPadding=0 width=190 height=405 border=0><TBODY>"
      + "<tr><td width=190 height=25>"
	+ "<IMG width=190 height=25 src='images/"+sniPrefix+"_D1.jpg'");
    if (sniLoc.indexOf("http://") != 0) 
      { document.write(" alt='nav image source = images/"+sniPrefix+"_D*.jpg'") };
    document.write("></td></tr>");

    if (sniNoNav == "face")
      { document.write("<tr><td width=190 height=25>"
	+ "<img src='images/"+sniPrefix+"_D2R.jpg' width=190 height=25></td></tr>") } else
      { document.write("<tr><td width=190 height=25><a href='face_home.html'>"
		+ "<img src='images/"+sniPrefix+"_D2.jpg' border=0 width=190 height=25 " 
		+ "name='"+sniPrefix.substring(sniPrefix.indexOf("/")+1,sniPrefix.length)
		+ "_D2' onMouseOver='imageMouseOver(this.name)' onMouseOut='imageMouseOut()'>"
		+ "</a></td></tr>") };

    if (sniNoNav == "body")
      { document.write("<tr><td width=190 height=25>"
	+ "<img src='images/"+sniPrefix+"_D3R.jpg' width=190 height=25></td></tr>") } else
      { document.write("<tr><td width=190 height=25><a href='body_home.html'>"
		+ "<img src='images/"+sniPrefix+"_D3.jpg' border=0 width=190 height=25 " 
		+ "name='"+sniPrefix.substring(sniPrefix.indexOf("/")+1,sniPrefix.length)
		+ "_D3' onMouseOver='imageMouseOver(this.name)' onMouseOut='imageMouseOut()'>"
		+ "</a></td></tr>") };

    if (sniNoNav == "hair")
      { document.write("<tr><td width=190 height=25>"
	+ "<img src='images/"+sniPrefix+"_D4R.jpg' width=190 height=25></td></tr>") } else
      { document.write("<tr><td width=190 height=25><a href='hair_home.html'>"
		+ "<img src='images/"+sniPrefix+"_D4.jpg' border=0 width=190 height=25 " 
		+ "name='"+sniPrefix.substring(sniPrefix.indexOf("/")+1,sniPrefix.length)
		+ "_D4' onMouseOver='imageMouseOver(this.name)' onMouseOut='imageMouseOut()'>"
		+ "</a></td></tr>") };

    if (sniNoNav == "gift") 
      { document.write("<tr><td width=190 height=25>"
	+ "<img src='images/"+sniPrefix+"_D5R.jpg' width=190 height=25></td></tr>") } else
      { document.write("<tr><td width=190 height=25><a href='gift_home.html'>"
		+ "<img src='images/"+sniPrefix+"_D5.jpg' border=0 width=190 height=25 " 
		+ "name='"+sniPrefix.substring(sniPrefix.indexOf("/")+1,sniPrefix.length)
		+ "_D5' onMouseOver='imageMouseOver(this.name)' onMouseOut='imageMouseOut()'>"
		+ "</a></td></tr>") };

    if (sniNoNav == "nurturing") 
      { document.write("<tr><td width=190 height=25>"
	+ "<img src='images/"+sniPrefix+"_D6R.jpg' width=190 height=25></td></tr>") } else
      { document.write("<tr><td width=190 height=25><a href='nurturing_home.html'>"
		+ "<img src='images/"+sniPrefix+"_D6.jpg' border=0 width=190 height=25 " 
		+ "name='"+sniPrefix.substring(sniPrefix.indexOf("/")+1,sniPrefix.length)
		+ "_D6' onMouseOver='imageMouseOver(this.name)' onMouseOut='imageMouseOut()'>"
		+ "</a></td></tr>") };

    if (sniNoNav == "about") 
      { document.write("<tr><td width=190 height=20>"
	+ "<img src='images/"+sniPrefix+"_D7R.jpg' width=190 height=20></td></tr>") } else
      { document.write("<tr><td width=190 height=20><a href='about_home.html'>"
		+ "<img src='images/"+sniPrefix+"_D7.jpg' border=0 width=190 height=20 " 
		+ "name='"+sniPrefix.substring(sniPrefix.indexOf("/")+1,sniPrefix.length)
		+ "_D7' onMouseOver='imageMouseOver(this.name)' onMouseOut='imageMouseOut()'>"
		+ "</a></td></tr>") };

    document.write("<tr><td width=190 height=235><IMG width=190 height=235 "
	+ "src='images/"+sniPrefix+"_D8.jpg'></td></tr>"
	+ "</TBODY></TABLE>")
  }

//-->
