jQuery countdown - Remove highlightLast5 color when time is reset

jQuery countdown - Remove highlightLast5 color when time is reset

Hi
I'm using the Countdown timer code I found here: keith-wood.name/countdown.html
Its quite comprehensive in its features however I've one little problem.
I've got a form which sets the time for the countdown and if the time is less than 5 minutes it turns red. However if the time runs out and is reset or is reset after its within the 5 minute mark the text stays red instead of going back to black. I tried adding a simple else statement to the highlightLast5 statement but this hasn't add any effect. Does anybody here have any suggestions?


highlightLast5 function:
  1. function highlightLast5(periods) {
  2.     if ($.countdown.periodsToSeconds(periods) <= 300) {
  3.         $(this).addClass('highlight')
  4.     } else {
  5.         $(this).removeClass('highlight')    
  6.     };
  7. };

Here is the code that creates the initial timer (there's a bit of Ajax before it that I haven't included)

  1.         success: function(examlength) {
  2.             if (countdownExists <= 0) {
  3.                 $('#pauseResume').countdown({
  4.                     until: examlength,
  5.                     onTick: highlightLast5,
  6.                     format: 'HMS'
  7.                 });

  8.                 countdownExists = countdownExists + 1;
  9.             } else {
  10.                 $('#pauseResume').countdown('destroy');
  11.                 $('#pauseResume').countdown({
  12.                     until: examlength,
  13.                     onTick: highlightLast5,
  14.                     format: 'HMS'
  15.                 });
  16.             }
  17.         }