var topPos="";
var subPos="";

function changeBackgroundColor(id, color)
{
	if (document.all) eval("document.all."+id+".style.backgroundColor='"+color+"';");
	else if (document.getElementById) eval("document.getElementById('"+id+"').style.backgroundColor='"+color+"';");
}

function showLayer(id)
{
	if (document.all) eval("document.all."+id+".style.visibility='visible';");
	else if (document.getElementById) eval("document.getElementById('"+id+"').style.visibility='visible';");
	else if (document.layers) eval("document."+id+".visibility='show';");
}

function hideLayer(id)
{	
	if(id==topPos || id==subPos) return;
	else
	{
		if(document.all) eval("document.all."+id+".style.visibility='hidden';");
		else if(document.getElementById) eval("document.getElementById('"+id+"').style.visibility='hidden';");
		else if(document.layers) eval("document."+id+".visibility='hide';");
	}
}

function activateSubPos(id)
{
	var oldSubPos=subPos;	
	subPos=id;
	showLayer(subPos);
	hideLayer(oldSubPos);}

function activateTopPos(id)
{
	
	var oldTopPos=topPos;	
	topPos=id;
	showLayer(topPos);
	hideLayer(oldTopPos);
}

function refreshTopNav()
{	
	if(window.top.main.location.pathname.search(/membranerecords/)!=-1) activateTopPos("membraneRecords");
	else if(window.top.main.location.pathname.search(/releases/)!=-1) activateTopPos("releases");
	else if(window.top.main.location.pathname.search(/contactUs/)!=-1) activateTopPos("contactUs");
}

function hideTopPos()
{
	if(topPos=="") return;
	if(document.all) eval("document.all."+topPos+".style.visibility='hidden';");
	else if(document.getElementById) eval("document.getElementById('"+topPos+"').style.visibility='hidden';");
	else if(document.layers) eval("document."+topPos+".visibility='hide';");
}