/* All variables in this file begin with "nb" for "navbar" to avoid
 * conflicts with other scripts.
 */

var nbList=[
	// [short name, Long name, width of text graphic, height],
	['vestments','Vestments',81,7],
	['byzicons','Icons',41,7],
	['woodwork','Woodwork',81,7],
	['apparel','Religious Apparel',72,27],
	['ropes','Prayer Ropes',54,26],
	['crosses','Beaded Crosses',58,24],
	['music','Music',44,7],
	['<hr>'],
	['search','Search',51,10],
	['order','Order',47,8],
	['contact','Contact',59,7]
];

var nbDots;
for(var nbj,nbtmp,nbIndexOf=-1,nbThisPage,nbi=0;nbi<nbList.length;nbi++){
	nbtmp=location.href.lastIndexOf('/'+nbList[nbi][0]+'/');
	if(nbtmp>nbIndexOf) {
		nbIndexOf=nbtmp;
		nbThisPage=nbList[nbi][0];
		nbtmp=location.href.substring(nbIndexOf+2+nbList[nbi][0].
			length);
		for(nbj=0,nbDots='';nbj<nbtmp.length;nbj++){
			if(nbtmp.charAt(nbj)=='/') nbDots+='../';
		}
	}
}

nbtmp = "<a target=_self onmouseover=\"document.images.homebutton.src='"
		+ nbDots + "../navbar/homeover.gif'\""
		+ " onmouseout=\"document.images.homebutton.src='"
		+ nbDots + "../navbar/home.gif'\" href=\"" + nbDots
		+ '../index.html">';
var nbtw = "<table border=0 cellspacing=18 cellpadding=0><tr>"
	+ "<td align=center>"
		+ nbtmp
		+ '<img src="' + nbDots + '../navbar/home.jpg" height=89'
		+ ' width=72 border=0></a><br><img src="' + nbDots
		+ '../t.gif" height=8 width=32 border=0><br>'

		+ nbtmp + '<img name=homebutton id=homebutton src="'
		+ nbDots+'../navbar/home.gif" height=10 width=42 border=0'
		+ ' alt=Home>'
		+ '</a></td></tr>';

var nbca;
for(nbi=0;nbi<nbList.length;nbi++){
	nbtmp = "<a target=_self onmouseover=\"document.images."
		+ nbList[nbi][0]
		+ "button.src='"
		+ nbDots + "../navbar/" + nbList[nbi][0] + "over.gif'\""
		+ " onmouseout=\"document.images." + nbList[nbi][0]
		+ "button.src='"
		+ nbDots + "../navbar/" + nbList[nbi][0]
		+ ".gif'\" href=\"" + nbDots + '../' + nbList[nbi][0]
		+ '/index.html">';
	nbtw+="<tr><td align=center>";
	if (nbList[nbi][0] == '<hr>') {
		nbtw += '<div style="background-color: #fc6; height:2px"><img src="' + nbDots + '../t.gif" width=75 height=2></div></td>';
		continue;
	}
	if(nbList[nbi][0]==nbThisPage) {
		nbIndexOf=location.href.lastIndexOf('/');
		nbca=location.href.charAt(nbIndexOf+1);
		nbj = !nbDots && (location.href.lastIndexOf('index.html')
			 ==
			    nbIndexOf + 1 ||
			nbIndexOf + 1 ==location.href.length ||
			nbca=='?'||nbca=='#');
		if(!nbj) nbtw += nbtmp;
		nbtw+='<img src="'+ nbDots + '../buttons/' + nbThisPage
			+ 'button.jpg" height=72 width=72 border=0>';
		if(!nbj) nbtw += "</a>";
		nbtw += '<br><img src="' + nbDots
			+ '../t.gif" height=8 width=32 border=0><br>';
		if(!nbj) nbtw += nbtmp;
		nbtw += '<img name=' + nbList[nbi][0] + 'button id='
			+ nbList[nbi][0] + 'button src="'
			+ nbDots+'../navbar/' + nbList[nbi][0]
			+ (nbj ? 'over' : '') + '.gif" height='
			+ nbList[nbi][3]
			+ ' width=' + nbList[nbi][2] + ' border=0 alt="'
			+ nbList[nbi][1] + '">';
		if (!nbj) nbtw += '</a>';
	} else {
		nbtw += nbtmp + '<img name=' + nbList[nbi][0]
			+ 'button id='
			+ nbList[nbi][0] + 'button src="'
			+ nbDots+'../navbar/' + nbList[nbi][0]
			+ '.gif" height='
			+ nbList[nbi][3]
			+ ' width=' + nbList[nbi][2] + ' border=0 alt="'
			+ nbList[nbi][1] + '"></a>';
		
	}
	nbtw += '</td></tr>'
}
document.write(nbtw + '</table>');
var nbPrld=new Array();
function nbPreload(){
	for(var nbk=0,nbl=-1;nbk<nbList.length;nbk++){
		if(nbList[nbk][0] == '<hr>') continue;
		nbPrld[++nbl]=new Image();
		nbPrld[nbl].src=nbDots + '../navbar/' + nbList[nbk][0] +
			'.gif';
		nbPrld[++nbl]=new Image();
		nbPrld[nbl].src=nbDots + '../navbar/' + nbList[nbk][0] +
			'over.gif';
		nbPrld[++nbl]=new Image();
		nbPrld[nbl].src=nbDots + '../buttons/' + nbList[nbk][0] +
			'button.jpg';
	}
	nbPrld[++nbl]=new Image();
	nbPrld[nbl].src=nbDots + '../navbar/homeover.gif';
}
