function show(what)
{
	if (!document.getElementById) return null;
	showWhat = document.getElementById(what);
	if (showWhat.className == "") 
	{showWhat.className = "hidden";}
	else 
	{showWhat.className = "";}
}

function showhide(what)
{
	if (!document.getElementById) return null;
	showWhat = document.getElementById(what);
	if (showWhat.className == "") 
	{
		show2 = document.getElementById("showlink");
		show2.className = "";
		show3 = document.getElementById("hidelink");
		show3.className = "hidden";
		showWhat.className = "hidden";
	}
	else 
	{
		show3 = document.getElementById("showlink");
		show3.className = "hidden";
		show2 = document.getElementById("hidelink");
		show2.className = "";
		showWhat.className = "";
	}
}

function externalLinks() 
{ 
	if (!document.getElementsByTagName) return; 
	var anchors = document.getElementsByTagName("a"); 
	for (var i=0; i<anchors.length; i++) 
	{ 
		var anchor = anchors[i]; 
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") 
		{	
			anchor.target = "_blank"; 
		}
	} 
}

function activate(field, hc)
{
	if (!document.getElementById) return null;
	var eltName = hc + "-" + field;
	var elt = document.getElementById(eltName);
	if (elt == null) return;
	if (elt.style.display == 'block')
	{
		elt.style.display = 'none';
	}
	else
	{
		elt.style.display = 'block';
	}
}

function toggleContextHelp(eltName)
{
	if (!document.getElementById) return null;
	var elt = document.getElementById(eltName);
	if (elt == null) return;
	if (elt.style.display == 'block')
	{
		elt.style.display = 'none';
	}
	else
	{
		elt.style.display = 'block';
	}
}

function showContextHelp(eltName)
{
	if (!document.getElementById) return null;
	var elt = document.getElementById(eltName);
	if (elt == null) return;
	elt.style.display = 'block';
}

function hideContextHelp(eltName)
{
	if (!document.getElementById) return null;
	var elt = document.getElementById(eltName);
	if (elt == null) return;
	elt.style.display = 'none';
}

function help(topic)
{
	popup('/tools/help_popup.php?identifier=' + topic, '_help', 940, 640);
}

window.onload = externalLinks;

