Is there anyway I can put a delay on this script from running?
var refreshTime = 15000; // 15sec
function Ad() {
this.width = (arguments[0]!=null?arguments[0]:0);
this.height = (arguments[1]!=null?arguments[1]:0);
this.src = (arguments[2]!=null?arguments[2]:””);
this.href = (arguments[3]!=null?arguments[3]:””);
this.title = (arguments[4]!=null?arguments[4]:””);
}
function switchAd() {
c_ad=(c_ad+1)%ads.length;
document.getElementById(“adlink”).href=ads[c_ad].href;
document.getElementById(“adimg”).src=ads[c_ad].src;
document.getElementById(“adimg”).alt=ads[c_ad].title;
document.getElementById(“adimg”).title=ads[c_ad].title;
document.getElementById(“adimg”).width=ads[c_ad].width;
document.getElementById(“adimg”).height=ads[c_ad].height;
}
var ads = new Array()
// Ad 01___________
ads[ads.length]=new Ad(468, 60,
// src
“
// href
“
// alt
“PennyTalk 468×60 v2 Intl”);
// Ad 02 ___________
ads[ads.length]=new Ad(468, 60,
// src
“
// href
“
// alt
“Cheap Tickets Flights”);
var c_ad=Math.floor(Math.random()*ads.length);
if(c_ad==ads.length) cad–;
document.write(“<a target=’_blank’ id=’adlink’ href='”+ads[c_ad].href+”‘>”+
“<img id=’adimg’ border=’0′ src='”+ads[c_ad].src+”‘ alt='”+ads[c_ad].title+
“‘ title='”+ads[c_ad].title+”‘ width='”+ads[c_ad].width+
“‘ height='”+ads[c_ad].height+”‘></a>”);
window.setInterval(“switchAd()”, refreshTime);