
var xcNode = []; 

function leftNav(currentID,highlight) {
	if (document.getElementById && document.createElement) {


		// 'curr' is the currently highlighted <span>
		var curr = document.getElementById(currentID);

		// UNLESS the second parameter is set to 'none'
		if (highlight != 'none'){
			// Set arrow & bold for 'curr'
			curr.className = "currentSection";
			// Strip the link for 'curr'
			curr.firstChild.removeAttribute('href');
		}

		// LI's:	p,  ggp,  ggggp, &  ggggggp
		// UL's:	gp, gggp, gggggp, & gggggggp
		var p = curr.parentNode;//<LI>
		var gp = p.parentNode;    // <UL>
		var ggp = gp.parentNode;  // <LI>
		var gggp = ggp.parentNode;   // <UL>
		var ggggp = gggp.parentNode; // <LI>
		var gggggp = ggggp.parentNode;   // <UL>
		var ggggggp = gggggp.parentNode; // <LI>
		var gggggggp = ggggggp.parentNode;   // <UL>

		// 'child' is the UL nested inside the current span
		var child = p.childNodes[2];
		// display c, if it exists
		if ((child) && (child.TagName = 'UL')) {child.style.display = 'block'}

		// display the ancestors' UL's
		if (gp.TagName = 'UL') {gp.style.display = 'block'}
		if (gggp.TagName = 'UL') {gggp.style.display = 'block'}
		if (gggggp.TagName = 'UL') {gggggp.style.display = 'block'}
		if (gggggggp.TagName = 'UL') {gggggggp.style.display = 'block'}

		//alert(ggggp.tagName);
		//alert (p.firstChild.TagName);
		// If the parent is an <LI>, bold the <SPAN> inside it.
		if (p.TagName = 'LI') {p.firstChild.style.fontWeight = 'bold'}
		if (ggp.TagName = 'LI') {ggp.firstChild.style.fontWeight = 'bold'}
		if ((ggggp.tagName != 'DIV') && (ggggp.TagName = 'LI')) {ggggp.firstChild.style.fontWeight = 'bold'}
	}
}



//		gggp.style.fontWeight = 'bold';
//		gggggp.style.fontWeight = 'bold';
//		var ggggggp = ggggp.parentNode.parentNode;
//		ggggggp.style.fontWeight = 'bold';

//		if (et = 'UL') { 
//			gp is e's grandparent
//			gp.style.display = 'block';
//			var gpt = gp.tagName;
//			ggp is e's great-grandparent
//			gggp.style.display = 'block';
//			var ggpt = ggp.tagName;
//		} else if (et = 'LI') { 
//			p.style.display = 'block';
//			var pt = p.tagName;
//			var gp = gp.parentNode.parentNode;
//			ggp.style.display = 'block';
//			var ggpt = ggp.tagName;
//		}

//			alert(gp.id);

//			while (gpt == 'UL' ){
//				alert('toast');
//				gpt = gpt + '.parentNode.parentNode'
//				alert(gpt);
//			}
/*			if (p.tagName == 'UL'){
				p.style.display = 'block';
			}
			if (p.parentNode.parentNode.tagName == 'UL'){
				p.parentNode.parentNode.style.display = 'block';
			}*/

/*	if (document.getElementById && document.createElement) { 
		m = document.getElementById(m).getElementsByTagName('ul'); 
		alert('there are ' + m.length + 'ul\'s under m.');
		var d, p, x, h, i, j;
		for (i = 0; i < m.length; i++) { 
			alert(m); 
			if (d = m[i].getAttribute('id')) { 
				xcCtrl(d, c, 'x', 'Show', m[i].getAttribute('title')+' (expand menu)'); 
				x = xcCtrl(d, c, 'c', 'Hide', m[i].getAttribute('title')+' (collapse menu)'); 
//alert('frodo lives!');
				p = m[i].parentNode; 
				if (h = !p.className) { 
					j = 2; 
					while ((h = !(d == arguments[j])) && (j++ < arguments.length)); 
					if (h) { 
						m[i].style.display = 'none'; 
						x = xcNode[d+'x']; 
					}
				}
				p.className = c; 
				p.insertBefore(x, p.firstChild); 
			}
		}
	}
}
*/

/*
function xcShow(m) { 
	xcXC(m, 'block', m+'c', m+'x'); 
} 

function xcHide(m) { 
	xcXC(m, 'none', m+'x', m+'c'); 
} 

function xcXC(e, d, s, h) { 
	e = document.getElementById(e); 
	e.style.display = d; 
	e.parentNode.replaceChild(xcNode[s], xcNode[h]); 
	xcNode[s].firstChild.focus(); 
} 

function xcCtrl(m, c, s, f, t) { 
	var a = document.createElement('a'); 
//	a.setAttribute('href', 'javascript:xc'+f+'(\''+m+'\');'); 
//	a.setAttribute('title', t); 
//	a.appendChild(document.createTextNode('v')); 
	var d = document.createElement('div'); 
	d.className = c+s; 
	d.appendChild(a); 
	return xcNode[m+s] = d; 
}

//	alert(document.getElementById(a));
*/ 

