// 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 != "#ffffff") 
		{
			this.bgColor = "#ffffff";
			this.needsUpdate = true;
		}

		for (i = 0; i < document.lists.length; i++) 
		{
			document.lists[i].touch = true;
			if (i != id) 
			{
				if (document.lists[i].bgColor != "#ffffff") 
				{
					document.lists[i].bgColor = "#ffffff";
					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)
				{
					pageload_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 = 160;
	var height = 22;
	var bgColor = "#E9E7E4";

	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]="About Us";		// must be in same order as new Lists defined
	
	m.setFont("<FONT FACE='Arial,Helvetica' SIZE=-1' >","<\/FONT>");
	m.onexpand = colorize;
	m.addItem("<div class='menuitem'><a class='menuitem' href='../aboutus/notefromdrury.htm'>A Note from Bing Teng</a></div>");
	m.addItem("<div class='menuitem'><a class='menuitem' href='../aboutus/pprnet.htm'>PP Research Network</a></div>");
	m.addItem("<div class='menuitem'><a class='menuitem' href='../aboutus/awards.htm'>Awards</a></div>");
	m.addItem("<div class='menuitem'><a class='menuitem' href='../aboutus/careers.htm'>Careers</a></div>");
	m.addItem("<div class='menuitem'><a class='menuitem' href='../aboutus/privacypolicy.htm'>Privacy Policy</a></div>");
	l.addList(m, "About Us");

	var o = new List(false, width, height, bgColor);
	xbcl_MenuList[xbcl_MenuList.length]="News";		
	o.onexpand = colorize;
	o.setFont("<FONT FACE='Arial,Helvetica' SIZE=-1'>","<\/FONT>");
	o.addItem("<div class='menuitem'><a class='menuitem' href='../news/pressreleases.htm'>Press Releases</a></div>");
	o.addItem("<div class='menuitem'><a class='menuitem' href='../news/articles.htm'>Articles</a></div>");
	o.addItem("<div class='menuitem'><a class='menuitem' href='../news/tradeshows.htm'>Trade Shows</a></div>");
	l.addList(o, "News");

	var d = new List(false, width, height, "#EEEEEE");
	xbcl_MenuList[xbcl_MenuList.length]="Products";		// must be in same order as new Lists defined
	
	d.onexpand = colorize;
	d.setIndent(10);
	d.setFont("<div class='submenutitles'>","<\/div>");
	
	var Suite = new List(false, width, height, bgColor);
	xbcl_MenuList[xbcl_MenuList.length]="Total Practice Partner";		// must be in same order as new Lists defined
	Suite.onexpand = colorize;
	Suite.setFont("<FONT FACE='Arial,Helvetica' SIZE=-1'>","<\/FONT>");
	Suite.addItem("<div class='menuitem'><a class='menuitem' href='../tpp/totalpracticepartnerbenefits.htm'>Benefits</a></div>");
	Suite.addItem("<div class='menuitem'><a class='menuitem' href='../tpp/totalpracticepartnerfeatures.htm'>Features</a></div>");
	Suite.addItem("<div class='menuitem'><a class='menuitem' href='../tpp/technology.htm'>Technology</a></div>");
	Suite.addItem("<div class='menuitem'><a class='menuitem' href='../tpp/userprofiles.htm'>User Profiles</a></div>");
	d.addList(Suite, "Total Practice Partner");
	
	var PR = new List(false, width, height, bgColor);
	xbcl_MenuList[xbcl_MenuList.length]="Patient Records";		// must be in same order as new Lists defined
	PR.onexpand = colorize;
	PR.setFont("<FONT FACE='Arial,Helvetica' SIZE=-1'>","<\/FONT>");
	PR.addItem("<div class='menuitem'><a class='menuitem' href='../pr/whyanemr.htm'>Why an EMR?</a></div>");
	PR.addItem("<div class='menuitem'><a class='menuitem' href='../pr/patientrecordsbenefits.htm'>Benefits</a></div>");
	PR.addItem("<div class='menuitem'><a class='menuitem' href='../pr/patientrecordsfeatures.htm'>Features</a></div>");
	PR.addItem("<div class='menuitem'><a class='menuitem' href='../pr/technology.htm'>Technology</a></div>");
	PR.addItem("<div class='menuitem'><a class='menuitem' href='../pr/userprofiles.htm'>User Profiles</a></div>");
	d.addList(PR, "Patient Records");
	
	var MB = new List(false, width, height, bgColor);
	xbcl_MenuList[xbcl_MenuList.length]="Medical Billing";		// must be in same order as new Lists defined
	MB.onexpand = colorize;
	MB.setFont("<FONT FACE='Arial,Helvetica' SIZE=-1'>","<\/FONT>");
	MB.addItem("<div class='menuitem'><a class='menuitem' href='../mb/medicalbillingbenefits.htm'>Benefits</a></div>");
	MB.addItem("<div class='menuitem'><a class='menuitem' href='../mb/medicalbillingfeatures.htm'>Features</a></div>");
	MB.addItem("<div class='menuitem'><a class='menuitem' href='../mb/userprofiles.htm'>User Profiles</a></div>");
	d.addList(MB, "Medical Billing");

	var AS = new List(false, width, height, bgColor);
	xbcl_MenuList[xbcl_MenuList.length]="Appointment Scheduler";		// must be in same order as new Lists defined
	AS.onexpand = colorize;
	AS.setFont("<FONT FACE='Arial,Helvetica' SIZE=-1'>","<\/FONT>");
	AS.addItem("<div class='menuitem'><a class='menuitem' href='../as/appointmentschedulerbenefits.htm'>Benefits</a></div>");
	AS.addItem("<div class='menuitem'><a class='menuitem' href='../as/appointmentschedulerfeatures.htm'>Features</a></div>");
	AS.addItem("<div class='menuitem'><a class='menuitem' href='../as/technology.htm'>Technology</a></div>");
	AS.addItem("<div class='menuitem'><a class='menuitem' href='../as/userprofiles.htm'>User Profiles</a></div>");
	d.addList(AS, "Appointment Scheduler");
	
	
	
	var ASP = new List(false, width, height, bgColor);
	xbcl_MenuList[xbcl_MenuList.length]="ASP";		// must be in same order as new Lists defined
	ASP.onexpand = colorize;
	ASP.setFont("<FONT FACE='Arial,Helvetica' SIZE=-1'>","<\/FONT>");
	ASP.addItem("<div class='menuitem'><a class='menuitem' href='../asp/whyasp.htm'>Why an ASP?</a></div>");
	ASP.addItem("<div class='menuitem'><a class='menuitem' href='../asp/aspbenefits.htm'>Benefits</a></div>");
	ASP.addItem("<div class='menuitem'><a class='menuitem' href='../asp/aspfeatures.htm'>Features</a></div>");
	ASP.addItem("<div class='menuitem'><a class='menuitem' href='../asp/asptechnology.htm'>Technology</a></div>");
	d.addList(ASP, "ASP");

	var OE = new List(false, width, height, bgColor);
	xbcl_MenuList[xbcl_MenuList.length]="OE";		// must be in same order as new Lists defined
	OE.onexpand = colorize;
	OE.setFont("<FONT FACE='Arial,Helvetica' SIZE=-1'>","<\/FONT>");
	OE.addItem("<div class='menuitem'><a class='menuitem' href='../order_entry/orderentrybenefits.htm'>Benefits</a></div>");
	OE.addItem("<div class='menuitem'><a class='menuitem' href='../order_entry/orderentryfeatures.htm'>Features</a></div>");
	d.addList(OE, "Order Entry");
	
	
	l.addList(d, "Products");

	var P = new List(false, width, height, bgColor);
	xbcl_MenuList[xbcl_MenuList.length]="Partners";		
	P.onexpand = colorize;
	P.setFont("<FONT FACE='Arial,Helvetica' SIZE=-1'>","<\/FONT>");
	l.addList(P, "Partners");
	
	var C = new List(false, width, height, bgColor);
	xbcl_MenuList[xbcl_MenuList.length]="Contact Us";		
	C.onexpand = colorize;
	C.setFont("<FONT FACE='Arial,Helvetica' SIZE=-1'>","<\/FONT>");
	l.addList(C, "Contact Us");
	
		
	var x=0;
	var y=300;
	var NS4=(document.layers) ? true : false;
	var NS6=(document.getElementById)?true:false;
	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 (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);		
	}
	
	
}


// -->