thanks for the reply. i will mess around with what you have provided; it looks like a nice clean way of accomplishing what i am trying to do. i have been able to solve the problem on my own, tho i am sure it isnt a pretty way of achieving it. see below if you wish:
HTML Code:
/*-----------dont change this code ----------------*/
// addLoadEvent
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}
addLoadEvent(swap);
function swap() {
if (!document.getElementById) { return;}
preload_image_object = new Image();
/*-----------end of dont change this code ----------------*/
var rndimg = new Array ()
rndimg[0] = ("images/Highlights/Highlight_1.jpg");
rndimg[1] = ("images/Highlights/Highlight_2.jpg");
rndimg[2] = ("images/Highlights/Highlight_3.jpg");
rndimg[3] = ("images/Highlights/Highlight_4.jpg");
rndimg[4] = ("images/Highlights/Highlight_5.jpg");
rndimg[5] = ("images/Highlights/Highlight_6.jpg");
rndimg[6] = ("images/Highlights/Highlight_7.jpg");
rndimg[7] = ("images/Highlights/Highlight_8.jpg");
rndimg[8] = ("images/Highlights/Highlight_9.jpg");
var H_Head=new Array()
H_Head[0] = ('<A HREF="http://www.1.com">H-1 Headline</a>');
H_Head[1] = ('<A HREF="http://www.2.com">H-2 Headline</a>');
H_Head[2] = ('<A HREF="http://www.3.com">H-3 Headline</a>');
H_Head[3] = ('<A HREF="http://www.4.com">H-4 Headline</a>');
H_Head[4] = ('<A HREF="http://www.5.com">H-5 Headline</a>');
H_Head[5] = ('<A HREF="http://www.6.com">H-6 Headline</a>');
H_Head[6] = ('<A HREF="http://www.7.com">H-7 Headline</a>');
H_Head[7] = ('<A HREF="http://www.8.com">H-8 Headline</a>');
H_Head[8] = ('<A HREF="http://www.9.com">H-9 Headline</a>');
var H_Copy=new Array()
H_Copy[0] = "H-1 Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim";
H_Copy[1] = "H-2 Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim";
H_Copy[2] = "H-3 Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim";
H_Copy[3] = "H-4 Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim";
H_Copy[4] = "H-5 Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim";
H_Copy[5] = "H-6 Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim";
H_Copy[6] = "H-7 Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim";
H_Copy[7] = "H-8 Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim";
H_Copy[8] = "H-9 Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim";
/*-----------dont change this code ----------------*/
var numimages = rndimg.length-1;
var min = 0;
var max = numimages;
var count =4;
var lookup=[], range=max-min+1, num;
for(var i=0; i<count; i++)
{
while( !isNaN(lookup[ (num = min + Math.floor(Math.random()*range))+'r']) )
;
lookup[i]=lookup[num+'r']=num;
}
var j = 0;
for(j=0; j<=numimages; j++)
preload_image_object.src = rndimg[j];
/*-----------end of dont change this code ----------------*/
var randomimage1=(rndimg[lookup[0]]);
var randomimage2=(rndimg[lookup[1]]);
var randomimage3=(rndimg[lookup[2]]);
var randomimage4=(rndimg[lookup[3]]);
var randomheadline1=(H_Head[lookup[0]]);
var randomheadline2=(H_Head[lookup[1]]);
var randomheadline3=(H_Head[lookup[2]]);
var randomheadline4=(H_Head[lookup[3]]);
var randomsubtext1=(H_Copy[lookup[0]]);
var randomsubtext2=(H_Copy[lookup[1]]);
var randomsubtext3=(H_Copy[lookup[2]]);
var randomsubtext4=(H_Copy[lookup[3]]);
document.getElementById("highlight_1").src = randomimage1;
document.getElementById("highlight_2").src = randomimage2;
document.getElementById("highlight_3").src = randomimage3;
document.getElementById("highlight_4").src = randomimage4;
document.getElementById("highlightHead_1").innerHTML = randomheadline1;
document.getElementById("highlightHead_2").innerHTML = randomheadline2;
document.getElementById("highlightHead_3").innerHTML = randomheadline3;
document.getElementById("highlightHead_4").innerHTML = randomheadline4;
document.getElementById("highlightCopy_1").innerHTML = randomsubtext1;
document.getElementById("highlightCopy_2").innerHTML = randomsubtext2;
document.getElementById("highlightCopy_3").innerHTML = randomsubtext3;
document.getElementById("highlightCopy_4").innerHTML = randomsubtext4;
}
Bookmarks