var enabledLinks = [];
function $(id)
{
	return document.getElementById(id);
}

function attachOpenFormEvents(ahref, id)
{
	if (ahref)
	{
		ahref.onclick = function(){toggleMe(id);};
	}
}

function hideAllOpenBoxes()
{
	for (var i=0, len=enabledLinks.length ; i<len ; i++)
	{
		showHide(enabledLinks[i]);
	}
}

function toggleMe(id)
{

	hideAllOpenBoxes();
	showHide(id, true);
}

function initRightLinkButtons()
{
	var ul = $("action-items-nav");
	if (ul)
	{
		var id;
		var ahrefs = ul.getElementsByTagName("a");
		for (var i=0, len=ahrefs.length ; i<len ; i++)
		{
			id = ahrefs[i].rel;
			if (id)
			{
				enabledLinks.push(id);
				attachOpenFormEvents(ahrefs[i], id);
			}
		}
	}
	if (OnLoadElement != "")
	{
	    toggleMe(OnLoadElement);
	}
}

function showHide(id, show)
{
	var el = $(id);
	if (el)
	{
		el.style.display = (show==true) ? "block" : "none";
	}
}

function closeMe(id)
{
	showHide(id);
}


var OnLoadElement = "";




if (window.attachEvent)
{
	window.attachEvent("onload", initRightLinkButtons);
}
else
{
	window.addEventListener("load", initRightLinkButtons, false);
}