function showHide(elementID, show)
{
	var el = document.getElementById(elementID);

	if(show)
	{
		el.style.display = '';
	}
	else
	{
		el.style.display = 'none';
	}

	return false;
}

function checkUncheckAll(theElement)
/*
	Check/uncheck all checkboxes in the form.
*/
{
	var theForm = theElement.form, z = 0;
	while(theForm[z])
	{
		if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall')
			theForm[z].checked = theElement.checked;
		z++;
	}
}

function determineFormAction(el, action, target)
/*
	Change form action that el is part of and submit that form.
*/
{
	if(typeof(target) == "undefined" || target == null)
	{
		target = false;
	}

	var theForm = el.form;

	theForm.action = action;
	if(target)
		theForm.target = target;
	theForm.submit();
}

function isAnythingChecked(el)
/*
	Goes through form where el is and returns true
	if at least one checkbox is checked.
*/
{
	var theForm = el.form;
	var z = 0;

	while(theForm[z])
	{
		if(theForm[z].type == 'checkbox' && theForm[z].checked)
			 return true;
		z++;
	}

	return false;
}

function disableEnterKey(e)
{
	var key;

	if(window.event)
		key = window.event.keyCode;	//IE
	else
		key = e.which;	//firefox

	if(key == 13)
		return false;
	else
		return true;
}
