function countdown(time, name, num){
   // grab the element object of the countdown container
   countdownElm = document.getElementById(name + num); 
   // calculate number of minutes from the seconds
   minutes = Math.floor(time / 60); 
   // remainder is number of seconds
   seconds = time % 60; 
   // add the current countdown display to the container specified
   countdownElm.innerHTML = '( ' + minutes + 'm ' + seconds + 's )';
   // if time is up remove the edit div, otherwise repeat every second
   if(time <= 0)
      countdownElm.innerHTML = '( 0m 0s )';
   else
      setTimeout('countdown(' + --time + ',"' + name + '","' + num + '");', 1000);
}

function textCounter(field,cntfield,maxlimit) {
    // if too long...trim it!
    if (field.value.length > maxlimit) {
        field.value = field.value.substring(0, maxlimit);
    } else {
        // otherwise, update 'characters left' counter
        cntfield.value = maxlimit - field.value.length;
    }
}
$.fn.delay = function(time, callback){
    // Empty function:
    jQuery.fx.step.delay = function(){};
    // Return meaningless animation, (will be added to queue)
    return this.animate({delay:1}, time, callback);
}

