title: slideshow in html using javascript.. image changes but not displayed properly
body: <p>i tried this code.. but when the image changes it is not displayed properly..
  alt image(a small broken image is displayed)..</p>
  
  <p>i tried putting var step=1; before the function as global variable.. But still it does not work.. I even tried document.images.slide.src = "images/pentagg.jpg";</p>
  
  <pre><code>&lt;head&gt;
  &lt;script type="text/javascript"&gt;
      var image1 = new Image()
      image1.src = "images/pentagg.jpg"
      var image2 = new Image()
      image2.src = "images/promo.jpg"
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;p&gt;&lt;img src="images/pentagg.jpg" width="500" height="300" name="slide" /&gt;&lt;/p&gt;
      &lt;script type="text/javascript"&gt;
              function slideit()
              {
                  var step=1;
                  document.images.slide.src = eval("image"+step+".src")
                  if(step&lt;2)
                      step++
                  else
                      step=1
                  setTimeout("slideit()",2500)
              }
              slideit()
      &lt;/script&gt;
  &lt;/body&gt;
  </code></pre>