prova con:
codice:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Rotazione casuale banner</title>
<script type="text/javascript">
var RITARDO_SECONDI = 2; //ritardo in sec., banner change time
var idLink = "myLink"; //id del tag <a> che contiene l'img, id of tag <a> that contains the img.
var idBanner = "myBanner"; //id tag <img>
var vettoreBanner =
new Array
(
new Array("http://www.sito1.it", "http://forum.html.it/forum/images/hotlockfolder.gif"),//array with url and links, array con urls e link
new Array("http://www.sito2.it", "http://forum.html.it/forum/images/newfolder.gif"),
new Array("http://www.sito3.it", "http://forum.html.it/forum/images/hotfolder.gif")
);
function ruotaBanner() {
var rnd = Math.floor(Math.random() * vettoreBanner.length); //Random number, numero random
//Cambia li link e l'immagine del banner, changes link and banner's image.
document.getElementById(idLink).href = vettoreBanner[rnd][0];
document.getElementById(idBanner).src = vettoreBanner[rnd][1];
}
</script>
</head>
<body onload="ruotaBanner()>
[img]defaultig.jpg[/img]
</body>
</html>
l'ho buttato giù così, nn so se funge...