I tried it but my join() function doesn't even work. Not sure what the problem is. Maybe tomorrow I'll be smarter. Are all variables outside functions global in Javascript?

Code:
<html>
<head>

<script language="javascript">

var numbers = new Array();
var i = 0;

function max(var numList)
{
	var largest = Number.NEGATIVE_INFINITY;
	for (j=0; j < numList.length; j++)
	{
		if (numList[j] > largest)
			largest = numList[j];
	}	
	alert(largest);
}

function join()
{
	numbers[i] = parseFloat(document.myForm.num1.value);
	i++;	
	
}

</script>

</head>
<body>

<form name="myForm">
<input type="text" size="3" name="num1" />
<input type="button" value="AddNum" onClick="join()">
<input type="button" value="Find Max" onClick="max(numbers)">
</form>



</body>
</html>