// Copyright 18 Mar 1999, Cavalry Outpost Publications.

// This program displays a "hovering" image and a incorporates a hypertex
// link (if so defined), which is displayed independently, floating across
// and down the normal HTML page presentation.

// *********************************************************************
// **********     Program Name = Phantom.js  Ver 03.12.30     **********
// *********************************************************************

// The following syntax must be added to the HTML of the "host" program.
// (after the </TITLE> tag and before the </HEAD> tag).

// <SCRIPT Language="JavaScript"
//        SRC="http://www.first-team.us/js_files/phantom.js">
// </SCRIPT>

// <DIV ID="phantom" STYLE="position:absolute;visibility:hidden">
// <A HREF="http://www.first-team.us/alumniae/reunion/">
// <IMG SRC="http://www.first-team.us/1cd_assn/reunion/reunion.gif" WIDTH="140" HEIGHT="30" BORDER="0" ALT="Reunion 2004 Link"></A>
// </DIV>

// A. Movement Parameters
if (window.innerWidth) {
        endX = window.innerWidth;
        endY = 2 * window.innerWidth;
}
  else  {
        endX = 800;
        endY = 1600;
}
startX = 0;
startY = 0;
deltaX = 1;
deltaY = 2;
movePeriod = 50;

// B. Movement Code
function movement() {
        if(currentY >= endY || currentX >= endX) {
                currentX = startX;
                currentY = startY;
        }
         else {
                currentX += deltaX;
                currentY += deltaY;
        }
}

function setPosition(x,y) {
        divStyle.left = currentX;
        divStyle.top = currentY;
}

function moveDiv() {
        movement();
        setPosition();
}

function moveImage() {
        if(!document.all) {
                document.all = document;
        }
        if(!document.all.phantom.style) {
                document.all.phantom.style = document.all.phantom;
        }
        divStyle = document.all.phantom.style;
        currentX = startX;
        currentY = startY;
        setPosition(currentX, currentY);
        divStyle.visibility = "visible";
        setInterval("moveDiv()",movePeriod);
}

window.onload = moveImage;
