Hi there,
Yes, what you are thinking of doing is possible.
I looked at the script.
Firstly, I would change the script slightly:
<script type="text/javascript"><!--
//Javascript Created by Computerhope http://www.computerhope.com
//store the quotations in arrays
currentimages="";
images = new Array();
//Where the first value in quotes it the link target, second value is image location, third value is the "alt" tag.
//EX: images[*] = ["link target goes here", "the location of the image goes here", "The text in the ALT tag goes here"];
images[0] = ["http://www.computerhope.com/index.htm", "http://www.computerhope.com/banners/banner.gif", "Visit Computer Hope"];
images[1] = ["http://www.computerhope.com/history/index.htm", "http://www.computerhope.com/banners/banner2.gif", "Computer History"];
images[2] = ["http://www.computerhope.com/index.htm", "http://www.computerhope.com/banners/banner3.gif", "Visit Computer Hope"];
images[3] = ["http://www.computerhope.com/newslet.htm", "http://www.computerhope.com/banners/banner4.gif", "Computer Hope Newsletter"];
index = Math.floor(Math.random() * images.length);
while(currentimages.indexOf("&" + index.toString())!=-1) {
index = Math.floor(Math.random() * images.length);
}
currentimages+="&" + index.toString();
document.write("<a href=\""+images[index][0] + "\"><img class=\"doubleborder\" src=\"" + images[index][1] + "\" alt=\"" + images[index][2] + "\"></a>");
//done
// --></script>
In that script I included a class on the img tags, so put the following in your <head> section (or add it to a previous stylesheet):
<style type="text/css">
img.doubleborder {
border-width: 4px;
border-style: double;
}
</style>
Do you know any javascript?
If so, I don't think pasting this script 20 times is not the most efficient way to do this.
Also, only the first script can have this line:
currentimages="";
Comment it out on the rest of the scripts like so:
//currentimages="";
or delete it.
Otherwise, you may get two of the same image on one page.
Every time you want to add an image, you will have to edit all 20 scripts (unless you want a specific selection of images per img tag)
If you send me the layout of your page, I could create a script to paste twenty of those images in one script, so you would only edit one script and have one array of images.
You can send me an e-mail at "t_profitt<...at...>hotmail<...dot...>com" if you would like a custom script based on your layout.