It seems that this forum fills up fast, so I am re-posting this in a hopefully clearer form.
I have this script in the head of my HTML
<SCRIPT language=JavaScript>
var theImages = new Array()
theImages[0] = ‘1.gif’
theImages[1] = ‘2.gif’
theImages[2] = ‘3.gif’
var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write(‘<img src=”‘+theImages[whichImage]+'”>’);
}
</SCRIPT>
And this in the body.
<SCRIPT language=JavaScript>
showImage();
</SCRIPT>
I want to set up a seperate array of images in the head which would populate a seperate area of the page. So I would have multiple random image areas on the page. I don’t know how to distinguish them so that 2 scripts in the head will populate 2 distinct regions on the page with random images. Thanks for patience and help.