<script>
function timer(){
var m = document.getElementById('min');
var s = document.getElementById('sec');
if ( m.innerHTML == 0 && s.innerHTML == 0 )
{
setTimeout(function(){},1000);
alert('тратата');
}
else
{
if (s.innerHTML != 0) {s.innerHTML--; setTimeout(timer,1000) }
else
{
m.innerHTML--;
s.innerHTML = '59';
setTimeout(timer,1000)
}
}
}
window.onload = function(){
var check;
var a = document.getElementById('timer');
a.onclick = function(){
if (!check) {check = true; return timer();}
return false;
}
}
</script>
<a href="#" id="timer"><span id='min'>60</span>:<span id='sec'>0</span></a>