Hello,

I have a script that slideshows 5 images. Below the images is a numbered list; 1-5. I'd like to set the style of the number buttons based on the image being displayed as the images scroll from one to the next.

Here is the page I'm working on: http://wisetopic.com

The images in question are the rectangular boxes that says "Send it likes its Hot", etc.

I try to change the class name like so:

Code:
document.getElementById('promoLink2').className = "on";
but I get this error:

Code:
document.getElementById("promoLink2") has no properties
http://wisetopic.com/_inc/js/landingPage.js
Line 679
Here is the full code sample for the photo slideshow:

Code:
function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){
    this.pausecheck=pause
    this.mouseovercheck=0
    this.delay=delay
    this.degree=10 //initial opacity degree (10%)
    this.curimageindex=0
    this.nextimageindex=1
    fadearray[fadearray.length]=this
    this.slideshowid=fadearray.length-1
    this.canvasbase="canvas"+this.slideshowid
    this.curcanvas=this.canvasbase+"_0"
    if (typeof displayorder!="undefined")
    theimages.sort(function() {return 0.5 - Math.random();}) 
    this.theimages=theimages
    this.imageborder=parseInt(borderwidth)
    this.postimages=new Array() //preload images
    for (p=0;p<theimages.length;p++){
       this.postimages[p]=new Image()
       this.postimages[p].src=theimages[p][0]
       document.getElementById('promoLink2').className = "on";
}
Notice these lines - ideally I want to use the array index to choose which number button is selected, something like this:

Code:
       
       document.getElementById('promoLink'+[p]).className = "on";
       ... /* do stuff to set the rest of the buttons to no style
Thank you in advance for your help!

JQ