title: Javascript Display one image per minute depending on time of the day
body: <p>I am a newbie in JavaScript. I am trying to create a javascript that displays one single, different photo every minute of the day.</p>
  
  <p>I am filling up a folder with 1440 images (one for each minute). The files are named accordingly (ie: for 2:45 the image will be <code>0245.jpg</code>).</p>
  
  <p>What I am doing so far is created a clock that displays time, but I need to use those strings to request a new object with that name. I have tried a few options, but none of them work. Probably something simple for advanced guys, but I just can't make it work.
  This is what I 've tried so far (many versions):</p>
  
  <pre><code>*function date_time(id)
  {
          date = new Date;
          year = date.getFullYear();
          month = date.getMonth();
          months = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
          d = date.getDate();
          day = date.getDay();
          days = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
          h = date.getHours();
          if(h&lt;10)
          {
                  h = "0"+h;
          }
          m = date.getMinutes();
          if(m&lt;10)
          {
                  m = "0"+m;
          }
          s = date.getSeconds();
          if(s&lt;10)
          {
                  s = "0"+s;
          }
          result = ''+days[day]+' '+months[month]+' '+d+' '+year+' '+h+':'+m;
          document.getElementById(id).innerHTML = result;
          setTimeout('date_time("'+id+'");','60000');
          return true;
  }
  setInterval(function() {
      var minutePhotoElement = document.getElementById('minutePhoto');
      minutePhoto.src = "'img/('result').jpg'";
  }, 60000);
  //--&gt;*
  </code></pre>