var thePlane;
var yPos = 0;
var xPos = 0;
var dSign = 1;

function doFancyPlane()
{
    if ( document.getElementById )
        thePlane = document.getElementById("Plane");
    else if ( document.layers )
        thePlane = document.layers["Plane"];
    else if ( document.all )
        thePlane = document.all.item("Plane");

    if ( thePlane )
    {
        showObj( thePlane );
        doRightToLeft();
    }
}

function moveObjTo( obj, x, y )
{
    if ( ! obj.style )
    {
        obj.top = y;
        obj.left = x;
    }
    else
    {
        obj.style.top = y + "px";
        obj.style.left = x + "px";
    }
}


function showObj( obj )
{
    if ( ! obj.style )
        obj.visibility = "visible";
    else
        obj.style.visibility = "visible";
}

function hideObj( obj )
{
    if ( ! obj.style )
        obj.visibility = "hidden";
    else
        obj.style.visibility = "hidden";
}

function doRightToLeft()
{
    xPos = 500;
    dSign = 1;
    moveObjTo( thePlane, xPos, yPos );
    showObj( thePlane );
    moveHoriz();
}

function moveHoriz()
{
    var dec = Math.sqrt(xPos);
    xPos -= dec;
    if ( 0 < xPos )
    {
        moveObjTo( thePlane, (xPos * dSign), yPos );
        setTimeout( "moveHoriz()", 40 );
    }
    else
    {
        moveObjTo( thePlane, 0, 0 );
    }
}
