"Royal Denning" <ro***********@ hotmail.com> wrote in message
news:4e******** *************** ***@posting.goo gle.com...
McK: It worked! Thanks so much.
My only remaining questions:
How do I plug in the separate URLS (relative links, such at one.htm,
two.htm, etc.) to each image,
and can I use the same script twice on a page (using different array
values, such at 11-20?
I really appreciate your patience and guidance on this.
Not the most elegant code ....
<html>
<head>
<title>rotate20 .htm</title>
<script type="text/javascript">
function numbers() {
var url = "http://www.topsearchsp ot.com/";
var gif = new Array(10);
// gif[#] = image | text | page
gif[0] = "0.gif|Zero|www .Google.com?00" ;
gif[1] = "1.gif|One|www. Google.com?01";
gif[2] = "2.gif|Two|www. Google.com?02";
gif[3] = "3.gif|Three|ww w.Google.com?03 ";
gif[4] = "4.gif|Four|www .Google.com?04" ;
gif[5] = "5.gif|Five|www .Google.com?05" ;
gif[6] = "6.gif|Six|www. Google.com?06";
gif[7] = "7.gif|Seven|ww w.Google.com?07 ";
gif[8] = "8.gif|Eight|ww w.Google.com?08 ";
gif[9] = "9.gif|Nine|www .Google.com?09" ;
gif[10] = "0.gif|Ten|www. Google.com?10";
gif[11] = "1.gif|Eleven|w ww.Google.com?1 1";
gif[12] = "2.gif|Twelve|w ww.Google.com?1 2";
gif[13] = "3.gif|Thirteen |www.Google.com ?13";
gif[14] = "4.gif|Fourteen |www.Google.com ?14";
gif[15] = "5.gif|Fifteen| www.Google.com? 15";
gif[16] = "6.gif|Sixteen| www.Google.com? 16";
gif[17] = "7.gif|Seventee n|www.Google.co m?17";
gif[18] = "8.gif|Eighteen |www.Google.com ?18";
gif[19] = "9.gif|Nineteen |www.Google.com ?19";
for (var i=0; i<gif.length; i++) {
gif[i] = url + gif[i];
}
var hig = 62;
var wid = 62;
// Change values above but not below.
var wyd = wid*2;
var xix = "00010203040506 070809101112131 41516171819";
var mod = xix.length/2;
var now = new Date();
var pos = now.getSeconds( )%mod;
var num = xix.substr(pos* 2-2);
if (pos > 0) num += xix.substring(0 ,pos*2-2);
var col = new Array();
var src;
var sub;
var tmp;
var k = 0;
for (var j=0; j<num.length; j++) {
sub = parseInt(num.su bstring(j,j+2), 10);
tmp = gif[sub].split("|");
src = "<a href='http://" + tmp[2] + "' target='_blank' >"
src += "<img src='" + tmp[0] + "'";
src += "border='0' width='" + wid + "' height='" + hig + "'
alt=''></a>";
src += "<br>" + tmp[1];
col[k] = src;
j++;
k++;
}
var l = 0;
var tab = new Array();
tab[l++] = "<table border='0' cellpadding='0' cellspacing='0'
width='" + wyd + "'>";
var mid = num.length/4;
for (var m=0; m<mid; m++) {
tab[l++] = "<tr height='" + hig + "' valign='top'>";
tab[l++] = " <th width='" + wid + "'>" + col[m] + "</th>";
tab[l++] = " <th width='" + wid + "'>" + col[m+mid] + "</th>";
tab[l++] = "</tr>";
}
tab[l++] = "</table>";
document.write( tab.join(""));
}
numbers();
</script>
</head>
<body>
</body>
</html>
The twenty "gif" entries (0 - 19) contain three elements seperated by "|"
are the image name ("0.gif"), the text (e.g. "One"), and the page (e.g.
www.Google.com?01 -- the "http://" is prepended later). The page can be any
valid url; for example, "www.Google .com/index.html".
Change the "gif" array as well as "url", "wid", and "hig" to suit your
needs. This presumes that all images are in the same folder specified by
the "url" and that all images are the same width ("wid") and height ("hig").