function calcage(secs, num1, num2) {
    s = ((Math.floor(secs / num1)) % num2).toString();
    if (LeadingZero && s.length < 2) s = "0" + s;
    return s;
}
function CountBack(secs) {
    if (secs < 1) {
        doAjax('/onair/count_down', 'topCounter');
        return;
    }
    
    var hours = Math.floor((secs / 3600));
    if (hours < 10) hours = "00" + hours;
    else if (hours < 100) hours = "0" + hours;
    hours = hours.toString();
    $('#hoursHundred').html(hours.substr(0, 1));
    $('#hoursTen').html(hours.substr(1, 1));
    $('#hoursSingle').html(hours.substr(2, 1));
    var minutes = calcage(secs, 60, 60);
    if (minutes < 10) minutes = "0" + minutes;
    minutes = minutes.toString();
    $('#minutesTen').html(minutes.substr(0, 1));
    $('#minutesSingle').html(minutes.substr(1, 1));
    var seconds_new = calcage(secs, 1, 60);
    if (seconds_new < 10) seconds_new = "0" + seconds_new;
    seconds_new = seconds_new.toString();
    $('#secondsTen').html(seconds_new.substr(0, 1));
    $('#secondsSingle').html(seconds_new.substr(1, 1));
    if (CountActive) setTimeout("CountBack(" + (secs + CountStepper) + ")", SetTimeOutPeriod);
}