// ##LOG: 
// -----------------------------------------------------------------------------------------------
//	07/11/06	iain f	Created.
// -----------------------------------------------------------------------------------------------
// ##TEMPLATE: 
// -----------------------------------------------------------------------------------------------
// Steps though unordered lists with the ID of "siteMap"
// and attributes the "last" class to the last li item on each UL in siteMap.
// Used for applying the "End Node" image on sitemap trees
// -----------------------------------------------------------------------------------------------



window.onload = function () 
{ 
	var tree = document.getElementById("siteMap"); 
	var lists = [ tree ]; 
	for (var i = 0; i < tree.getElementsByTagName("ul").length; i++)
	{
		lists[lists.length] = tree.getElementsByTagName("ul")[i]; 
	}
	
	for (var i = 0; i < lists.length; i++) 
	{ 
		var item = lists[i].lastChild;
		while (!item.tagName || item.tagName.toLowerCase() != "li")
			item = item.previousSibling;
			item.className += " last";
	} 
  }; 