function funk_EnhanceProjectList()
{
	// Get all top-level projects:
	var projects = $$('ul.projects.root li.root div.root');
        if (projects.length < 1)
	{
		projects = $$('.subprojects_tree .head');
	}
	// Enhance each project branch:
	projects.each(
		function(t) {
			// NOTE: "t" is the root project's title DIV. Its parent is the <li> element, which
			// also contains the <ul> of all child projects.
			Element.insert(t, { top: '<a href="#" class="ellipsis"><span>[+]</span></a>' });
			var a = t.childElements().first();
			a && (a.onclick = funk_ToggleProjectChildren);
			// "Collapse" the project, by default:
			Element.addClassName(t.parentNode, 'hide_child_projects');
		}
	);
}

function funk_ToggleProjectChildren()
{
	var n = this.parentNode && this.parentNode.parentNode;
	if (!n)
	{
		return false;
	}
	if (n.className.match(/\bhide_child_projects\b/))
	{
		Element.removeClassName(n, 'hide_child_projects')
		new Effect.Highlight(n, {});
	}
	else
	{
		Element.addClassName(n, 'hide_child_projects')
	}
	return false;
}

