title: keeping track of an image javascript
body: <p>So im creating my own slider using javascript. I have 12 images total. 6 50x50, and 6 200x200.  The smaller images switch from 1,2,3,4,5,6 and back to 1. When ever the image is clicked on a larger image is suppose to open in a new window.  The problem is when i click on the 6th smaller image and the pop up window is opened the image is broken.  I have debugged it and see the problem is that when I open up the image i am alerted that the pop is opening up 0.</p>
  
  <p>Any help would be appreciated.  It is most likely something simple that I am not seeing.</p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;
  
  &lt;html&gt;
  &lt;head&gt;
  &lt;script&gt;
  
  number=1
  function move(){
  brillo.src="images/tudelude_0"+number+".jpg"
  number++
  
   if (number&gt;6) number=1
   setTimeout("move()",1000)
  
   }
  
  
  function Open(){
  t=number-1
  
  var newWindow = window.open("", "pictureViewer", "fullscreen=no");
  newWindow.document.writeln("&lt;img src='images/tude_0"+t+".jpg'/&gt;");
  alert(t)
  newWindow.document.close(); 
  }
  
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body onload="move()"&gt;
  
  &lt;div class="box"&gt;
   &lt;img src="images/tudelude_01.jpg" name="brillo" 
   onclick="Open(); return true;"&gt;
   &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>