//nav.js adapted for buttons & Balls

// nav.js for the Next Page.
NS4 = (document.layers);
IE4 = (document.all);
ver4 = (NS4 || IE4);
browserOK = document.images;
isMac = (navigator.appVersion.indexOf("Mac") != -1);


// locate the image files

btnPre = "buttons/btn-";
pgbtnPre = "buttons/";
imBase = "images/"
imBar = "images/bar-";

btnUp = "sphere-heather";
btnOver = "sphere-bronze";
btnDown = "sphere-yel-pink";


// list the pages
arPages = new Array(
null,
"hotspgs-01.html",	// 1
"hotspgs-02.html",	// 2
"hotspgs-03.html",	// 3
"hotspgs-04.html",	// 4
"hotspgs-05.html",	// 5
"hotspgs-06.html",	// 6
"hotspgs-07.html"	// 7
)	

// List Spheres
arSpheres = new Array(
null,
"sphere-dark-red",	//	1
"sphere-bronze",		//	2
"sphere-yel-pink"		// 3
)

// list the urls
arUrls = new Array(
null,
"../index.html",					// 1
"http://www.tylerstravels.com", 	// 2
"mailto:pat@tylersterritory.com",	// 3
"",// 4
"namerica/ac-2001/index.html",				// 5
"namerica/rockies-n-2000/index.html",		// 6
"namerica/rockies-s/index.html",		// 7
"namerica/new_england/index.html",			// 8
"namerica/mid-south/index.html",			// 9
"namerica/alaska/index.html",				// 10
"pacific/hawaii/2000/index.html",			// 11
"namerica/2006/index.html",				// 12 Vancouver Island   namerica/2006/index.html

"europe/ancientworld.html",					// 13
"camerica/canal_cruise/index.html",			// 14
"china/index.html",							// 15
"samerica/index.html",						// 16
"europe/2005/index.html",					// 17
"australia/2007/index.html"					// 18
)			

// list the buttons
arButtons = new Array(
null,
"territory",		// 1
"logo-tt", 			// 2
"mail-tt",			// 3
"",					// 4
"s-atl-can",		// 5
"can-roc",			// 6
"s-rockies",		// 7
"ne",				// 8
"midsouth",			// 9
"bear",				// 10
"hawaii",			// 11
"orca",				// 12

"acropolis",		// 15
"canal",			// 13
"china",			// 14
"parrots",			// 15
"gondola",			// 16
"kangaroo"			// 17
)		


// list the button text
arText = new Array(
null, 
"Tylers'<br>Territory",	// 1
"Tylers'<br>Travels",	// 2
"E-Mail<br>Link",		// 3
"",
"Atlantic<br>Canada",	// 5
"Canadian<br>Rockies",	// 6
"Southern<br>Rockies",	// 7
"New<br>England",		// 8
"Mid<br>South",			// 9
"Alaska<br>Yukon",		// 10
"Hawaii<br>San Diego",	// 11
"Vancouver<br>Island",  // 12

"Turkey<br>Greece",		// 13
"Panama<br>Canal",		// 14
"China<br>Tour",		// 15
"S America<br>Antarctica",	// 16
"Passage<br>to Venice",		// 17
"Australia<br> &amp; Pacific" // 18

)			

// controls function calls & data
function doNavBtns(txtColor, fface, btnOff, btnOv, btnDn, barColor){
	imBar = imBar + barColor;
	btnUp = "sphere-" + btnOff;
	btnOver = "sphere-" + btnOv;
	btnDown = "sphere-" + btnDn;
	//initBtns(btnOver, btnDown);
	// makeTitle("The Beijing Menu Page Navigator", 100, 3, txtColor, fface);
	//makeButs("ball", 1, 3, btnUp, btnOver, btnDown);
	drawBar(3, 125, 3);
}

// ********************************************* Page Navigator ****************
// call & send data for bottom bar
function bottom_bar(dummy){
	drawBar(3, 75, 3);
}


function movr(){this.img.src = this.img.overSrc}
function mout(){this.img.src = this.img.outSrc}
function mdown(){this.img.src = this.img.downSrc}

function makeButs(pos, start, end, btnUp, btnOver, btnDown){
	lr = btnUp;
	document.write("<P ALIGN=center>") // align the images 
	if (end<=arPages.length) {
	for (i=start; i<= end; i++){
		if (i==curPage) lr = "ani-globe";
		imstr = "<IMG SRC='"+ pgbtnPre + lr + ".gif' WIDTH=30 HEIGHT=30 BORDER=0>";
		if (i==curPage) {document.write(imstr); lr=btnUp; continue}
		document.write(imstr.link(arPages[i]));
		if(!browserOK) continue;
		tLink =	document.links[document.links.length-1];
		tImg = tLink.img = document.images[document.images.length-1];
		tImg.outSrc = tImg.src;
		tImg.downSrc = pgbtnPre + btnDown + ".gif";	// down
		tImg.overSrc = pgbtnPre + btnOver + ".gif";	// over
		tLink.onmouseover = movr;
		tLink.onmouseout = tLink.onmouseup = mout;
		tLink.onmousedown = mdown;
	}
	document.write("</P>");
}}



function makeTitle(txt, len, hi, txtColor, fface){
	document.write("<P ALIGN='center'>") // align the title line
	document.write("<img src='" + imBar + ".gif' width='" + len + "' height='" + hi + "' align='middle' border='0'>");
	document.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
	 document.write("<font face='" + fface + "' color=" + txtColor + " size='4'><b><i>" + txt + "</i></b> </font>"); 
	document.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
	document.write("<img src='" + imBar + ".gif' width='" + len + "' height='" + hi + "' align='middle' border='0'>");
	document.write("</P>");
	}
	
function drawBar(num, len, hi){
	document.write("<P ALIGN='center'>") // align the bar
	for (i=1;i<=num;i++){
		document.write("<img src='" + imBar + ".gif' width='" + len + "' height='" + hi + "' align='middle' border='0'>")
	}
	document.write("</P>");
	}
	
// *********************************************  Section  Buttons
function button_loader(txtColor, fface){
makeTitle("International Trips &amp; Tours", 100, 3, txtColor, fface);
loadButs(13, 18, txtColor, fface);
makeTitle("North American Trips &amp; Tours", 100, 3, txtColor, fface);
loadButs(5, 12, txtColor, fface);
makeTitle("Tylers' Territory Site Navigation", 100, 3, txtColor, fface);
loadButs(1, 3, txtColor, fface);

drawBar(3, 75, 3);
}

function loadButs(start, end, txtColor, fface){
	
	document.write("<P ALIGN='center'>"); // align the images 
	document.write("<table><tr>"); // start the table 
	if (end<=arButtons.length) {
	for (i=start; i<=end;i++){
		document.write("<td align='center' valign='top'>"); // table data
				
		imStr = "<IMG SRC='"+ btnPre + arButtons[i] + "-off.jpg'"
		imStr = imStr + "WIDTH=72 HEIGHT=96 BORDER=0></a><br>";
		txStr = "<font face='" + fface + "' size='3' color=" + txtColor + ">" + arText[i] + "</font></td>";
		//document.write(anchStr);
		document.write(imStr.link(arUrls[i]));
		document.write(txStr);
		//document.write(imStr.link(arUrls[i]));
		if(!browserOK) continue;
		// added 
	
		tLink =	document.links[document.links.length-1];
		tImg = tLink.img = document.images[document.images.length-1];
		tImg.outSrc = tImg.src;
		tImg.downSrc = btnPre + arButtons[i] + "-dn.jpg";	// down
		tImg.overSrc = btnPre + arButtons[i] + "-ov.jpg";	// over
		if ( i > 0 && i < 25 ) { tLink.target = "_blank";} 
		tLink.onmouseover = movr;
		tLink.onmouseout = tLink.onmouseup = mout;
		tLink.onmousedown = mdown;
		 // end added
		
	}}
	document.write("</tr></table>");
	document.write("</P>");
}

