title: storing the current value of countdown timer in variable for using in the template toolkit file
body: <p>I have a count down timer in the Hours left field, to find the hours left.
  I also have a field to enter the total estimated time and upon enetering the value of total estimated time, the timer will start.</p>
  
  <p>Now my requirement is when ever i changed the total estimated time, i want to get the value of timer, at that time to calculate the new value from where the timer starts again.</p>
  
  <p>for eg : 
  my first total estimated time = 3
  and when the timer reaches 02:00:00, i changed the total estimated time to 5, so my timer will reset from 04:00:00 (logic : 5-3+2 = 4 or 5-(3-2) = 4)</p>
  
  <p>so i want the current countdown timer value.HOw can i do this???</p>
  
  <p>my Timer.js file :</p>
  
  <pre><code>var Timer;
  var TotalSeconds;
  
  function CreateTimer(TimerID, Time) {
  Timer = document.getElementById(TimerID);
  TotalSeconds = Time;
  
  UpdateTimer()
  window.setTimeout("Tick()", 1000);
  }
  
  function Tick() {
  if (TotalSeconds &lt;= 0) {
  alert("Time's up!")
  return;
  }
  TotalSeconds -= 1;
  UpdateTimer()
  window.setTimeout("Tick()", 1000);
  }
  
  function UpdateTimer() {
  var Seconds = TotalSeconds;
  
  var Days = Math.floor(Seconds / 86400);
  Seconds -= Days * 86400;
  
  var Hours = Math.floor(Seconds / 3600);
  Seconds -= Hours * (3600);
  var TimeStr = ((Days &gt; 0) ? Days + " days " : "") + LeadingZero(Hours) + ":" +    LeadingZero(Minutes) + ":" + LeadingZero(Seconds);
  Timer.innerHTML = TimeStr;
  }
  
  function  LeadingZero(Time) {
  
  return (Time &lt; 10) ? "0" + Time : + Time;
  }
  </code></pre>
  
  <p>this is where i am calling my timer.</p>
  
  <pre><code>&lt;script type="text/javascript" src="./Timer.js"&gt;&lt;/script&gt;
  &lt;div id='timer'&gt;&lt;/div&gt;
  [% IF bug.estimated_time &gt;0 %]
  
  &lt;script type="text/javascript"&gt;
  var time;
  time = CreateTimer("timer",[% bug.estimated_time %]*3600);
  window.onload = CreateTimer("timer",[% bug.estimated_time %]*3600);
  
  &lt;/script&gt;
  [% END %]
  </code></pre>
  
  <p>here i want to call the function</p>
  
  <pre><code> &lt;tr&gt;
      &lt;td align="center"&gt;
        &lt;input name="estimated_time" id="estimated_time"
               value="[% PROCESS formattimeunit
                                 time_unit=bug.estimated_time %]"
               size="6" maxlength="6" onchange="updateRemainingTime();"&gt;
        &lt;input type = "Hidden" name="estimate_time" id="estimate_time" value="[% bug.estimated_time %]" size="6" maxlength="6"&gt;
  
      &lt;/td
  </code></pre>
  
  <p>on calling updateRemainingTime(), i want to take the current value of timer and using that, i want to reset the counter using the above mentioned logic....</p>