<html><head><style>#red{width:20px;height:20px;display:block;position:absolute}</style></head><body>
<div id="red" style="top:20px;left:20px;background-color:yellow"></div>
<script>var moo = setInterval(function () {
var cube = document.getElementById('red'),
top = parseInt(cube.style.top), left = parseInt(cube.style.left);
if(top > 100) { cube.style.backgroundColor='red'; clearInterval(moo); }
cube.style.top = (top + 5) +'px';
cube.style.left = (left + 5) +'px';
}, 100)</script></body></html>
Остальное сам допишешь, мну ужо лень.