Code:
images = new Array();
images[count++] = new ImageItem("5678000-01070.jpg", "alt tag for 1070");
images[count++] = new ImageItem("5678000-01071.jpg", "alt tag for 1071");
If you can, change the ImageItem constructor to take an extra parameter, which will become the alt tag. Something like,
Code:
function ImageItem(name, alt) {
this.img = new Image();
this.img.src = imageDir + url;
this.alt = alt;
}
When you replace the image,
Code:
imgObject.src = images[n].img.src;
imgObject.alt = images[n].alt;
However, there are javascript animation libraries (eg scriptaculous) that you might prefer to use which will take care of appearing and disappearing images as well as giving you more interesting effects (slide up, slide down, fade in, fade out, etc).