Anyway, Kevin has much greater knwoledge than I, so maybe he'll be able to
You're too kind, Trevor. In fact, I agree with you that "it's horribly
complex." There are no external JavaScripts in the page, only 2 script
blocks.
The tags you found so confusing are in fact, simply non-existant HTML tags.
I can't remember seeing them used this way before, but browsers will ignore
tags they don't recognize, so they were probably used in the same way as
comments (not at all standards-compliant, but works).
The most complex aspect of the code is the use of objects. JavaScript is
"pseudo-object-oriented" in that you can define objects in JavaScript, but
they are variant objects, and do not support encapsulation, inheritance, and
polymorphism in the way that true OOP does. A JavaScript object is basically
an aggregate of process and data that can be changed in structure at any
time. Because such objects are variant in nature, it's pretty hard to follow
the code in such a script. It can be done, but it's a rather painstaking
process.
The script also uses browser-detection, which is fairly straightforward, and
cryptic naming, which is not. On first blush, it looks like what it's doing
is using an array of images, combined with an array of URLs, to build
dynamically a changing image that, when clicked, opens a new window with the
URL of the current image loaded in it.
Unfortunately, I just don't have the hour or so to take it apart.
--
HTH,
Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist
Big thicks are made up of lots of little thins.