﻿// Get an element on the page by ID.
// Return null if the ID is not found.
function GetElement(id)
{
	var e = null;
	if (document.getElementById)
	{
		e = document.getElementById(id);
	}
	else if (document.all)
	{
		e = eval("window." + id);
	}
	else if (document.layers)
	{
		e = document.layers[id];
	}
	return e;
}

// Hide an element.
function HideElement(id)
{
	if (document.getElementById)
	{
		// This is the way the standards work.
		document.getElementById(id).style.display = "none";
	}
	else if (document.all)
	{
		// This is the way old MS IE versions work.
		document.all[id].style.display = "none";
	}
	else if (document.layers)
	{
		// This is the way NN4 works.
		document.layers[id].display = "none";
	}
}

// Show an element.
function ShowElement(id)
{
	if (document.getElementById)
	{
		// This is the way the standards work.
		document.getElementById(id).style.display = "block";
	}
	else if (document.all)
	{
		// This is the way old MS IE versions work.
		document.all[id].style.display = "block";
	}
	else if (document.layers)
	{
		// This is the way NN4 works.
		document.layers[id].display = "block";
	}
}
