title: DHTML - Show picture for limited time
body: <p>im  try to use DHTML in order to make animation for 3-5 sec( the anumation supose to start from the left to the right...).</p>
  
  <p>any idea how to do tthat???</p>
  
  <pre><code>//this one will set the the pictue on the right side of the screen
  function setUpPicture() {
      subRunnerOBJ = new Object();
      subRunnerOBJ.topPos = 100;
      subRunnerOBJ.leftPos = 0;
      subRunnerOBJ.velX = 400;
      subRunnerOBJ.velY = 0;
      subRunnerOBJ.score = 0;
      hide1.style.visibility = "visible";
      hide1.style.left = subRunnerOBJ.leftPos + "px";
      hide1.style.top = subRunnerOBJ.topPos + "px";
      hide1.style.position = "absolute";
      //once we place the location of the sub , we will Call to new function that will move it
      startMovePicture();
  }
  
  function startMovePicture() {
      dt = 50; // in miliseconds
      h = setInterval("moveObj(subRunnerOBJ)", dt);
  }
  
  function moveObj(someObj) {
      counter = 0;
      while (counter &lt; 30000) {
          subRunnerOBJ.leftPos = subRunnerOBJ.leftPos + subRunnerOBJ.velX * dt / 1000;
          subRunnerOBJ.topPos = subRunnerOBJ.topPos + subRunnerOBJ.velY * dt / 1000;
          hide1.style.left = subRunnerOBJ.leftPos + "px";
          hide1.style.top = subRunnerOBJ.topPos + "px";
          counter = counter + 50;
          if (counter == 3000) {
              stopRunning();
          }
      }
  }
  
  function stopRunning() {
      clearInterval(h);
      hide1.style.visibility = "hidden";
  }
  </code></pre>
  
  <p>with this function i can see the picture for less than a sec...
  how can i set the time here??</p>