// If you want to add a new category, it's easy. Just
// make a new entry in the list below. The entries in
// the list are in left-to-right order. The first element
// of each entry is the name of the HTML file, the second
// element is a unique name for the menu entry, the third
// element is the highlighted name, and the fourth element
// is the nonhighlighted name. Make sure that the <head>
// contains
// <SCRIPT type="text/javascript" src="js/site.js">
// and the <BODY> contains
// <script type="text/javascript">generateTopMenu("...")</script>
// at the place where you want the menu bar. You should replace ...
// with the name of the file you're in; when
// the menu is inserted, the entry in the list below won't
// ever be unhighlighted. 

var MENU_ENTRIES = 
  [
    ["index.html", "menu1", "images/homenew1_on.gif", "images/homenew1_off.gif"],
    ["gigs.html", "menu2", "images/gigsnew1_on.gif", "images/gigsnew1_off.gif"],
    ["lesson.html", "menu3", "images/lessons1_on.gif", "images/lessons1_off.gif"],
    ["jazz.html", "menu4", "images/cd1_on.gif", "images/cd1_off.gif"],
    ["links.html", "menu5", "images/links1_on.gif", "images/links1_off.gif"],
    ["photos.html", "menu6", "images/photos1_on.gif", "images/photos1_off.gif"]
  ];

//
// Don't touch anything after here.
//

function generateTopMenu(fName) {
  document.write("<div class='topMenuContainer'><div class='topMenu'>\n");
  for (var i = 0; i < MENU_ENTRIES.length; i++) {
    var thisFile = MENU_ENTRIES[i][0];
    var thisName = MENU_ENTRIES[i][1]
    var onLink = MENU_ENTRIES[i][2];
    var offLink = MENU_ENTRIES[i][3];
    if (thisFile == fName) {
      document.write("<span class='menuItem'><a href='"+thisFile+"'><img src='"+onLink+"' name='"+thisName+"'></a></span>");
    } else {
      document.write("<span class='menuItem'><a href='"+thisFile+"' onmouseover='img_act(\""+thisName+"\")' onmouseout='img_inact(\""+thisName+"\")'><img src='"+offLink+"' name='"+thisName+"'></a></span>");
    }
  }
  document.write("</div></div>");
}

var MENU_HASH = null;

function hashMenuItems() {
  MENU_HASH = {};
  for (var i = 0; i < MENU_ENTRIES.length; i++) {
    MENU_HASH[MENU_ENTRIES[i][1]] = [MENU_ENTRIES[i][2], MENU_ENTRIES[i][3]];
  }
}

function img_act(thisName) {
  if (MENU_HASH === null) {
    hashMenuItems();
  }
  document[thisName].src = MENU_HASH[thisName][0];
}

function img_inact(thisName) {
  if (MENU_HASH === null) {
    hashMenuItems();
  }
  document[thisName].src = MENU_HASH[thisName][1];
}

// If you want to embed some music, here's what to do. 
// Just add a Javascript call like this:
// <script>insertAudioPlayer("<path>");</script>
// where <path> is the location of your mp3.

function insertAudioPlayer(path) {
  // Put it right here.
  document.write('<object type="application/x-shockwave-flash" data="/js/player_mp3_maxi.swf" width="25" height="20">\n' +
		 '<param name="movie" value="/js/player_mp3_maxi.swf" />\n' +
		 '<param name="bgcolor" value="#ffffff" />\n' +
		 '<param name="FlashVars" value="mp3=' + path + '&amp;width=25&amp;showslider=0" />\n</object>\n');
}

