Image

Linking a rotating gallery

Hey I am new to this community and I'm really just starting to dip into Javascript for some websites I am doing. My question is: I have a rotating image gallery driven by JS and I can't seem to figure out how to link each individual page to its corresponding product page. The way I have the code now, the first image/link works but it doesn't refresh once the next images(s) appear.

Here is the page which I am referring to:
Air Cylinders Direct

Here is the code in which I am referring to:





I apologize if my code is disgusting and messy. I'm just a newbie.

Thanks for your help.