This code seems like it should work - can't find the problem:

Here's the code:

<!--Generate New Code JavaScript-->
<script language="JavaScript">

//Variables
var check = new Array();
var scroll, location, tool, status, menu, resize;

function newCode() {

//populate array for checkboxes
check[0] = document.form.scroll.checked;
check[1] = document.form.location.checked;
check[2] = document.form.tool.checked;
check[3] = document.form.status.checked;
check[4] = document.form.menu.checked;
check[5] = document.form.resize.checked;

for (i=0;i<=5;++i)
{
if (check[i]==false)
{
check[i]="no";
}
else
{
check[i]="yes";
}
}

//populate variables
scroll=check[0];
location=check[1];
tool=check[2];
status=check[3];
menu=check[4];
resize=check[5];


--Then I am going to write out the variables above.
Any advice?