$(document).ready(function() {
    $(".timer").everyTime(1000,function() {
        var html = $(this).html();
        html = html.split(":");

        horas = parseInt(html[0],10);
        minutos = parseInt(html[1],10);
        segundos = parseInt(html[2],10);

        segundos--;

        if (segundos < 0) {
            segundos = 59;
            minutos--;

            if (minutos < 0) {
                minutos = 59;
                horas--;

                if (horas < 0) {
                    segundos = 0;
                    minutos = 0;
                    horas = 0;
                    location.href = location.href;
                }
            }
        }

        var resultado = fillZeros(horas) + ":" + fillZeros(minutos) + ":" + fillZeros(segundos);        
        $(this).html(resultado);
    });
});

function fillZeros(value) {
    value = "" + value;
    if (value.length == 1) {
        value = "0" + value;
    }

    return value;
}