title: How my calculation can work with this format?
body: <p>I have a text box at top which displays the total duration. Now what happens is the user selects a duration from a timepicker and this will be displayed in the textbox and then add it into a new row. 
  Now the situation I have is that the format of the textbox is like this "00 Hrs 00 Mins 00 Secs".</p>
  
  <p>So for example if the total duration was 00 Hrs 30 Mins 00 Secs and if you select 00 Hrs 20 Mins 00 Secs from the timeicker (displayed in the textbox) and then add it into a new row, then 00 Hrs 30 Mins 00 Secs should minus 00 Hrs 20 Mins 00 Secs to make 00 Hrs 10 Mins 00 Secs.</p>
  
  <p>The thing is that I know how to do the calculation but I do not how to match it with in the 00 Hrs 00 Mins 00 Secs format. My calculation works for a normal number format but how can I get it working with this format?</p>
  
  <pre><code>    Below is my jquery code which does the calculation:
  
  var duration = '&lt;?php echo $_POST['durationChosen']; ?&gt;'
  
          $("#qandatbl td.duration input").live("change", function(){
              calculateDuration();
          });
  
          function calculateDuration()
          {
             var totalduration = duration;  
      //duration is the variable which displays total duration e.g 00 Hrs 30 Mins 00 Secs
             $("#qandatbl td.duration input").each(function (i, elm){
                  totalduration = totalduration - parseInt($(elm).val(), 10);
              });
  
              $("#total-duration").text(totalduration);
          }
  </code></pre>
  
  <p>Below is html code:</p>
  
  <pre><code>    &lt;table id="questionDuration"&gt;
      &lt;tr&gt;
           &lt;th colspan="2"&gt;
           Question Duration
           &lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
      &lt;td&gt;&lt;input type="text" id="questiondurationpicker" name="questionDuration" readonly="readonly" /&gt;&lt;/td&gt;
      // timepicker textbox for duration
      &lt;/tr&gt;
      &lt;tr&gt;
      &lt;td&gt;Total Duration Remaining: &lt;span id="total-duration"&gt;&lt;/span&gt;&lt;/td&gt;
      this is where the total duration is displayed
      &lt;/tr&gt;
      &lt;/table&gt;
  
  
      &lt;table id="qandatbl" border="1"&gt;
      &lt;tr&gt;
          &lt;th class="duration"&gt;Question Duration&lt;/th&gt;
      &lt;/tr&gt;
      &lt;/table&gt;
  
      // above is where the duration selected is stored in a new row
  </code></pre>