//zug.js - animierter Feldbahnzug
//© Softwarehaus Frank Engel & Uwe Walter GbR, Kornwestheim, Deutschland
//mail@engel-und-walter.de

var Position;
var Geschwindigkeit = 1;
var Abstand = 3;

var Lok, LLok;
var Lore, LLore;

function ZugInit()
{
  if (document.getElementById)
  {
    Lok=eval(document.getElementsByName("lok")[0]);
    LLok=Lok.width;
    Lok.style.position="absolute";
    Lok.style.top=Abstand;
    Lok.style.left=-LLok;
    Position=-LLok;
    var i=0;
    while (document.getElementsByName("lore")[i]!=null)
    {
      Lore=eval(document.getElementsByName("lore")[i]);
      Lore.style.position="absolute";
      Lore.style.top=Lok.height-Lore.height+Abstand;
      Lore.style.left=-Lore.width;
      i+=1;
    }
    ZugFahrt();
  }
}

function ZugFahrt()
{
  Position=Position+Geschwindigkeit;
  Lok.style.left=Position;
  var i=0; LLore=0;
  while (document.getElementsByName("lore")[i]!=null)
  {
    Lore=eval(document.getElementsByName("lore")[i]);
    LLore=LLore+Lore.width;
    Lore.style.left=Position-(LLore);
    i++;
  }
  if (Position-LLore>=screen.width)
    Position=-LLok;
  window.setTimeout("ZugFahrt()",100);
}

function Klick()
{
  win=window.open("about:blank","Copyright","width=380,height=250,left=0,top=0");
  win.document.open;
  win.document.writeln('<html><head><title>www.engel-und-walter.de</title>');
  win.document.writeln('<style type="text/css"><!--');
  win.document.writeln('h1 {font:bold italic 16pt Arial; text-decoration:underline;}');
  win.document.writeln('p  {font:11pt Arial;}');
  win.document.writeln('--></style></head><body><div align="center">');
  win.document.writeln('<p>Das Script für diese Animation wurde erstellt vom</p><br>');
  win.document.writeln('<p><h1>Softwarehaus<br>Frank Engel &amp; Uwe Walter GbR</h1><br>');
  win.document.writeln('Bolzstraße 95<br>');
  win.document.writeln('D-70806 Kornwestheim<br><br>');
  win.document.writeln('<a href="mailto:mail@engel-und-walter.de">mail@engel-und-walter.de</a></p>');
  win.document.writeln('</div></body></html>');
  win.document.close;
}
