var start = 5;setInterval(function() { if (start == -1) { start = 5; } alert(start); start--;}, 1000);