function buildLinks(oname, oaddress, odirectory) {
  this.name = oname;
  this.address = oaddress;
	this.directory = odirectory;
}

links = new Array();
links[0] = new buildLinks('home' , 'index.htm' , 'none');
links[1] = new buildLinks('courses' , 'courses.html' , 'none');
links[2] = new buildLinks('vita' , 'vita.html' , 'none');
links[3] = new buildLinks('schedule' , 'schedule.html' , 'none');
links[4] = new buildLinks('the story' , 'story.html' , 'story');
links[5] = new buildLinks('links' , 'links.html' , 'none');
links[6] = new buildLinks('bereft?' , 'bereft.html' , 'bereft');


var highLightColor = '#339933';
var buttonColor = '#0000ff';

var smileOn = "smiley.gif";
var smileOff ="frowny.gif";
var pointer ="smiley.gif";

//var smileOn = new Image; smileOn.src="smiley.gif";
//var smileOff =new Image; smileOff.src="frowny.gif";
//var pointer new Image; pointer.src="smiley.gif";



// FUNCTION TO HIGHLIGHT SELECTED DATE
function frown(omenu){
	document['img_menu'+omenu].src= smileOff
}

// FUNCTION TO REMOVE HIGHLIGHT FROM DE-SELECTED DATE
function smile(omenu){
 document['img_menu'+omenu].src= smileOn
}
//BEGIN FUNCTION WRITELINKS
function writeLinks() {
document.write('<table width="100%">');
for (i=0; i<links.length; i++) {
  if (currentDir==links[i].directory) {
	  for (j=0; j<links.length; j++) {
		  if (currentDir==links[j].directory) {
        document.write('<tr><td class="current_page"><img class="menu" src="' + pointer + '" alt="pointer" align="middle"> ' + links[j].name + '</td></tr>');
			}
			else {
			  document.write('<tr><td><a class="menu" href="../' + links[j].address + '" onMouseOver="frown(' + j +  ')" onMouseOut="smile('+j+')"><img class="menu" name="img_menu' + j +  '" src="' + smileOn + '" alt="smile" align="middle"> ' + links[j].name + '</a></td></tr>');
			}
		}
		//document.write('</table>');
    //document.write('<center><hr><img src="../' + currentDir + '.gif" alt="' + currentPageImage + '.gif"></center>');
		document.write('</table>');
		return;
	}
}

for (i=0; i<links.length; i++) {
	if (currentPage==links[i].address) {
	  document.write('<tr><td class="current_page"><img class="menu" src="' + pointer + '" alt="pointer" align="middle"> ' + links[i].name + '</td></tr>');
	}
	else {
	  document.write('<tr><td><a class="menu" href="' + links[i].address + '" onMouseOver="frown('+i+')" onMouseOut="smile('+i+')"><img class="menu" name="img_menu' + i +  '" src="' + smileOn + '" alt="smile" align="middle"> ' + links[i].name + '</a></td></tr>');
	}
}

document.write('</table>');
//document.write('<center><hr><img src="' + currentPageImage + '.gif" alt="' + currentPageImage + '.gif"></center>');
}
// END FUNTION WRITELINKS

function spanishLink() {
  currentPage_es = currentURL.substring(currentURL.lastIndexOf("/")+1,currentURL.lastIndexOf(".html"))+"_es.html";
	document.location = currentPage_es;
}


currentURL = document.URL;


// ONLINE USE "/" ON HARD DRIVE FOR IE USE "\\" -->
currentPage = currentURL.substring(currentURL.lastIndexOf("/")+1,currentURL.length);
currentPageImage = currentURL.substring(currentURL.lastIndexOf("/")+1,currentURL.lastIndexOf(".html"));
endPos = currentURL.lastIndexOf("/");
startPos = currentURL.lastIndexOf("/",endPos-1);
currentDir = currentURL.substring(startPos+1,endPos);

writeLinks();



