//buttons.js adapted for athens site

// balls.js for ephesus site
NS4 = (document.layers);
IE4 = (document.all);
ver4 = (NS4 || IE4);
browserOK = document.images;
isMac = (navigator.appVersion.indexOf("Mac") != -1);


// list the pages
arPages = new Array(
null,
"athens-01.html",		//1
"athens-02.html",		//2
"athens-03.html",		//3
"athens-04.html",		//4
"athens-05.html",		//5
"athens-05-1.html",		//6
"athens-06.html",		//7
"athens-07.html",		//8
"athens-08.html",		//9
"athens-09.html",		//10
"athens-10.html",		//11
"athens-11.html",		//12
"acropolis-01.html",	//13
"acropolis-02.html",	//14
"acropolis-03.html",	//15
"acropolis-04.html",   	//16
"acropolis-05.html", 	//17
"acropolis-06.html", 	//18
"acropolis-07.html",	//19
"acropolis-08.html",	//20
"acropolis-09.html") 	//21


// locate the image files
impre = "../../buttons/ball_"

// name the images for the button states
if (document.images) {
arImLoadB = new Array (
impre+"left_over",
impre+"left_down");
arImListB = new Array ();
for (counter in arImLoadB) {
arImListB[counter] = new Image();
arImListB[counter].src = arImLoadB[counter] + ".gif";
}}

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){
	lr = "left";
	document.write("<P ALIGN=center>") // align the images 
	for (i=1;i<arPages.length;i++){
		if (i==curPage) lr = "center";
		imstr = "<IMG SRC='"+ impre + lr + ".gif' WIDTH=30 HEIGHT=30 BORDER=0>";
		if (i==curPage) {document.write(imstr);lr="left";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 = impre + lr + "_down.gif";
		tImg.overSrc = impre + lr + "_over.gif";
		tLink.onmouseover = movr;
		tLink.onmouseout = tLink.onmouseup = mout;
		tLink.onmousedown = mdown;
	}
	document.write("</P>");
}

imBar = "../../images/bar-blue-green";

function makeTitle(txt, len, hi){
	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='arial' 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>");
	}



// locate the image files
btnPre = "../../buttons/btn-"


// list the urls
arUrls = new Array(
null,
"athens-01.html",							// 1
"acropolis_restoration.html",				// 2
"acropolis-01.html",						//  *** 3 ***
"../../turkey/istanbul/istanbul-01.html",	// 4
"../../turkey/ephesus/ephesus-01.html",		// 5				
"../rhodes/rhodes-01.html",					// 6	
"../santorini/santorini-01.html",			// 7
"../delos/delos-01.html",					// 8
"../delphi/delphi-01.html",					// *** 9 ***	
"../../ancientworld.html",			// 10
"../aegean/map-aegean.html",				// 11
"../../../index.html" )						// *** 12 ***


// list the buttons
arButtons = new Array(
null,
"athens",					// 1
"acropolis-restoration", 	// 2
"athens-acropolis",			// ***3 ***
"istanbul",					// 4
"ephesus", 					// 5
"rhodes",					// 6
"santorini",				// 7
"delos",					// 8
"delphi",					// 9
"ancientworld",				//10
"map-aegean",				// 11
"world-s" )					// 12


// list the button text
arText = new Array(
null, 
"Athens<br>Home",			// 1
"Acropolis<br>Restoration",	// 2
"Athens<br>Acropolis",		// *** 3 ***
"Ancient<br>Istanbul",		// 4
"Ancient<br>Ephesus",		// 5
"Isle of<br>Rhodes",		// 6
"Island of<br>Santorini",	// 7
"Island of<br>Delos",		// 8
"Delphi<br>",				// *** 9 ***
"Ancient<br>World",			// 10
"Tour<br>Map",				// 11
"Home<br>Page" )			// *** 12 ***


function loadButs(start, end, pos){
	
	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
		anchStr = "<a href='"+ arUrls[i] + "' ";
		if (i == 2 || i == 11) { anchStr = anchStr + "target='_blank'";} 
		anchStr = anchStr + ">";
		imStr = "<IMG SRC='"+ btnPre + arButtons[i] + ".jpg' WIDTH=72 HEIGHT=42 BORDER=0></a><br>";
		txStr = "<font face='arial' size='2'><b><i>" + arText[i] + "</i></b></font></td>";
		document.write(anchStr);
		document.write(imStr);
		document.write(txStr);
		if(!browserOK) continue;
		
	}}
	document.write("</tr></table>");
	document.write("</P>");
}



