title: timer using javascript
body: <p>I want implement timer using java script.I want to decrement timer with variation of interval.<br/>
  <strong>Example</strong>.Suppose my timer starts at 500 .<br/>
  I want decrement timer depending on the level such as<br/>
  1. 1st level timer should decrement by 1 also decrement speed should be slow.<br/>
  2.2nd level timer should decrement by 2 and decrement speed should be medium<br/>
  3.3rd level timer should decrement by 3 and decrement speed should be fast<br/></p>
  
  <p>I can create timer using following code:<br/></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var Timer;
  var TotalSeconds;
  function CreateTimer(TimerID, Time) 
  {
      TotalSeconds=Time;
      Timer = document.getElementById(TimerID);
      TotalSeconds = Time;
      UpdateTimer();
      setTimeout("Tick()", 1000);
  }
  
  function Tick() {
      TotalSeconds -= 10;
      if (TotalSeconds&gt;=1)
      {
          UpdateTimer();
          setTimeout("Tick()", 1000);
      }
      else
      {   
          alert(" Time out ");
          TotalSeconds=1;
          Timer.innerHTML = 1;
      }
  }
  </code></pre>
  
  <p>But i call this CreateTimer() function many times so its speed is not controlling because i call it many times.</p>