function get_all_elements ()
 {div01 = get_element ('div01_id');
  div02 = get_element ('div02_id');
  img01 = get_element ('img01_id');
  img02 = get_element ('img02_id');
  txt01 = get_element ('txt01_id');
  txt02 = get_element ('txt02_id');
  txt03 = get_element ('txt03_id');
  td01 = get_element ('td01_id');
  td02 = get_element ('td02_id');
  td03 = get_element ('td03_id');}

browser = get_browser ();  // Web-Browser
fhoehe = 0;      // Fensterhöhe
fbreite = 0;     // Fensterbreite
bhoehe = 0;      // Bild-Höhe
bbreite = 0;     // Bild-Breite
thoehe = 0;      // Text-Höhe
tbreite = 0;     // Text-Breite
shoehe = 0;      // Status-Höhe
sbreite = 0;     // Status-Breite
bloaded = false; // Zeiger: Bild geladen
mpos = 0;        // Bild-Position zur Mouse
mposx = 0;       // Mouse-Position für X-Achse
mposy = 0;       // Mouse-Position für Y-Achse
scrollx = 0;     // Scroll-Position für X-Achse;
scrolly = 0;     // Scroll-Position für Y-Achse;
okorr = 0;       // Korrektur für Opera
nkorr = 0;       // Korrektur für Netscape
ekorr = 0;       // Korrektur für Explorer

function init_picture (typ)
 {fhoehe = get_page_height ();
  fbreite = get_page_width ();
  shoehe = 0;
  sbreite = 0;
  bloaded = false;
  div01.style.width = "0px";
  div01.style.height = "0px";
  div02.style.width = "0px";
  div02.style.height = "0px";
  img01.src = "Pixel.gif";
  img01.style.width = "0px";
  img01.style.height = "0px";
  img01.style.borderWidth = "1px";
  img01.style.margin = "0px";
  img02.src = "Pixel.gif";
  img02.style.width = "0px";
  img02.style.height = "0px";
  txt01.firstChild.nodeValue = "";
  txt01.style.margin = "3px";
  txt02.firstChild.nodeValue = "";
  txt02.style.margin = "3px";
  txt03.firstChild.nodeValue = "";
  td01.style.borderWidth = "0px";
  td01.style.backgroundColor = "transparent";
  td02.style.borderWidth = "0px";
  td02.style.backgroundColor = "transparent";
  td02.style.width = "200px";
  td03.style.borderWidth = "0px";
  td03.style.backgroundColor = "transparent";
  if (browser == "Opera")
   {okorr = 1;}
  else if (browser == "Netscape")
   {nkorr = 1;
    if (typeof (document.addEventListener) == "function")
     {document.addEventListener ("mousemove", check_mouse_position, true);}}
  else if (browser == "Explorer")
   {ekorr = 1;}}

function check_scroll_position ()
 {scrollx = 0;
  if (window.pageXOffset)
   {scrollx = window.pageXOffset;}
  else if (document.body && document.body.scrollLeft)
   {scrollx = document.body.scrollLeft;}
 scrolly = 0;
 if (window.pageYOffset)
   {scrolly = window.pageYOffset;}
  else if (document.body && document.body.scrollTop)
   {scrolly = document.body.scrollTop;}}

function check_mouse_position (event)
 {mposx = event.pageX;
  mposy = event.pageY;}

function show_picture (hoehe, breite, richtg, bild, txt)
 {div01.style.visibility = 'visible';
  div02.style.visibility = 'visible';
  div02.style.height = "100px";
  div02.style.width = "100px";
  img02.src = "YinYang.gif";
  img02.style.height = "0px";
  img02.style.width = "0px";
  bloaded = false;
  check_scroll_position ();
  show_status ();

  if (!bloaded)
   {td03.style.borderWidth = "1px";
    td03.style.backgroundColor = "#FFFFE0";
    switch_status ();}

  switch (richtg)
   {case 'L': bhoehe = hoehe;
              bbreite = breite + okorr * 3;
              if (breite > hoehe)
               {thoehe = 25;
                tbreite = 0;}
              else
               {thoehe = 0;
                tbreite = 100;}
              mpos = 15 + ekorr * 10;
              div01.style.height = bhoehe + thoehe + "px";
              div01.style.width = bbreite + tbreite + "px";
              img01.src = bild;
              img01.style.width = breite + "px";
              img01.style.height = bhoehe + okorr + "px";
              if (breite > hoehe)
               {img01.style.marginRight = "0px";
                img01.style.marginBottom = "3px";
                txt01.firstChild.nodeValue = "";
                txt02.firstChild.nodeValue = txt;
                td01.style.width = "0px";
                td01.style.borderWidth = "0px";
                td01.style.backgroundColor = "transparent";
                td02.style.borderWidth = "1px";
                td02.style.backgroundColor = "#FFFFE0";}
              else
               {img01.style.marginRight = "3px";
                img01.style.marginBottom = "0px";
                txt01.firstChild.nodeValue = txt;
                txt02.firstChild.nodeValue = "";
                td01.style.width = "100px";
                td01.style.borderWidth = "1px";
                td01.style.backgroundColor = "#FFFFE0";
                td02.style.borderWidth = "0px";
                td02.style.backgroundColor = "transparent";}
              break;

    case 'R': bhoehe = hoehe;
              bbreite = breite + okorr * 3;
              if (breite > hoehe)
               {thoehe = 25;
                tbreite = 0;
                mpos = (breite * -1) - 16 + ekorr * 5;}
              else
               {thoehe = 0;
                tbreite = 100;
                mpos = ((bbreite + tbreite + 20) * -1) + ekorr * 5;}
              div01.style.height = bhoehe + thoehe + "px";
              div01.style.width = bbreite + tbreite + "px";
              img01.src = bild;
              img01.style.width = breite + "px";
              img01.style.height = bhoehe + okorr + "px";
              if (breite > hoehe)
               {img01.style.marginRight = "0px";
                img01.style.marginBottom = "3px";
                txt01.firstChild.nodeValue = "";
                txt02.firstChild.nodeValue = txt;
                td01.style.width = "0px";
                td01.style.borderWidth = "0px";
                td01.style.backgroundColor = "transparent";
                td02.style.borderWidth = "1px";
                td02.style.backgroundColor = "#FFFFE0";}
              else
               {img01.style.marginRight = "3px";
                img01.style.marginBottom = "0px";
                txt01.firstChild.nodeValue = txt;
                txt02.firstChild.nodeValue = "";
                td01.style.width = tbreite + "px";
                td01.style.borderWidth = "1px";
                td01.style.backgroundColor = "#FFFFE0";
                td02.style.borderWidth = "0px";
                td02.style.backgroundColor = "transparent";}
              break;

    default: alert ('Es wurde keine gültige Typ übergeben !');
             break;}}

function move_picture ()
 {if (browser != "Netscape")
   {mposx = window.event.x;
    mposy = window.event.y;}

  if (browser == "Netscape")
   {div01.style.left = mposx + mpos + "px";
    div01.style.top = mposy + "px";
    div02.style.left = mposx + mpos + (bbreite / 2) - 150 + "px";
    div02.style.top = mposy + (bhoehe / 2) - 50 + "px";}
  else
   {div01.style.left = mposx + mpos + "px";
    div01.style.top = mposy + scrolly + "px";
    div02.style.left = mposx + mpos + (bbreite / 2) - 150 + "px";
    div02.style.top = mposy + scrolly + (bhoehe / 2) - 50 + "px";}}

function hide_picture ()
 {div01.style.visibility = 'hidden';
  div02.style.visibility = 'hidden';
  init_picture ();}

function show_status ()
 {if ((shoehe < 100) && (!bloaded))
   {shoehe = shoehe + 5;
    sbreite = sbreite + 5;
    img02.style.height = shoehe + "px";
    img02.style.width = sbreite + "px";

    setTimeout ("show_status ()", 20);}}

function hide_status ()
 {bloaded = true;
  txt03.firstChild.nodeValue = "";
  td03.style.borderWidth = "0px";
  td03.style.backgroundColor = "transparent";
  if (shoehe > 0)
   {shoehe = shoehe - 5;
    sbreite = sbreite - 5;
    img02.style.height = shoehe + "px";
    img02.style.width = sbreite + "px";

    setTimeout ("hide_status ()", 20);}}

function switch_status ()
 {if (!bloaded)
   {if (txt03.firstChild.nodeValue == "Das Bild wird geladen ...")
     {txt03.firstChild.nodeValue = "Einen Moment Geduld bitte ...";}
    else
     {txt03.firstChild.nodeValue = "Das Bild wird geladen ...";}

    setTimeout ("switch_status ()", 2500);}}

