//some magic to attach mouseover events to the articles link
window.onload = function() 
{ 
	//add listeners to navi_top; for displaying their subsection
	var oEl = document.getElementById("articles_titles");
	var nodes = oEl.childNodes;
	for (i = 0, l = nodes.length; i < l; i++) 
	{
		if ( (nodes[i].nodeName == "a") || (nodes[i].nodeName == "A") )
		{
			//getattribute fails for ms browsers; use className insetad (although getAttribute("id") works!)
			//if ( (nodes[i].getAttribute("class") == "title") || (nodes[i].getAttribute("class") == "title on") )
			if ( (nodes[i].className == "title") || (nodes[i].className == "title on") )
			{
				YAHOO.util.Event.addListener(nodes[i], "click", fnCallbackClick);
			}
		}
	}
}
function fnCallbackClick(E) 
{ //pre: infotext suffixed by '_t'
	var myid = this.getAttribute("id");
	var myinfo = document.getElementById(myid + "_t");
	if (myinfo)
	{ //clear all others
		clearAllArticles();
		myinfo.className = "article on";
		//also set my own classname to on
		this.className = "title on";
	}
}
function fnCallbackMouseOut(E) 
{ 
	var myid = this.getAttribute("id");
	var myinfo = document.getElementById(myid + "_descriptor");
	if (myinfo)
	{ //not cleared here; cleared when mouse over again; 
		//myinfo.style.display = "none";
		//to add: if have not mouseout from navi_descriptor (hittest??), then retain
		//else change to the page default (ie find the one with class "on")
	}
}
function clearAllArticles()
{
	var oEl = document.getElementById("articles_titles");
	var nodes = oEl.childNodes;
	var myid;
	var myinfo;
	
	for (i = 0, l = nodes.length; i < l; i++) 
	{
		if ( (nodes[i].nodeName == "a") || (nodes[i].nodeName == "A") )
		{
			//getAttribute fails for ms browsers; use className instead
			//if ( (nodes[i].getAttribute("class") == "title") || (nodes[i].getAttribute("class") == "title on") )
			if ( (nodes[i].className == "title") || (nodes[i].className == "title on") )
			{
				nodes[i].className = "title";
				//clear article text
				myid = nodes[i].getAttribute("id");
				myinfo = document.getElementById(myid + "_t");
				if (myinfo)
				{
					myinfo.className = "article";
				}
			}
		}
	}
}



