// from unclassified newsboard: unb_lib/common.js

// Toggle visibility of an object
//
// in id = (string) Object's ID
// in state = (bool) true/false: Force to show/hide it [optional]
//
function toggleVisId(id, state)
{
	return toggleVisObj(document.getElementById(id), state);
}

// Toggle visibility of an object
//
// in obj = (object) Object
// in state = (bool) true/false: Force to show/hide it [optional]
//
function toggleVisObj(obj, state)
{
	if (obj == null) return;
	if (state == null)
	{
		if (obj.style.display == "") newstate = "none";
		else                         newstate = "";
	}
	else
	{
		if (state) newstate = "";
		else       newstate = "none";
	}
	obj.style.display = newstate;
	return (newstate == "" ? 1 : -1);
}

