//-3) time between switching the ad, in milliseconds -\\ var refreshTime = 4000; //- 5000 ms = 5 seconds -\\ //-4) number of ads to rotate -\\ var numAds = 5; function makeAd() { this.width = '' this.height = '' this.src = '' this.href = '' this.mouseover = '' this.sponsor = '' } var ads = new Array() for(var i = 1; i <= numAds; i++) { ads[i] = new makeAd() } //- 5) Copy and paste the lines between the banner definition for //each banner you want to rotate and be sure to change numAds to //the number of banners (look about 15 lines up for numAds) i = 1; /*------------begin banner definition----------*/ //ads[i].width = "468" //width of image //ads[i].height = "60" //height of image //ads[i].src = "1.gif" //image url //ads[i].href = "/index.htm" //link url //ads[i].mouseover = "Mouseover text" //text to display when mouse moves over banner //ads[i].sponsor = "" //text to display for text link under banner //i++ /*-------------end banner definition-----------*/ bannerName = "1.jpg"; bannerUrl = "www.yahoo.com"; ads[i].width = "479" ads[i].height = "60" ads[i].src = "http://www.autobag-s.com/banner/"+bannerName ads[i].href = bannerUrl i++ bannerName = "2.jpg"; bannerUrl = "http://www.autobag-s.com/ecatalog/index.php?pg=list&prod_id=1230"; ads[i].width = "479" ads[i].height = "60" ads[i].src = "http://www.autobag-s.com/banner/"+bannerName ads[i].href = bannerUrl i++ bannerName = "3"; bannerUrl = "http://www.autobag-s.com/ecatalog/index.php?pg=list&prod_id=1094"; ads[i].width = "479" ads[i].height = "60" ads[i].src = "http://www.autobag-s.com/banner/"+bannerName ads[i].href = bannerUrl i++ bannerName = "4.jpg"; bannerUrl = "http://www.autobag-s.com/ecatalog/index.php?pg=list&prod_id=1249"; ads[i].width = "479" ads[i].height = "60" ads[i].src = "http://www.autobag-s.com/banner/"+bannerName ads[i].href = bannerUrl i++ bannerName = "5.jpg"; bannerUrl = "http://www.autobag-s.com/ecatalog/index.php?pg=list&prod_id=1249"; ads[i].width = "479" ads[i].height = "60" ads[i].src = "http://www.autobag-s.com/banner/"+bannerName ads[i].href = bannerUrl i++ var myCode = ''; do { var n= Math.floor(Math.random() * (numAds + 1) + 1); } while(n > numAds); var current_ad = n; myCode = getCode(n); function getCode(adNumber){ var tempCode = "" tempCode += (' \n') tempCode += ('') //delete this line if you don't want any text to be displayed under your banner tempCode += ('') return tempCode; } function newAd(){ current_ad++; if (current_ad > numAds) current_ad = 1; if (document.all){ write(getCode(current_ad)); } } function write(text){ if (document.layers) { document.bannerAd.document.write(text) document.bannerAd.document.close(); } else if (document.all) document.all.bannerAd.innerHTML = text }