LPMJ Example 15-9 (Click on the icon to view the source for copy and pasting)
<script>
gn = getnext()
if (finished == 1 OR gn == 1) done = 1;
</script>