  var mozilla   = (document.all) ? false : true ;


  // ------------------
  // Cursor-Koordinaten
  // ------------------
  var BH_mouseTop = -1, BH_mouseLeft = -1 ;

  // --------------------
  // BubbleHelp-Variablen
  // --------------------
  var bubbleHelp, bhElement ;
  // var displayBubbleHelp      = false ;      /* Container - Anzeigestatus    */
  var bubbleHelpTextModified = false ;      /* Container - Textbearbeitung  */
  var bubbleHelpText         = "" ;         /* Container - Text             */
  var bubbleHelpWidth        = 150 ;        /* Container - Breite           */
  var bubbleHelpHeight       = 20 ;         /* Container - Hoehe            */
  // var bubbleHelpBgColor      = "#6699cc" ;  /* Container - Hintergrundfarbe */
  var bubbleHelpBgColor      = "#ffffcc" ;  /* Container - Hintergrundfarbe */
  var bubbleHelpFontColor    = "#000000" ;  /* Container - Schriftfarbe     */
  var bubbleHelpFontStyle    = "Arial" ;    /* Container - Schriftart       */
  var bubbleHelpFontSize     = "12px" ;     /* Container - Schriftart       */
  var bubbleHelpBorderColor  = "#000000" ;  /* Container - Rahmenfarbe      */

  var bubbleHelpTextModified = false ;      /* Switch - new BubbleHelp text */
  var bubbleHelpEOB          = false ;      /* Switch - End of Bottom Space */

  var bubbleHelpTransparence = false ;      /* Container - transparent      */

  var bubbleHelpBorderString ;

  // =========================
  //
  //     F u n c t i o n s
  //
  // =========================

  function BH_sue(z,s,e,a)
  {
    var i=0,o=0,st=0,fm=(z.substring(0,10)=="[FULLMODE]");
    if (fm) z=z.substring(10,z.length);
    while (o>-1&&(a==0||i<a))
    {
      i++; o=(fm) ? z.indexOf(s):z.indexOf(s,st); if (o>-1) z=z.substring(0,o)+e+z.substring(o+s.length); st=(fm) ? 0:o+e.length;
    }
    return z;
  }

  function BH_ModifyBubbleHelpText(text)
  {
    var tagFound = false ;
    for (i=0; i<text.length; i++)
    {
      if (text.substr(i,1) == "<")  tagFound = true ;
      if (text.substr(i,1) == ">")  tagFound = false ;
      if (!tagFound)
      {
        if (text.substr(i,1) == " " && bubbleHelpWidth < 1)
        {
          text = text.substring(0,i) + "&nbsp;" + text.substr(i+1) ;
          i += 5 ;
        }
        if (text.substr(i,1) == "-" && !mozilla)
        {
          text = text.substring(0,i) + "&#8722;" + text.substr(i+1) ;
          i += 6 ;
        }
      }
    }
    text = BH_sue(text, "<table>", "<table border=0 cellspacing=0 cellpadding=0>", 0) ;
    text = BH_sue(text, "<td>", "<td style=\"text-align:left; vertical-align:top; border:1px solid " + bubbleHelpBorderColor + "; background-color:" + bubbleHelpBgColor + "\"><span style=\"font-family:" + bubbleHelpFontStyle + "; font-size:" + bubbleHelpFontSize + "; color:" + bubbleHelpFontColor+";\">", 0) ;
    text = BH_sue(text, "</td>", "</span></td>", 0) ;
    bubbleHelpTextModified = true ;
    return text ;
  }


  function SBHD()  { BH_SetBubbleHelpDefaults() ; }
  function BH_SetBubbleHelpDefaults()
  {
    bubbleHelpTextModified=false; bubbleHelpText=""; bubbleHelpWidth=10; bubbleHelpBgColor="#ffffcc";
    bubbleHelpFontColor="#000000"; bubbleHelpFontStyle="Arial"; bubbleHelpFontSize="12px";
    bubbleHelpBorderColor="#000000";
  }

  function SBHV()  { BH_SetBubbleHelpValues() ; }
  function BH_SetBubbleHelpValues()    /* Style: Windows */
  {
    bubbleHelpWidth       = 0 ;
    bubbleHelpBgColor     = "#ffffcc" ;
    bubbleHelpFontColor   = "#000000" ;
    bubbleHelpFontStyle   = "Arial" ;
    bubbleHelpFontSize    = "10px" ;
    bubbleHelpBorderColor = "#000000" ;
    bubbleHelpText        = BH_ModifyBubbleHelpText(bubbleHelpText) ;
  }

  function SBHVK()  { BH_SetBubbleHelpValuesKamila() ; }
  function BH_SetBubbleHelpValuesKamila()
  {
    bubbleHelpWidth       = 500 ;
    bubbleHelpHeight      = 340 ;
    bubbleHelpBgColor     = "#ffffcc" ;
    bubbleHelpBorderColor = "#000000" ;
    bubbleHelpText        = BH_ModifyBubbleHelpText(bubbleHelpText) ;
  }

  function SBHVS()  { BH_SetBubbleHelpValuesSvadba() ; }
  function BH_SetBubbleHelpValuesSvadba()
  {
    bubbleHelpWidth       = 400 ;
    bubbleHelpHeight      = 400 ;
    bubbleHelpBorderColor = "#800000" ;
    bubbleHelpText        = BH_ModifyBubbleHelpText(bubbleHelpText) ;
  }

  function SBHVT()  { BH_SetBubbleHelpValuesTransparence() ; }
  function BH_SetBubbleHelpValuesTransparence()    /* Style: transparent */
  {
    bubbleHelpWidth        = 40 ;
    bubbleHelpHeight       = 40 ;
    bubbleHelpTextModified = true ;
    bubbleHelpTransparence = true ;
  }

  function SBHV1()  { BH_SetBubbleHelpValues1() ; }
  function BH_SetBubbleHelpValues1()    /* Style: Windows */
  {
    bubbleHelpWidth       = 0 ;
    bubbleHelpBgColor     = "#ffffcc" ;
    bubbleHelpFontColor   = "#000000" ;
    bubbleHelpFontStyle   = "Arial" ;
    bubbleHelpFontSize    = "10px" ;
    bubbleHelpBorderColor = "#000000" ;
    bubbleHelpText        = BH_ModifyBubbleHelpText(bubbleHelpText) ;
  }

  function SBHV2a()  { BH_SetBubbleHelpValues2a() ; }
  function BH_SetBubbleHelpValues2a()    /* Style: WebCR - Arial */
  {
    bubbleHelpWidth       = 0 ;
    bubbleHelpBgColor     = "#ffffcc" ;
    bubbleHelpFontColor   = "#000000" ;
    bubbleHelpFontStyle   = "Arial" ;
    bubbleHelpFontSize    = "12px" ;
    bubbleHelpBorderColor = "#336666" ;
    bubbleHelpText        = BH_ModifyBubbleHelpText(bubbleHelpText) ;
  }

  function SBHV2c()  { BH_SetBubbleHelpValues2c() ; }
  function BH_SetBubbleHelpValues2c()    /* Style: WebCR - Courier */
  {
    bubbleHelpWidth       = 0 ;
    bubbleHelpBgColor     = "#ffffcc" ;
    bubbleHelpFontColor   = "#000000" ;
    bubbleHelpFontStyle   = "Courier New" ;
    bubbleHelpFontSize    = "12px" ;
    bubbleHelpBorderColor = "#336666" ;
    bubbleHelpText        = BH_ModifyBubbleHelpText(bubbleHelpText) ;
  }

  function SBHV3()  { BH_SetBubbleHelpValues3() ; }
  function BH_SetBubbleHelpValues3()    /* Style: DINGO-BubbleHelp */
  {
    bubbleHelpWidth       = 0 ;
    bubbleHelpBgColor     = "#99ccff" ;
    bubbleHelpFontColor   = "#000000" ;
    bubbleHelpFontStyle   = "Arial" ;
    bubbleHelpFontSize    = "12px" ;
    bubbleHelpBorderColor = "#999999" ;
    bubbleHelpText        = BH_ModifyBubbleHelpText(bubbleHelpText) ;
  }



  /*********************************************************************/
  /*                                                                   */
  /*    Funktion:   C r e a t e B u b b l e H e l p C o n t a i n e r  */
  /*    =========                                                      */
  /*                                                                   */
  /*    Parameter:  -                                                  */
  /*                                                                   */
  /*********************************************************************/
  function BH_CreateBubbleHelpContainer()
  {
    if (navigator.userAgent.substring(0,9).toLowerCase() != "mozilla/4" || navigator.userAgent.indexOf("compat") > -1)
    {
      if (!eval(document.getElementById("BubbleHelp")))
      {
        if (navigator.appName.substring(0,9).toLowerCase() == "microsoft")
        {
          // ----------------------------------------------------------------------------------------
          // Explizite MSIE-Loesung ("createAttribute" wird bis MSIE 5.5 nicht korrekt interpretiert)
          // ----------------------------------------------------------------------------------------
          // alert("\nbubbleHelpTransparence >" + bubbleHelpTransparence + "<") ;
          var bhDivString = (!bubbleHelpTransparence)
                           ? document.createElement("<DIV id=\"bubbleHelp\" style=\"position:absolute; top:0px; left:0px; width:120px; height:10px; z-index:99; padding:2px; visibility:hidden;\"></DIV>")
                           : document.createElement("<DIV id=\"bubbleHelp\" style=\"position:absolute; top:0px; left:0px; width:0px; height:0px; z-index:99; visibility:hidden;\"></DIV>") ;
          document.body.appendChild(bhDivString) ;
        }
        else
        {
          // --------------------------
          // Mozilla / Netscape / Opera
          // --------------------------
          bhElement  = document.createElement("DIV") ;
          document.body.appendChild(bhElement) ;
          var bhId   = document.createAttribute("id") ;
          bhId.nodeValue = "bubbleHelp" ;
          bhElement.setAttributeNode(bhId) ;
          var bhStyle = document.createAttribute("style") ;
          bhStyle.nodeValue = (!bubbleHelpTransparence)
                             ? "position:absolute; top:0px; left:0px; width:120px; height:10px; z-index:99; padding:0px; border:0px solid #000000; visibility:hidden; overflow:visible;"
                             : "position:absolute; top:0px; left:0px; width:20px; height:20px; z-index:99; visibility:hidden;" ;
          bhElement.setAttributeNode(bhStyle) ;
        }
      }
      bubbleHelp = document.getElementById("bubbleHelp") ;
    }
  }



  /*********************************************************************/
  /*                                                                   */
  /*    Funktion:   D i s p l a y B u b b l e H e l p                  */
  /*    =========                                                      */
  /*                                                                   */
  /*    Parameter:  - Auszugebender BubbleHelp-Text                    */
  /*                                                                   */
  /*********************************************************************/
  function BH_DisplayBubbleHelp(text)
  {
    // -------------------------------------------------------------------------------
    // Keine BubbleHelp-Ausgabe, wenn kein Text vorgegeben wurde oder ausgaberelevante
    // Parameter nicht entsprechend gesetzt sind
    // -------------------------------------------------------------------------------
    if (text == "" || !bubbleHelpTextModified || BH_mouseTop < 0 || BH_mouseLeft < 0)
      return ;
    // -------------------------------------------------------------------------------
    BH_CreateBubbleHelpContainer() ;   /* BubbleHelp-Container erzeugen, falls noch nicht vorhanden */
    var documentWidth  = (mozilla) ? innerWidth  : (window.document.body.clientWidth + window.document.body.scrollLeft) ;
    var documentHeight = (mozilla) ? innerHeight : (window.document.body.clientHeight + window.document.body.scrollTop) ;
    if (text.toUpperCase() == "CLOSE")    /* Close BubbleHelp */
    {
      bubbleHelp.style.visibility = "hidden" ;
      bubbleHelpTextModified = false ;
    }
    else
    {
      var bubbleHelpTable = document.getElementById("BubbleHelpTable") ;
      if (mozilla && bubbleHelpTable != null)
      {
        // -------------------------------------------------------------------------------------------------
        BH_mouseTop -= window.pageYOffset ;
        if ((BH_mouseTop + 21 + bubbleHelpTable.offsetHeight) < (documentHeight + window.pageYOffset))
          bubbleHelp.style.top = BH_mouseTop + 10 ;
        else
        {
          bubbleHelp.style.top = BH_mouseTop - (bubbleHelpTable.offsetHeight + 5 - window.pageYOffset) ;
          bubbleHelpEOB = true ;
        }
        // -------------------------------------------------------------------------------------------------
        BH_mouseLeft -= window.pageXOffset ;
        bubbleHelp.style.left  = ((BH_mouseLeft + 16 + bubbleHelpTable.offsetWidth) >= (documentWidth + window.pageXOffset))
                                ? documentWidth - (bubbleHelpTable.offsetWidth + 15 - window.pageXOffset)
                                : (bubbleHelpEOB)
                                 ? BH_mouseLeft
                                 : BH_mouseLeft + 5 ;
        // -------------------------------------------------------------------------------------------------
      }
      else
      {
        // -------------------------------------------------------------------------------------------------
        if ((BH_mouseTop + 11 + bubbleHelp.offsetHeight) < documentHeight)
          bubbleHelp.style.top = BH_mouseTop + 10 ;
        else
        {
          bubbleHelp.style.top = BH_mouseTop - (bubbleHelp.offsetHeight + 5) ;
          bubbleHelpEOB = true ;
        }
        // -------------------------------------------------------------------------------------------------
        bubbleHelp.style.left  = ((BH_mouseLeft + 6 + bubbleHelp.offsetWidth) >= documentWidth)
                                ? documentWidth - (bubbleHelp.offsetWidth + 5)
                                : (bubbleHelpEOB)
                                 ? BH_mouseLeft
                                 : BH_mouseLeft + 5 ;
        // -------------------------------------------------------------------------------------------------
      }
      bubbleHelpEOB = false ;
      if (bubbleHelp.style.visibility == "hidden")
      {
        if (!mozilla)
        {
          bubbleHelp.style.border = "1px " + bubbleHelpBorderColor + " solid" ;
          bubbleHelp.style.background = bubbleHelpBgColor ;
          bubbleHelp.style.width = bubbleHelpWidth ;
          bubbleHelp.innerHTML = "<span style=\"color:" + bubbleHelpFontColor + ";font-size:" + bubbleHelpFontSize + ";font-family:" + bubbleHelpFontStyle + "\">"
                                 + text
                                 + "</"+"span>" ;
        }
        else
        {
          bubbleHelp.innerHTML = "<table id=\"BubbleHelpTable\" style=\"width:"+bubbleHelpWidth+"; background-color:"+bubbleHelpBgColor+"; border:1px "+bubbleHelpBorderColor+" solid;\" cellpadding=\"2\" cellspacing=\"0\"><td width=\"100%\">"
                                 + "<span style=\"color:" + bubbleHelpFontColor + ";font-size:" + bubbleHelpFontSize + ";font-family:" + bubbleHelpFontStyle + "\">"
                                 + "<nobr>" + text + "</"+"nobr>"
                                 + "</"+"span>"
                                 + "</"+"td></"+"table>" ;
        }
        bubbleHelp.style.zIndex   = 9 ;
      }
      bubbleHelp.style.visibility = "visible" ;
    }
  }


  function BH_MouseMove(Ereignis)
  {
    // try { RefreshMouseCoords() ; } catch(e) { } ;
    BH_mouseTop        = (mozilla)
                        ? Ereignis.pageY + window.pageYOffset
                        : event.clientY + window.document.body.scrollTop ;
    BH_mouseLeft       = (mozilla)
                        ? Ereignis.pageX + window.pageXOffset
                        : event.clientX + window.document.body.scrollLeft ;
    BH_mouseOffsetTop  = (mozilla) ? Ereignis.pageY : event.offsetY ;
    BH_mouseOffsetLeft = (mozilla) ? Ereignis.pageX : event.offsetX ;
    // alert("\nBH_mouseTop >" + BH_mouseTop + "< ---- BH_mouseLeft >" + BH_mouseLeft + "<\n\nevent.x >" + event.x + "<\nevent.y >" + event.y + "<\nevent.clientX >" + event.clientX + "<\nevent.clientY >" + event.clientY + "<\nevent.offsetX >" + event.offsetX + "<\nevent.offsetY >" + event.offsetY + "<\nwindow.document.body.scrollLeft >" + window.document.body.scrollLeft + "<\nwindow.document.body.scrollTop >" + window.document.body.scrollTop + "<\ndocument.body.clientHeight >" + document.body.clientHeight + "<") ;
    // window.status = "BH_mouseTop [" + BH_mouseTop + "] -- BH_mouseLeft [" + BH_mouseLeft + "]" ;
    return true ;
  }

  if (mozilla)
  {
    document.captureEvents(Event.MOUSEMOVE) ;
    document.onmousemove = BH_MouseMove ;   /* bei Mausbewegung Koordinaten aktualisieren*/
  }


  // ===================================================================
  // Funktionsaufruf "BH_MouseMove" muss innerhalb des Parent-Dokumentes
  // im JScript-Bereich zum Event "onmousemove" vorgegeben werden !!!
  // ===================================================================
  // <!-- JScript fuer MS Internet Explorer vorgesehen (nur 4.x-Browser) -->
  // <script for=document event="onmousemove()" language="JScript">
  //   BH_MouseMove() ;
  // </script>































