/* Sets the focus to id="focus" */
function set_focus ()
	{
	/* Get the object, if there is one */
	var focus_object = document.getElementById ("focus");
	
	/* Make sure we have it before we set it */
	if (focus_object != null)
		{
		/* Booya! */
		focus_object.focus ();
		}
	}

/* Yes / No question */
function ask_if_sure (message)
	{
	/* Popup the question */
	var ask = confirm (message);
	
	/* Check if they pressed "yes" */
	if (ask == false)
		{
		return false;
		}
	
	return true;
	}

function show_hide_col (toggle, table_id, column)
	{
	if (typeof (toggle) != 'number')
		var toggle = toggle.checked;
	
	var table	= document.getElementById (table_id);
	var rows	= table.getElementsByTagName ('tr');
	
	for (var row = 0; row < rows.length; row ++)
		{
		var cels = rows[row].getElementsByTagName ('td')
		
		if (cels[(column - 1)])
			{
			cels[(column - 1)].style.display = (toggle) ? '' : 'none';
			}
		}
	}
