title: Random interval number
body: <p>I modified this countdown script to actually count up.</p>
  
  <p>Now it changes the innerHTML of the div "container" every 300 ms.</p>
  
  <p>How can i change that 300ms to be a random number between 300 and 2000?</p>
  
  <p>Thanks so much for all your help :P</p>
  
  <p>Greetz,
  Camillo</p>
  
  <pre><code>var time = 1; //How long (in seconds) to countdown
  function countDown(){
  time++;
  
  gett("container").innerHTML = time;
  if(time == 0){
  window.location = page;
  }
  }
  function gett(id){
  if(document.getElementById) return document.getElementById(id);
  if(document.all) return document.all.id;
  if(document.layers) return document.layers.id;
  if(window.opera) return window.opera.id;
  }
  function init(){
  if(gett('container')){
  setInterval(countDown, 300); // here instead of 300 a random number between 300 and 2000
  gett("container").innerHTML = time;
  }
  else{
  setTimeout(init, 50);
  }
  }
  </code></pre>