switching target in banner rotation?

wxdqz

New Member
Hey

I have a code on my site that rotates 2 banners at the top, but I need to be able to have both banners target different targets...like one for blank page and one of a frame in a frameset.

Can anyone tell me a better script I could use for this or modify the one I have?

Here's the code that is loaded from a external script file.

var mfBanners = [
['http://www.onqtech.com/test/events/trade_shows.html', 'http://www.onqtech.com/test/nav_img/banners/ehxSpring03bner.gif'],
['http://www.onqtech.com/customer_release/leviton/index.html', 'http://www.onqtech.com/test/nav_img/banners/levitonONQ_banner.gif']
];
var mfIe = false;
if( document.all) {
mfIe = true;
}
var mfBannerIndex = 0;
function mfBannerChange() {
var htmlString = '<a target="leftFrame1" href=http://www.webdeveloper.com/forum/archive/index.php/"'+mfBanners[mfBannerIndex][0]+'"> <img border="0" src=http://www.webdeveloper.com/forum/archive/index.php/"'+mfBanners[mfBannerIndex][1]+'"></a>';
if( mfIe) {
document.all.banner.innerHTML = htmlString;
}
else {
document.layers["banner"].document.open();
document.layers["banner"].document.write( htmlString);
document.layers["banner"].document.close();
}
if(mfBannerIndex < mfBanners.length - 1)
mfBannerIndex++;
else
mfBannerIndex = 0;
}
setInterval("mfBannerChange()", 20000);

--------------------

Here's the code that in on the html page that loads the banners.

<!-- Banner Ad code -->
<div id="banner" style="position:absolute; top:0; left:211;">
<a target="leftFrame1" href=http://www.webdeveloper.com/forum/archive/index.php/"http://www.onqtech.com/customer_release/leviton/index.html"><img border="0" src="http://www.onqtech.com/test/nav_img/banners/levitonONQ_banner.gif"></a></div>

<!-- End Banner Ad-->

Thank you!

Kevin
 
Back
Top