Hello,

I snarfed a java script online that did as advertised: Allowed pics to be displayed in a rotating manner based on a time
value you set in the script. I don't know if I can attach the script (this is my first time trying) so I will paste it here. It's fairly
short. I've done a little bit of C and PHP programming, but I am a weekend warrior. Looking for a pro to help out. Here goes:

var bannerImg = new Array();
// Enter the names of the images below
bannerImg[0]="/images/cover one.png";
bannerImg[1]="/images/cover two.png";
bannerImg[2]="/images/cover three.png";

var newBanner = 0;
var totalBan = bannerImg.length;


function cycleBan() {
newBanner++;
if (newBanner == totalBan) {
newBanner = 0;
}
document.banner.src=bannerImg[newBanner];
// set the time below for length of image display
// i.e., "4*1000" is 4 seconds
setTimeout("cycleBan()", 4*1000);
}
window.onload=cycleBan;


Most of it seems pretty straight forward:

1) create an array then stuff your pics in it.
2) set a couple of variables, one that equals 0 and the other the length of the array
3) create a function and begin it with 'For Loop' with a counter so you don't count past the length of the array (all very C'ish so far)

The next line starts to get a little weird for someone who doesn't work with javascript. It's assigning document.banner.src equal to what's in the zero position of the array. Then it wait's for 4 seconds and exits the function. Then the line window.onload=cycleBan; not sure what that means. I can only deduce that since it has .onload in it, that it loads up the pic and displays it? Then the script counts through and displays all the pics.

But what really weirds me out is what I have to put in the cell to make it all work:

<TD width=342 height=410 border=0 valign=top align=center><img src="image_jss.gif" name="banner"border=0><TD>

Img src="image_jss.gif" what's that all about? I mean, it works and all, put my pics are .png and you have to have name=banner too or it won't work. Anyway, Is there a way that when one of the pics is displayed on the webpage a link can be assigned to it? then when the pic changes, a different link can be assigned? And so on? I could have asked all this without going through the code, but I thought it would be a good chance to learn a little more about how javascript works.

much appreciated,
Matt