hillbillyfritz
Technical User
I am using the following script to rotate my banner ads. When I click an ad a blank window comes up with "javascript:doLink2();" in the address bar, any suggestions? Thanks in advance.
Code:
///set image paths
src2 = ["images/ad1.jpg", "images/ad2.gif", "images/ad3.jpg", "images/ad4.gif", "images/ad5.jpg", "images/ad6.gif"]
//set corresponding urls
url2 = ["[URL unfurl="true"]http://link1.com",[/URL] "[URL unfurl="true"]http://link2.com",[/URL] "[URL unfurl="true"]http://link3.com","http://link4.com",[/URL] "[URL unfurl="true"]http://link5.com",[/URL] "[URL unfurl="true"]http://link6.com"[/URL]]
//set duration for each image
duration2 = 3;
//Please do not edit below
ads2=[]; ct2=8;
function switchAd2() {
var n2=(ct2+1)%src2.length;
if (ads2[n2] && (ads2[n2].complete || ads2[n2].complete==null))
{
document["Ad_Image2"].src = ads2[ct2=n2].src;
}
ads2[n2=(ct2+1)%src2.length] = new Image;
ads2[n2].src = src2[n2];
setTimeout("switchAd2();",duration2*1000);
}
function doLink2(){
window.open(url2[ct2]);
} onload = function(){
if (document.images)
switchAd2();
}
document.write(
'<div align="center">'
+' <center>'
+' <A HREF="javascript:doLink2();" onMouseOver="status=url2[ct2];return true;">'
+' <IMG NAME="Ad_Image2" SRC="images/ad6.gif" BORDER=0></A>'
+' </center>'
+'</div>'
)