// Supports the Navigation Bar

// variables
var loadOK = false;

var Contact_n = new Image();		var Contact_s = new Image();
var Guestbook_n = new Image();	var Guestbook_s = new Image();

var fileToLoad = new Array;		// holds filenames to load into mainframe
	fileToLoad["contact"] = "../contact/contact.php";
	fileToLoad["guestbook"] = "../guestbook/guestbook.php";
// End of variables

// Class MenuItem
function MenuItem(normal, selected) // constructor
{
  // properties
  this.normal = normal;
  this.selected = selected;

  // methods
  this.Change = Change;
}	// End constructor

function Change(name, select)
{
  if (select) document.images[name].src = this.selected.src;
  else document.images[name].src = this.normal.src;
}
// End Class MenuItem

// functions
function InitMenu()
{
  Contact = new MenuItem(Contact_n, Contact_s);
  Guestbook =	new MenuItem(Guestbook_n, Guestbook_s);

  loadOK = true;
}

function loadPage(page)	// loads file into mainframe activates counter
{
	parent.frames["counter"].location.href = "../counter/counter.php?page=" + page + "&source=nav";
	parent.frames["main"].location.href = fileToLoad[page];
}
// End of functions

// preload pics
Contact_n.src = "normal/contact.png";			Contact_s.src = "over/contact.png";
Guestbook_n.src = "normal/guestbook.png";	Guestbook_s.src = "over/guestbook.png";
// End preload pics

// End of File