Forum Moderators: open
<!--
function image() {
};
image = new image();
number = 0;
// imageArray
image[number++] = "<img src='Pictures/1.gif' border='0' width='80' height='60'>"
image[number++] = "<img src='Pictures/2.gif' border='0' width='80' height='60'>"
image[number++] = "<img src='Pictures/3.gif' border='0' width='80'height='60'>"
image[number++] = "<img src='Pictures/4.gif' border='0' width='80' height='60'>"
image[number++] = "<img src='Pictures/5.gif' border='0' width='80 'height='60'>"
// keep adding items here...
increment = Math.floor(Math.random() * number);
document.write(image[increment]);
//-->
You are creating a new image, image. This isn't really appropriate here. You want an array. This still works because the image you create can have indexed properties, so it works equally well.
What is the function, image for? It's empty. If you do try to use it, it won't work, because the global variable name, image, is assigned the image that you create. If you want to use the function later, give it a different name.
I don't think giving file names leading digits is legal on most operating systems either.
Do you want random directories, and random images?
What kind of directory names are you choosing from?