Вот код: <script type='text/javascript'> //Создание таймера function create_target_date(){ var target_date = new Date(); //target_date.setDate(target_date.getDate()+1); target_date.setHours(23,59,59); return target_date; } //Вычисление function calculation_timer(){ var target_date = create_target_date(); var current_date = new Date(); val_timer = target_date.getTime() - current_date.getTime(); var hh = Math.floor(val_timer/1000/60/60); var mm = Math.floor((val_timer-hh*60*60*1000)/1000/60); var ss = Math.floor(((val_timer-hh*60*60*1000)-mm*60*1000)/1000); if (hh < 10) {hh = "0"+hh;} if (mm < 10) {mm = "0"+mm;} if (ss < 10) {ss = "0"+ss;} document.getElementById('hours').innerHTML = hh; //document.getElementById('hours_legend').innerHTML = format_legend(hours,['час','часа','часов']); document.getElementById('minutes').innerHTML = mm; //document.getElementById('minutes_legend').innerHTML = format_legend(minutes,['минута','минуты','минут']); document.getElementById('seconds').innerHTML = ss; //document.getElementById('seconds_legend').innerHTML = format_legend(seconds,['секунда','секунды','секунд']); } //Запуск таймера function start_timer(){ calculation_timer(); id_timer = setInterval(calculation_timer,1000); } /* //Формирование нужного падежа надписей function format_legend(time,legend){ var text = ''; if (time >=11 && time <=14) { text = legend[2]; } else { time = time % 10; if (time == 1) text = legend[0]; else if(time>=2 && time<=4) text = legend[1]; else text = legend[2]; } return text; } */ $(document).on('ready', function(){ start_timer(); console.log(1); });</script> <link href='http://fonts.googlea...in,cyrillic-ext' rel='stylesheet' type='text/css'> <style type='text/css'> .action_timer{font: 34px Open Sans;color: rgb(255, 255, 255);padding: 10px 10px 5px 10px;text-align: center;display: block;margin-bottom: 17px;background: linear-gradient(to bottom, rgb(148, 48, 50), rgb(100, 0, 2)) repeat scroll 0% 0% transparent;border-radius: 3px;border-color: rgb(129, 29, 31) rgb(84, 0, 0) rgb(52, 0, 0);border-width: 1px;border-style: solid;box-shadow: 0px 4px 4px rgb(136, 68, 68) inset;} .action_timer span{margin-bottom: 5px;background:linear-gradient(to bottom,#353535,#0E0E0E) repeat scroll 0 0 transparent;border-radius:5px;padding:9px 4px;display:inline-block;vertical-align:middle;text-align:center;border-width:1px;border-style:solid;border-color:#322C2C #171515 #000;position:relative;letter-spacing:12px;text-shadow:-1px 3px 2px #000;width:50px;box-shadow:0 0 1px #505050 inset} .action_timer span:after{position: absolute;content: "";display: block;height: 100%;top: 0px;left: 50%;width: 1px;background: #121212;box-shadow: 0px 0px 1px #3b3b3b;}</style>{/literal} <div class="action_timer"> До конца акции осталось: <span id='hours'></span> : <span id='minutes'></span> : <span id='seconds'></span></div> Движок: Simpla