var theImages = new Array()
theImages[0] = 'images/testimonials/1.gif'
theImages[1] = 'images/testimonials/2.gif'
theImages[2] = 'images/testimonials/3.gif'
theImages[3] = 'images/testimonials/4.gif'
theImages[4] = 'images/testimonials/5.gif'
theImages[5] = 'images/testimonials/6.gif'
theImages[6] = 'images/testimonials/7.gif'
theImages[7] = 'images/testimonials/8.gif'
theImages[8] = 'images/testimonials/9.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]+'" border="0px">');
}
_________________________
var homeImages = new Array()
theImages[0] = 'images/headimage_home_a.jpg'
theImages[1] = 'images/headimage_home_b.jpg'
theImages[2] = 'images/headimage_home_c.jpg'
theImages[3] = 'images/headimage_home_d.jpg'
var j = 0
var p = homeImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = homeImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function topImage(){
document.write('<img src="'+homeImages[whichImage]+'">');
}
As you can see, I tried giving both scripts a different function and variable. What I get when I test the page is the first image from the second script appearing where the other image(s) should.
Help is appreciated.
-dan
