// --- Mover für Bilder
var x = -50;                            // Startposition des Images
var y_baseline = 100;                   // y-Startwert (Mittellinie für Sinusbewegung)
var y_max = 600;
var timeout = 20;                       // Bewegungsdelay (20=flüssige Bewegung)
var x_step_size = 2;                    // Schrittweite in x-Richtung
var x_max                               // Max. Breite des Fensters innen

function place_pic()
{
 document.write("<div id='iepic' style='position:absolute;top:0px;left:-100px;height:77px;width:100px'>");
 document.write("<img src='Animation_Traktor.gif' name=pic></div>");
}

function move_object()
{
 setTimeout("set_parameters()", Math.round(Math.random()*100000));
}

function delay()
{
     document.all.iepic.style.visibility="visible";
     y = y_baseline + Math.round(20*Math.sin(0.02 * x));
     document.all.iepic.style.top = y;
     document.all.iepic.style.left = x;
     x = x + x_step_size;
     if (x < x_max)
        {setTimeout("delay()", timeout);}
     else
        {
         document.all.iepic.style.visibility="hidden";
         document.all.iepic.style.top = 100;
         document.all.iepic.style.left = 0;
         setTimeout("move_object()",30000);
        }
}

function set_parameters()
{
 x_max = document.body.offsetWidth-50;
 y_max = document.body.offsetHeight;
 y_baseline = Math.round(Math.random()* (y_max))
 x=-50;
 delay();
}

