<html><head>
<title>New Page 1</title>
<script>
 var x=0,y=0,dx=50,dy=50;
 var clearId=null;
 var interVal=1000;
 var win=null;
 var w=300,h=200;
 
 win=window.open("","","width=300,height=200");
 win.moveTo(0,0);
function startGame()
{    
      if(x>window.screen.availWidth-w || x<0) 
      {
          dx=-dx;
      }
      if(y>window.screen.availHeight-h || y<0)
      {
          dy=-dy;
      }
      x+=dx;
      y+=dy;
      win.moveTo(x,y);
      clearId=setTimeout("startGame()",interVal);
}function StopGame()
{
      clearTimeout(clearId);
}
</script>
</head><body onLoad="startGame()"><p align="center"> </p>
<div align="center">
  <center>
  <table border="1" width="403" height="74">
    <tr>
      <td width="403" height="74"><input type=button value=" Stop " onClick="StopGame()"></td>
    </tr>
  </table>
  </center>
</div></body></html>