title: banner ads not visible in html page
body: <p>i have a file banners.js</p>
  
  <pre><code>function addEvent(object, evName, fnName, cap) {
      if (object.attachEvent)
          object.attachEvent("on" + evName, fnName);
      else if (object.addEventListener)
          object.addEventListener(evName, fnName, cap);
  }
  
  var nextAd;
  
  function makeBannerAds() {
      var bannerBox = document.createElement("div");
      bannerBox.id = "bannerBox";
      document.body.appendChild(bannerBox);
      for (var i=0; i&lt;adsURL.length; i++) {
          var bannerAd = document.createElement("div");
          bannerAd.className = "bannerAd";
          bannerAd.style.zIndex = i;
          var urlLink = document.createElement("a");
          urlLink.href = adsURL[i];
          var bannerIndex = document.createElement("img");
          bannerIndex.src = "banner" + i +".jpg";
          bannerIndex.style.width="290px";
          bannerIndex.style.height="55px";
          bannerBox.appendChild(bannerAd);
      }
      bannerBox.appendChild(bannerAd);
      setInterval("changeBannerAd()", 10000);
  }
  
  function changeBannerAd() {
      var allAds = document.getElementById("bannerBox").childNodes;
      alert('work');
      for(var i=0; i&lt;num; i++) {
          if(allAds.style.zIndex == 0) {
              allAds.style.top = "-50px";
              nextAd = allAds;
          }
      }
  
      for(var i=0; i&lt;num; i++) {
          allAds.style.zIndex--;
  
          if(allAds.style.zIndex &lt; 0)
              allAds.style.zIndex = num-1;
      }
  
      var timeDelay = 0;
      for(var i=-50; i&lt;=0; i++) {
          setTimeout("moveNextAd(" + i + ")", timeDelay);
          timeDelay += 15;
      }
  }
  
  function moveNextAd(top) {
      nextAd.style.top = top + ".px" 
  }
  
  addEvent(window, "load", makeBannerAds(), false);
  </code></pre>
  
  <p>the second file
  ads.js</p>
  
  <pre><code>var adsURL = new Array();
  
  //this stores each item in the array using a index place holder
  adsURL[0] = "testpage0.htm";
  adsURL[1] = "testpage1.htm";
  adsURL[2] = "testpage2.htm";
  adsURL[3] = "testpage3.htm";
  adsURL[4] = "testpage4.htm";
  adsURL[5] = "testpage5.htm";
  adsURL[6] = "testpage6.htm";
  adsURL[7] = "testpage7.htm";
  adsURL[8] = "testpage8.htm";
  adsURL[9] = "testpage9.htm";
  adsURL[10] = "testpage10.htm";
  adsURL[11] = "testpage11.htm";
  //and an html file where these are included.
  </code></pre>
  
  <p>javascript is not showing any error and also all the statements are running but the images are not visible on the page. i couldnot figure the problem. working from last 2 days.</p>