/*
mymenu.js 2002-03-04

Contributor(s): Netscape Communications, Copyright 1997-2002
                Mark Filanowicz, Amdahl IT Services, Copyright 2002

Netscape grants you a royalty free license to use, modify or 
distribute this software provided that this copyright notice 
appears on all copies.  This software is provided "AS IS," 
without a warranty of any kind.

*/

// added following array by Mark Filanowicz on 2-22-2002 
var xbcl_MenuList = new Array();		// array of Menu List strs

function colorize(id) 
{
	var i;
	
	if (this.visible) 
	{
		if (this.bgColor != "#EEEEEE") 
		{
			this.bgColor = "#EEEEEE";
			this.needsUpdate = true;
		}

		for (i = 0; i < document.lists.length; i++) 
		{
			document.lists[i].touch = true;
			if (i != id) 
			{
				if (document.lists[i].bgColor != "#CCCCCC") 
				{
					document.lists[i].bgColor = "#CCCCCC";
					document.lists[i].needsUpdate = true;
				}
			}
		}
	}
	
	var p = this;
	while (p != null) 
	{
		p.touch = false;
		p = p.parentList; 
	}
	
	for (i = 0; i < document.lists.length; i++)
		if (document.lists[i].touch && document.lists[i].visible)
      xbcl_expand(document.lists[i].id);
}

// function added by Mark Filanowicz 02-22-2002
function ExpandMenu(str) 
{
// finds the list index pointer based on the menu text

  var i;
  var parents = new Array();		//  list of parents, to be built when we want to expand a submenu

  for ( i = 0; i < xbcl_MenuList.length; i++ )
  {
		if ( xbcl_MenuList[i] == str )
		{
			while (i > 0)
			{
				parents[parents.length] = i;	// push parent onto stack
				i = document.lists[i].parentList.id;			// get next higher parent
			}
			// expand the highest parent menu first, then the requested submenu
			while (parents.length > 0)
			{
				i = parents[parents.length-1];
				if (!document.lists[i].visible)
				{
					xbcl_expand(i);			// expand the highest parent menu left in stack
				}
				parents.length--;		// remove this parent from stack
			}
			return;
		}
  }
}


// added str argument by Mark Filanowicz 02-22-2002
function init(str) 
{
	var width = 161;
	var height = 22;
	var bgColor = "#CCCCCC";

	var l = new List(true, width, height, bgColor);
	xbcl_MenuList[xbcl_MenuList.length]="Main Menu";	// placeholder, not used
	
	l.setFont("<FONT FACE='Arial,Helvetica' SIZE=-1'><B>","</B></FONT>");
	
	var m = new List(false, width, height, bgColor);
// added next line, Mark Filanowicz 02-22-2002	
	xbcl_MenuList[xbcl_MenuList.length]="Learn Guitar";		// must be in same order as new Lists defined
	
	var x = new List(false, width, height, bgColor);
// added next line, Mark Filanowicz 02-22-2002	
	xbcl_MenuList[xbcl_MenuList.length]="Learn Guitar";		// must be in same order as new Lists defined
	l.addItem("<a href = 'index.html' style = 'text-decoration:none'> Home</a>");
	
	
	l.addItem("<a href = 'AllMusicLessons.html' style = 'text-decoration:none'> Music Lessons</a>");
	l.addItem("<a href = 'MusicArticles.html' style = 'text-decoration:none'> Guitar Articles</a>");
	l.addItem("<a href = 'GuitarEffects.html' style = 'text-decoration:none'> Guitar Effects </a>");
	
	x.addItem("<a href = 'ElectricGuitarLessons.html' style = 'text-decoration:none'> Rock/Blues/acoustic</a>");
	x.addItem("<a href = 'FlamencoGuitarTechniques.html' style = 'text-decoration:none'> Flamenco Guitar</a>");
	l.addList(x,"Guitar Lessons" );
	
	l.addItem("<a href = 'PianoLessons.html' style = 'text-decoration:none'> Piano Lessons </a>");
	l.addItem("<a href = 'MusicProducer.html' style = 'text-decoration:none'> Music Producers </a>");
	l.addItem("<a href = 'MusicBlues.html' style = 'text-decoration:none'> Music CD's </a>");
//	l.addList(m, "Guitar Resources");
//		l.addList(m, "Learn Guitar ");
	
	var p = new List(false, width, height, bgColor);
// added next line, Mark Filanowicz 02-22-2002	
	xbcl_MenuList[xbcl_MenuList.length]="Guitar Lessons";		// must be in same order as new Lists defined
	
	p.setFont("<FONT FACE='Arial,Helvetica' SIZE=-1'>","<\/FONT>");
	p.onexpand = colorize;
	//p.addItem("<a href = 'http://www.guitartips.com' style = 'text-decoration:none' target='_blank'> guitartips</a>");
	p.addItem("<a href = 'JamPlay.html' style = 'text-decoration:none'> JamPlay</a>");
	p.addItem("<a href = 'Jamorama.html' style = 'text-decoration:none'> Jamorama</a>");
	p.addItem("<a href = 'sheetmusicplus.html' style = 'text-decoration:none'> sheetmusicplus</a>");
	p.addItem("<a href = 'GuitarLeadsAndLicks.html' style = 'text-decoration:none'> GuitarTips</a>");	
	p.addItem("<a href = 'infiniteguitar.html' style = 'text-decoration:none'> infiniteguitar</a>");
	p.addItem("<a href = 'HeavyMetalGuitar.html' style = 'text-decoration:none'> HeavyGuitar</a>");
	p.addItem("<a href = 'AmazingGuitarSecrets.html' style = 'text-decoration:none'> AmazingGuitarSecrets.com </a>");
	p.addItem("<a href = 'LeadGuitar.html' style = 'text-decoration:none'> Guitar-Leads </a>");
	p.addItem("<a href = 'DreamsSounds4Guitar.html' style = 'text-decoration:none'> dreamsounds4guitar.com </a>");
	p.addItem("<a href = 'PlayPianoTips.html' style = 'text-decoration:none'> playpianotips </a>");
	l.addList(p,"Guitar Shortcuts ");
	
	var a = new List(false, width, height, bgColor);
// added next line, Mark Filanowicz 02-22-2002	
	xbcl_MenuList[xbcl_MenuList.length]="Piano Resources";		// must be in same order as new Lists defined
	a.setFont("<FONT FACE='Arial,Helvetica' SIZE=-1'>","<\/FONT>");
	a.onexpand = colorize;
	//piano.addItem("<a href = 'http://www.guitartips.com' style = 'text-decoration:none' target='_blank'> guitartips</a>");
	
	a.addItem("<a href = 'PlayPianoTips.html' style = 'text-decoration:none'> playpianotips </a>");
	l.addList(a,"Piano Shortcuts ");
	//l.addItem("<a href = 'seoPartners.php' style = 'text-decoration:none'> SEO Partners </a>");




	
	var x=0;
	var y=300;
	var NS4=(document.layers) ? true : false;
//	var NS6=false;
	var NS6=(document.getElementById)?true:false;
	var NS7=false;
	
if (document.getElementById && document.body.style){
  NS7 = true; 
  NS6 = false;
}
	
//if (navigator.userAgent.indexOf('Netscape6') != -1)     
//{
//  NS6 = true; // Netscape 6 code
//}	
//if (navigator.userAgent.indexOf('Netscape/7') != -1)     
//{
//  NS7 = true; // Netscape 7 code
//}	
	
	
	var IE4=(document.all)?true:false;
	var ver4 = (NS4 || IE4 || NS6) ? true : false;
	
	if(NS4) {
//	  alert("NS4");
	  x = document.anchors.leftmenu.x;
	  y = document.anchors.leftmenu.y;
	} else if (IE4) {

//	  alert("IE4");
	  var myEl = document.getElementById('leftmenu');
	  var oBndRct=myEl.getBoundingClientRect();
    // modification from Mark 3/11/02 to add Scroll positions
    x = oBndRct.left + xbGetPageScrollX(); // leave room if we've scrolled right
    y = oBndRct.top  + xbGetPageScrollY(); // leave room if we've scrolled down
	  if (x>10) x=x-2;	  // a little extra room if we can
	} else if (NS7) {
	
//	  alert("NS7");
	  var myEl = document.getElementById('leftmenu');
	  x = myEl.offsetLeft;
	  y = myEl.offsetTop;

		x = x;


//	  y = myEl.offsetHeight;
	  if (x>15) x=x-8;	  // a little extra room if we can

	} else if (NS6) {

//	  alert("NS6");
	  var myEl = document.getElementById('leftmenu');
	  x = myEl.offsetLeft;
	  y = myEl.offsetTop;
	  if (x>15) x=x-8;	  // a little extra room if we can
	}
	
	l.build(x, y);
	if (str) {
	ExpandMenu(str);		
	}
	
	
}

function redo()
{	
  document.location.reload();
}
/*
function init()
{	
  var width = 150, height=20;
  MusicList= new List(true,width,height, "#ffffff");
  MusicList.addItem("<a href = 'LearnGuitarChords.html' style = 'text-decoration:none'>  Guitar Chords</a>");	
  MusicList.build(30,150);

}
*/

// -->
