(function(){ window.dnl = function(e) { setTimeout(function() { document.body.className += ' overlay'; }, 300); return true; } window.undnl = function() { document.body.className += ' hiding'; setTimeout(function() { document.body.className = document.body.className.slice(0, document.body.className.indexOf('overlay') - 1); }, 300); } window.onload = function() { document.body.className = /yabrowser|firefox|\sOPR\//i.test(window.navigator.userAgent) ? 'up' : 'down'; var timer = document.getElementById('timer'); var startCount = timer.getAttribute('data-time'); var timerPlay = setInterval(function() { startCount--; var minutes = Math.floor(startCount / 60); minutes = minutes < 10 ? '0' + minutes : minutes; var seconds = startCount % 60 ; seconds = seconds < 10 ? '0' + seconds : seconds; timer.innerText = minutes + ' мин. ' + seconds + ' сек.'; if (startCount < 1) { var link = document.getElementById('skip-link'); if (link.href != '') link.click(); clearInterval(timerPlay); } }, 1000); } })(); function popup(id) { var el = document.getElementById(id); var name = "active"; var arr = el.className.split(" "); if (arr.indexOf(name) == -1) { el.className += " " + name; } else { el.className = el.className.replace(/\s\bactive\b/g, ""); } }