<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript">
function initSoccerBall()
{
document.getElementById("soccerBall").animationTimer = setInterval('doit()',50);
}
function doit(){
moveObject(document.getElementById("soccerBall"),500,0,25)
}
function moveObject(target,destinationLeft,destinationTop,maxSpeed)
{ var currentLeft = parseInt(retrieveComputedStyle(target,"left"));
var currentTop = parseInt(retrieveComputedStyle(target,"top"));
if(isNaN(currentLeft))
{
currentLeft = 0;
}

if(isNaN(currentTop))
{
currentTop = 0;
}

if(currentLeft < destinationLeft)
{
currentLeft += maxSpeed;
if(currentLeft > destinationLeft)
{
currentLeft = destinationLeft;
}
}
else
{
currentLeft -= maxSpeed;
if (currentLeft < destinationLeft)
{
currentLeft = destinationLeft;
}
}

if(currentTop < destinationTop)
{
currentTop += maxSpeed;

if(currentTop > destinationTop)
{
currentTop = destinationTop;
}
}
else
{
currentTop -= maxSpeed
if(currentTop < destinationTop)
{
currentTop = destinationTop;
}
}

target.style.left = parseInt(currentLeft);
target.style.top = parseInt(currentTop);
if(currentLeft == destinationLeft && currentTop == destinationTop)
{
clearInterval(target.animationTimer);
}
}function retrieveComputedStyle(target,position)
{
var num = null;
if (position == "left")
{
num = target.offsetLeft;
}
else
{
num = target.offsetTop;
}
return num;
}
</script></head><body  onload="initSoccerBall();">
<img src="20073315204866045.jpg" width="200" height="150" id="soccerBall" style="position:absolute;z-index:2;left:15px;top:150px;"/>
</body>
</html>