If you either decide solution 1 or 2 there will only be one checkAll function, I would most likely prefere the second solution, sicne you only need one single <form></form> surrounding all tabels within the page, and that would make it more vertile to query some form of server-side result processing..
So the layout would be something like this:
Code:
<script language...>
...
</script>
...
<form name=blah action=blah method=post>
<table ..>
<!-- first table -->
...
<input type=checkbox name=table1_apples>
<input type=checkbox name=table1_orranges>
...
<input type=checkbox name=allbox onclick="checkAll("table1");" value=on>
...
</table>
...
<table ..>
<!-- second table -->
...
<input type=checkbox name=table2_apples>
<input type=checkbox name=table2_orranges>
...
<input type=checkbox name=allbox onclick="checkAll("table2");" value=on>
...
</table>
...
<input type=submit value="My submit button">
</form>
...