/* Preload Images etc... */
var path = document.location.href;
var lastSlashPos = path.lastIndexOf("/");
var htmPos = path.lastIndexOf("htm");
var pathLen = path.length;
var docName = path.substr(lastSlashPos+1,htmPos-lastSlashPos+3);
var DTitle = document.title;
var tPos1 = DTitle.lastIndexOf("-");
var ProdName = DTitle.substr(tPos1+2);
var CurrI = 0;
/* Set isWeb to true when posted to server: */
var isWeb = true;
/* Set up Category for this document */
/* Detect this document's categories */
var prodCats = new Array();
if (document.getElementsByName)
{
prodCats = document.getElementsByName('CAT');
}
var catDefs = prodCats.length;
//alert(docName + "  -  " + catDefs);

/*	Create "Category:" link(s) at foot of product pages */
function mk_link()
{
	if (catDefs>0)
	{
	for (var i=0; i<catDefs; i++)
		{
		//alert (i);
		var lnkTxtP = "";
		var lnkTxtN = "";
		docs.length=0;
		var catName = prodCats[i].content;
		//alert(catName);
		var ThisIdx=getIdx(catName);
		loadDocs(ThisIdx);
		tot = docs.length;
		//alert (tot + " " + ThisIdx);
		/* Set up link text strings */
		for (var j=0; j<tot+1; j++)
			{
				if (docName==docs[j])
				{
				var iTem = j+1;
				var docNo = "item " + iTem + " of " + tot + "&nbsp;";
				if (j==0)
					{
					lnkTxtP = "&nbsp;";
					}
				else
					{
					lnkTxtP = "<a href=\"" + docs[j-1] + "\">&lt;Previous</a>";
					}
				if (j > 0 && j < tot-1)
					{
					lnkTxtN = "&nbsp;|";
					}
				if (j==tot-1)
					{
					lnkTxtN = "";
					}
				else
					{
					var lnkTxtN = lnkTxtN + "&nbsp;<a href=\"" + docs[j+1] + "\">Next&gt;</a>";
					}
				break;
				}
			}
		document.write("Category: <span class=\"" + catKeys[ThisIdx] + "\">" + catNames[ThisIdx] + "&nbsp;</span>"
		+ docNo + lnkTxtP + lnkTxtN + "<br>");
		}
	}
	else
	{
	document.write("No Category<br>"); 	
	}
}

function backToLast()
{	
	if (catDefs>0)
	{
	for (var i=0; i<catDefs; i++)
		{
		var catName = prodCats[i].content;
		var ThisIdx=getIdx(catName);
		var lastCat=catKeys[ThisIdx];
		}
	document.write(" | <a href=\"index.html?cat=" + lastCat + "\">Product Index</a>");
	}
}

function LoadImg(imageSource,whichImage,statusText,CaptionTxt,imageWidth,imageHeight)
{
if (document.images)
	{
	if ((imageWidth) && (imageHeight))
		{
		document.images[whichImage].width = imageWidth;
		document.images[whichImage].height = imageHeight;
		}
	document.images[whichImage].src = imageSource;
	window.status=statusText;
	if (CaptionTxt)
		{
		showCap(CaptionTxt);
		} 
	}
}

function showCap(text)
{
var Capt = document.getElementById("Caption");
Capt.innerHTML = text;
}

/* Click button to cycle through images in array */
function rotateImg(whichImage)
{
if (document.images)
	{
	CurrI++;
	if (CurrI == ImgCt)
		{
		CurrI=0;
		}
	document.images[whichImage].src = Imgs[CurrI];
	showCap(Caps[CurrI]);
	}
}

/* Page specific rollovers and image sets */
if (docName=="aab.html")
{
var Imgs = new Array("images/177183.gif","images/177166.gif","images/177153.gif","images/3883.gif","images/5231.gif");
var Caps = new Array("HP Ref.200177183","Not Ref.200177166","Rough Ref.200177153","Not Ref.200003883","Not Ref.200005231 - 4 sheets free");
var ImgCt = Imgs.length;
preLoad();
}
if (docName=="bffp.html")
{
var Imgs = new Array("images/fpbf3.gif","images/fpbfx3.gif","images/fpbf4.gif","images/fpbfx4.gif");
var Caps = new Array("300gsm Not","300gsm Rough","425gsm Not","425gsm Rough");
var ImgCt = Imgs.length;
preLoad();
}
if (docName=="jp847.html")
{
var Imgs = new Array("images/950-01.gif","images/950-06.gif","images/950-07.gif","images/950-09.gif","images/950-10.gif");
var Caps = new Array("Ref. 950-01 Red","Ref. 950-06 Green","Ref. 950-07 Blue","Ref. 950-09 Violet","Ref. 950-10 Pink");
var ImgCt = Imgs.length;
preLoad();
}
if (docName=="him1.html")
{
var Imgs = new Array("images/L01.gif","images/L03.gif");
var Caps = new Array("L01","L03");
var ImgCt = Imgs.length;
preLoad();
}
if (docName=="him3.html")
{
var Imgs = new Array("images/L97A.gif","images/L97B.gif","images/L97C.gif","images/L97D.gif","images/L97E.gif");
var Caps = new Array("L97A","L97B","L97C","L97D","L97E");
var ImgCt = Imgs.length;
preLoad();
}
if (docName=="spe.html")
{
var Imgs = new Array("images/speSatin.gif","images/speTextured.gif","images/speVelvet.gif");
var Caps = new Array("Satin","Textured","Velvet");
var ImgCt = Imgs.length;
preLoad();
}
if (docName=="wfblk.html")
{
var Imgs = new Array("images/wfblockH.gif","images/wfblockN.gif","images/wfblockR.gif");
var Caps = new Array("Hot Pressed","Not","Rough");
var ImgCt = Imgs.length;
preLoad();
}
if (docName=="wffp.html")
{
var Imgs = new Array("images/fpwf3H.gif","images/fpwf3N.gif","images/fpwf3R.gif");
var Caps = new Array("Hot Pressed","Not","Rough");
var ImgCt = Imgs.length;
preLoad();
}
if (docName=="hdis.html")
{
var Imgs = new Array("images/hdtr2.gif","images/hdtr3.gif");
var Caps = new Array("Bamboo/Baryta Sampler ref. 10640216 Side 1","Bamboo/Baryta Sampler ref. 10640216 Side 2");
var ImgCt = Imgs.length;
preLoad();
}

/* Called from jpp.html */
function jpreamble()
{
document.write("We have divided our range of 37 Japanese paper products into four overlapping categories that either indicate a method of manufacture or a possible end use:<br><br>");
}

function preLoad()
{
if (document.images)
	{
	var load = new Array;
	for (var i = 0; i < Imgs.length; i++)
		{
		load[i] = new Image();
		load[i].src = Imgs[i];
		}
	}
}

function EmailThis()
{
document.write(" | <a href=\"mailto:?subject=Link to "+ProdName+"&body=http://www.rkburt.com/products/"+docName+"\">Email Link</a>"); 
}
function doEmail()
{
var e1='%72%6b%62%75%72%74%2e%63%6f%2e%75%6b';
var e2='mailto:%20';
var e3='%73%61%6c%65%73';
var e0=e2+e3+'@'+e1;
window.location?window.location.replace(e0):document.write(e0);
}

