Banner Ads - JavaScript

Back to BuildingBlocks Index or press "h"

Insert the below code into the <body> section of your page where you wish the banner ads to appear (edit code as necessary, inserting your image URLs and page URLs [either absolute or relative], adjusting number of ads, etc.):
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var how_many_ads = 4;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
if (ad==1) {
txt="DrivInMovi Website";
url="http://members.aol.com/drivinmovi/";
alt="[DrivInMovi]";
banner="../gif/banners/drivein.jpg";
width="400";
height="40";
}
if (ad==2) {
txt="Check out the Radio Show!";
url="http://empire.home.texas.net/";
alt="[EmpireRadio]";
banner="../gif/banners/shadow.jpg";
width="400";
height="40";
}
if (ad==3) {
txt="Southwest Streetcars"; 
url="http://www.caprok.net/nold/streetcars/";
alt="[The NoldZone]";
banner="../gif/banners/noldzone.jpg";
width="400";
height="40";
}
if (ad==4) {
txt="Sprite's Domain"; 
url="http://www.caprok.net/nold/";
alt="[Sprite's Domain]";
banner="../gif/banners/sprite.jpg";
width="400";
height="40";
}
document.write('<CENTER>');
document.write('<A HREF=\"' + url + '\" TARGET=\"_top\">');
document.write('<FONT FACE=\"Verdana\" SIZE=\"1\">' + txt + '</FONT></a><BR><BR>');
document.write('<iMG SRC=\"' + banner + '\" WIDTH=')
document.write(width + ' height=' + height + ' ');
document.write('ALT=\"' + alt + '\" BORDER=0>');
document.write('</CENTER>');
// End -->
</SCRIPT>

Back to BuildingBlocks Index or press "h"