<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>javascript timer</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<h1 id="timer">0 сек.</h1>
<div style="display:none;" id="glass"> скрит елементъ, който се показва след 45 секунди!</div>
<script>
function timer(){
var timers = document.getElementById('timer');
if( parseInt(timers.innerHTML) < 2){
timers.style.display = 'none';
document.getElementById('glass').style.display = "block";
}else{
timers.innerHTML = parseInt(timers.innerHTML) + 1 + ' сек.' ;
setTimeout(timer, 1000)
}
}
timer();
</script>
</body>
</html>