function load()
{
  new_factor();
}

function Gunload()
{
}

var Led_black_url = "../Images/led-black.gif";
var Led_red_url   = "../Images/led-red.gif";
var Led_green_url = "../Images/led-green.gif";
var Led_blink_url = "../Images/led-blink.gif";

var Led_black     = new Image();
Led_black.src = Led_black_url;
var Led_red       = new Image();
Led_red.src   = Led_red_url;
var Led_green     = new Image();
Led_green.src = Led_green_url;
var Led_blink     = new Image();
Led_blink.src = Led_blink_url;

var Datum = new Date()
var n = Datum.getTime()
var Puffer = new Image()
var last_pid = 0

function new_factor() {
  pid=++last_pid
  var factor = window.document.Form_Name.factor.options[window.document.Form_Name.factor.selectedIndex].value
  if (factor >= 0) {
    document.Led.src = Led_green.src
    neues_Bild(pid) }
  else {
    document.Led.src = Led_red.src }
}

function neues_Bild(pid) {
  if (pid == last_pid) {
    document.Led.src = Led_blink.src
    Puffer.src = Bild_url+"&n="+String(n++)
    Puffer.onload = kopiere_Puffer
    Timeout=window.setTimeout("neues_Bild("+(pid).toString()+")",2000) }
}

function kopiere_Puffer() {
  pid=++last_pid
  document.Bild.src = Puffer.src
  warten()
}

function warten() {
  var factor = window.document.Form_Name.factor.options[window.document.Form_Name.factor.selectedIndex].value
  if (factor >= 0) {
    document.Led.src = Led_green.src
    Timeout=window.setTimeout("neues_Bild("+(pid).toString()+")",factor) }
  else {
    document.Led.src = Led_red.src }
}


