Would someone tell me how to modify the script below to accomodate several instances of it within a single page?
Thanks!
<SCRIPT LANGUAGE="JavaScript">
src = ["1.jpg", "2.jpg", "3.jpg"]
duration = 5;
ads=[]; ct=0;
function switchAd() {
var n=(ct+1)%src.length;
if (ads[n] && (ads[n].complete || ads[n].complete==null)) {
document["Ad_Image"].src = ads[ct=n].src;
}
ads[n=(ct+1)%src.length] = new Image;
ads[n].src = src[n];
setTimeout("switchAd()",duration*1000);
}
function doLink(){
location.href = url[ct];
} {
if (document.images)
switchAd();
}
</SCRIPT>
Thanks!
<SCRIPT LANGUAGE="JavaScript">
src = ["1.jpg", "2.jpg", "3.jpg"]
duration = 5;
ads=[]; ct=0;
function switchAd() {
var n=(ct+1)%src.length;
if (ads[n] && (ads[n].complete || ads[n].complete==null)) {
document["Ad_Image"].src = ads[ct=n].src;
}
ads[n=(ct+1)%src.length] = new Image;
ads[n].src = src[n];
setTimeout("switchAd()",duration*1000);
}
function doLink(){
location.href = url[ct];
} {
if (document.images)
switchAd();
}
</SCRIPT>