function sec() { if(time<0) { clearInterval(intervalID); cur_answer = count_answer; check() } else { document.getElementById('time').innerHTML=time + ' сек'; time=time-1; } }