here is how to do it.... I have questions though..
- Code: Select all
function adArray() {
for (i=0; i*2<adArray.arguments.length; i++) {
this[i] = new Object();
this[i].src = adArray.arguments[i*2];
this[i].href = adArray.arguments[i*2+1];
}
this.length = i;
}
function getAdNum() {
dat = new Date();
dat = (dat.getTime()+"").charAt(8);
if (dat.length == 1)
ad_num = dat%ads.length;
else
ad_num = 0;
return ad_num;
}
var ads = new adArray(
"/artists/portfolios/brandon/IMG_1.jpg","http://www.provocativetattoo.com",
"/artists/portfolios/brandon/IMG_2.jpg","http://www.provocativetattoo.com");
var ad_num = getAdNum();
document.write('<A HREF="'+ads[ad_num].href+'"><IMG SRC="'+ads[ad_num].src+'" WIDTH="300" HEIGHT="300"></A>');
link_num = document.links.length-1;
function rotateSponsor() {
if (document.images) {
ad_num = (ad_num+1)%ads.length;
document.js_ad.src = ads[ad_num].src;
document.links[link_num].href = ads[ad_num].href;
setTimeout("rotateSponsor()",604800000);
}
}
setTimeout("rotateSponsor()",604800000);
okay right at the end the line
- Code: Select all
setTimeout("rotateSponsor()",604800000);
should rotate the image every week. I figured that if 5000 = 5 seconds, then 604800000 = 1 week...
except it does not seem to be working.
i need the image to rotate every week.


