// Collapses/Expands a cell
function change(id, buttonID, hideText, showText)
{
	cell = document.getElementById(id);
	button = document.getElementById(buttonID);
	
	if (cell.style.display == "none")
	{
		cell.style.display = "";
		button.value = showText;
	}
	
	else
	{
		cell.style.display = "none";
		button.value = hideText;
	}
}

// Only allows numbers to be typed in a text field
function validateNumber(e)
{
	var charCode = -1;
	
	if (window.event) // IE
	{
		charCode = e.keyCode;
	}
	
	else if (e.which) // Netscape/Firefox/Opera
	{
		charCode = e.which;
	}
	
	else if (e.keyCode)
	{
		// A special key was pressed
		charCode = 0;
	}
	
	else
	{
		alert("No key press value");
	}
	
	// Checks if the character is between '0' (48) and '9' (57)
	// or if the character is a special character such as shift,
	// ctrl, home, etc. 37-40
	return (((charCode >= 48) && (charCode <= 57)) || ((charCode >= 0) && (charCode <= 31) && (charCode != 9)));
	
	/*var unicode=e.charCode? e.charCode : e.keyCode
	if (unicode!=8){ //if the key isn't the backspace key (which we should allow)
	if (unicode<48||unicode>57) //if not a number
	return false //disable key press
	}*/
}
