function init_move() { dx = 1 init_time = setInterval(function() { var x = parseInt(document.all.pic.style.left); document.all.pic.style.left = x + dx; if (x > document.documentElement.clientWidth) clearInterval(init_time); }, 8) }