<script language="JavaScript">
function timer(timer,ob)
{
timer--;
if(timer<0)timer=0;
document.getElementById(ob).innerHTML=timer;
setTimeout('timer('+timer+',"'+ob2+'")',1000)
}
</script>
<p id="t"></p>
<script language="JavaScript">
timer(10,'t');
</script>