If you have two elements with the same name, you can't successfully reference them by name in javascript.
You could give each an id and reference them as
mycheckbox=getElementByID("someid");
However, my earlier workaround -- elements[1], etlements[5], etc;, will do the trick in this instance. You just need to count carefully.