function hide()
{
	for (var el, a  = 0; a < arguments.length; ++a)
	{
		if (el = document.getElementById(arguments[a]))
			el.style.visibility = 'hidden';
	}
}

function show()
{
	for (var el, a  = 0; a < arguments.length; ++a)
	{
		if (el = document.getElementById(arguments[a]))
			el.style.visibility = 'visible';
	}
}

function display()
{
	for (var el, a  = 0; a < arguments.length; ++a)
	{
		if (el = document.getElementById(arguments[a]))
			el.style.display = 'block';
	}
}

function undisplay()
{
	for (var el, a  = 0; a < arguments.length; ++a)
	{
		if (el = document.getElementById(arguments[a]))
			el.style.display = 'none';
	}
}

function checkstate()
{
	if (document.form1.port1[0].checked && 
		document.form1.port2[0].checked && 
			document.form1.port3[0].checked && 
				document.form1.port4[0].checked)
					undisplay('set1');
}

function init() //insures display matches radio selections on refresh
{
	var radios = ['port1' , 'port2' , 'port3' , 'port4'];
	var radioname, i = 0, r, radgrp, oForm = document.form1;
	while (radioname = radios[i++])
	{
		radgrp = oForm.elements[radioname];
		r = radgrp.length;
	do
		if (radgrp[--r].checked)
			radgrp[r].onclick(); //if radio checked, call onclick handler
	while (r);
	}
	return true;
}

onload = init;
