<html>
<head>
<script type="text/javascript">
function start()
{
var a = document.getElementById("tar").value;
var b = document.getElementById("sred").value;
var inter = setInterval(function ()
{
a--;
b -= 0.5;
if (a == 0)
{
clearInterval(inter)
alert(a)
alert(b)
}
}, 10)
}
</script>
</head>
<body>
<form name="myForm">
<input name="tar" id="tar">
<input name="sred" id="sred">
<input type="button" value="PUSH" onclick="start()">
</form>
</html>
Ну вот как-то так.