function setseconds()
{
 if (sec)
 {
  sec++;
  document.getElementById('seconds').innerHTML = sec;
 }
}

window.setInterval("setseconds()", 1000);
