Welcome to WebmasterWorld
First, a few things to avoid in general:
1. There is no "language" attribute on script elements. Don't use it, it's invalid.
2. Don't include HTML style comments within script tags. For example, instead of this:
<script type="text/javascript">
<!--
...
//-->
</script>
just do this:
<script type="text/javascript">
...
</script>
This is a remnant from Netscape 1 that hasn't been needed for many, many years, yet continues to proliferate in new code for some reason.
3. Instead of this:
var tucbook = new Array("tuc_1", "tuc_2", "tuc_3", "tuc_4", "tuc_5");
Use the literal notation to avoid the call to new:
var tucbook = ["tuc_1", "tuc_2", "tuc_3", "tuc_4", "tuc_5"];
It also takes up less space.
4. You've defined several global variables. In general it's best to avoid that because you could conflict with some other third party script. Research "javascript namespaces" for better alternatives, but to summarize: you can create a single global variable (instead of multiple), which holds an object that contains all of your actual variables. For example:
var BEEZER172 = {
tucbook: ["tuc_1", "tuc_2", "tuc_3", "tuc_4", "tuc_5"],
numImages: BEEZER172.tucbook.length,
curImage: 1,
p_fo: function (pages) { ... }
}
5. Don't use tables for layout. You're controlling the presentation layer by adding a bunch of extra markup. Instead, learn how to achieve better layouts with CSS.
6. Look into attaching event listeners instead of defining inline event handlers like onclick="...".
Now, on to your main question. Perhaps you could just attach an event listener to each of the image thumbnails as well. For example:
<a href="tuc_1.html" onclick="setCurrent(this.href);" target="blowup">
function setCurrent(uri) {
var filename = uri.substring(uri.lastIndexOf('\/') + 1, uri.lastIndexOf('.html')),
i,
n;
// Find this one in the tucbook array
for (i = 0, n = tucbook.length; i < n; i++) {
if (tucbook[i] === filename) {
curImage = i;
return;
}
}
}