var shipWidth=365;
var ShipSpeed=3;
var xMax;
var xPos=0;
var xDir='right';
var shipRunning = true;
function initializeShip() {
   if (document.all) {
      xMax = document.body.clientWidth+370;
      document.all("ship").style.visibility="visible";
      }
   else if (document.layers||document.getElementById) {
      xMax=window.innerWidth+370;
      if (document.getElementById)
      document.getElementById("ship").style.visibility="visible"
      else
      document.layers["ship"].visibility="show";
      }
   setTimeout('moveShip()',400);
   }
function moveShip() {
   if (shipRunning==true) {
      calculatePosition();
      if (document.all) {
         document.all("ship").style.left=xPos+document.body.scrollLeft;
         }
      else if (document.layers) {
         document.layers["ship"].left=xPos+pageXOffset;
         }
      else if (document.getElementById) {
         document.getElementById("ship").style.left=xPos+pageXOffset;
         }
      setTimeout('moveShip()',50);
      }
   }
function calculatePosition() {
   if (xDir=="right") {
      if (xPos>(xMax-shipWidth-ShipSpeed)) {
         xDir="left";
         }
      }
   else if (xDir=="left") {
      if (xPos<(0+ShipSpeed)) {
         xDir="right";
         }
      }
   if (xDir=="right") {
      xPos=xPos+ShipSpeed;
      }
   else if (xDir=="left") {
      xPos=-370;
      }
   }
if (document.all||document.layers||document.getElementById){
window.onload=initializeShip;
window.onresize=new Function("window.location.reload()");
}