function timer(times, id_class, time_kon, time_r, load) {
function renderTimer() {
var hours = Math.floor(times / 3600);
var minutes = Math.floor((times / 60) % 60);
var seconds = times % 60;
if (hours < 1) {
hours = '';
} else {
hours += ' ч ';
}
if (minutes < 1) {
minutes = '';
} else {
minutes += ' м ';
}
if (time_kon - time_r < 1) {
seconds = '';
} else {
seconds += ' c ';
}
if (time_kon < time_r) {
if (typeof(load) !== "undefined" && load === 1) {
location.reload();
}
document.getElementById(id_class).innerHTML = '';
} else {
document.getElementById(id_class).innerHTML = (hours + minutes + seconds);
}
}
function TimeTimer2() {
times--;
time_r++;
renderTimer();
}
TimeTimer2();
setInterval(TimeTimer2, 1000);
}