/*
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]="Membership";		// must be in same order as new Lists defined
	
	m.setFont("<FONT FACE='Arial,Helvetica' SIZE=-1'>","<\/FONT>");
	m.onexpand = colorize;
	m.addItem("Join Now");
	m.addItem("Access Benefits");
	m.addItem("Benefits at a Glance");
	m.addItem("Membership Services");
	m.addItem("Contact Us");
	m.addItem("FAQs");
	l.addList(m, "Membership");

	var o = new List(false, width, height, bgColor);
	xbcl_MenuList[xbcl_MenuList.length]="Open Studio";		
	o.onexpand = colorize;
	o.setFont("<FONT FACE='Arial,Helvetica' SIZE=-1'>","<\/FONT>");
	o.addItem("Site Showcase");
	o.addItem("HTML & Web Design");
	o.addItem("Scripting");
	o.addItem("Membership");
	o.addItem("Partner Technologies");
	l.addList(o, "Open Studio");

	var d = new List(false, width, height, "#EEEEEE");
	xbcl_MenuList[xbcl_MenuList.length]="Documentation";		// must be in same order as new Lists defined
	
	d.onexpand = colorize;
	d.setFont("<FONT FACE='Arial,Helvetica' SIZE=-1'>","<\/FONT>");
	d.addItem("Technical Manuals");
	d.addItem("Sample Code");
	d.addItem("White Papers");

	var techNote = new List(false, width, height, bgColor);
	xbcl_MenuList[xbcl_MenuList.length]="TechNotes";		// must be in same order as new Lists defined
	techNote.onexpand = colorize;
	techNote.setFont("<FONT FACE='Arial,Helvetica' SIZE=-1'>","<\/FONT>");
	techNote.addItem("DHTML Buzzword Bingo");
	techNote.addItem("JS DHTML Utilities");
	techNote.addItem("JS DHTML Toolbars");
	techNote.addItem("Drifting Layers");
	techNote.addItem("JS DHTML Collapsible Lists");
	d.addList(techNote, "TechNotes");
	d.addItem("Articles");
	d.addItem("Books");
	d.addItem("Presentations");
	l.addList(d, "Documentation");

	var t = new List(false, width, height, bgColor);
	xbcl_MenuList[xbcl_MenuList.length]="Technologies";		// must be in same order as new Lists defined
	t.onexpand = colorize;
	t.setFont("<FONT FACE='Arial,Helvetica' SIZE=-1'>","<\/FONT>");
	t.addItem("Components");
	t.addItem("CORBA/IIOP");
	t.addItem("Dynamic HTML");
	t.addItem("Java");
	t.addItem("JavaScript");
	t.addItem("Directories and LDAP");
	t.addItem("XML and Metadata");
	t.addItem("Security");
	l.addList(t, "Technologies");

	var s = new List(false, width, height, bgColor);
	xbcl_MenuList[xbcl_MenuList.length]="Support & Newsgroups";		// must be in same order as new Lists defined
	s.onexpand = colorize;
	s.setFont("<FONT FACE='Arial,Helvetica' SIZE=-1'>","<\/FONT>");
	s.addItem("Search Newsgroups");
	s.addItem("DevEdge Newsgroups");
	s.addItem("FAQs");
	s.addItem("Known Bugs");
	s.addItem("One-to-One Development Support");
	s.addItem("Courses");
	s.addItem("How to Get Answers");
	l.addList(s, "Support & Newsgroups");
	l.addItem("View Source Magazine");
	l.addItem("Communicator Source Code");
	l.addItem("Co-Marketing");
	l.addItem("Products & Downloads");
	
	
	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();
}
// -->

