for the one that i use, i place the html into an array and then call the script from the main page....
so the random_pic.js script would look like
[php]
function oneOf(arr) {
return arr[Math.floor(Math.random()*arr.length)];
}
newstuff = new Array("<a href=portfolio/stanford/stanford.htm><img src=portfolio/stanford/images/stanford_cutout.jpg border=0><br>Stanford Triathlon</a>",
"<a href=portfolio/pumatech/pumatech.htm><img src=portfolio/pumatech/images/pumatech_cutout.jpg border=0><br>Pumatech</a>",
"<a href=portfolio/esale/esale.htm><img src=portfolio/esale/images/esale_cutout.jpg border=0><br>eSale</a>");
oldstuff = new Array("<a href=portfolio/src/src.htm><img src=portfolio/src/images/src_cutout.jpg border=0><br>Arizona State University</a>",
"<a href=portfolio/buzz/buzz.htm><img src=portfolio/buzz/images/buzz_cutout.jpg border=0><br>Buzz Jensen's Sound Advice</a>",
"<a href=portfolio/apricot/apricot.htm><img src=portfolio/apricot/images/apricot_cutout.jpg border=0><br>Apricot Hosting Solutions</a>");
var page1 = oneOf(newstuff)
var page2 = oneOf(oldstuff)
document.write(page1);
document.write('<br> <br>');
document.write(page2);
[/php]
and then you would call it from the main page like this
[php]
<html>
<head></head>
<body>
<script language="JavaScript" src="random_pic.js" type="text/javascript"></script>
</body>
</html>
[/php]
so you can adapt this to place the html for the sliced images into the array and expand it to however many images you want to use...