      fadinglayers = Array();
      function defined(o) {
          return (typeof(o)!="undefined");
      };
      var css = {};
      // Convert hyphen style names like border-width to camel case like borderWidth
      css.hyphen2camel = function(property) {
          if (!defined(property) || property==null) { return null; }
          if (property.indexOf("-")<0) { return property; }
          var str = "";
          var c = null;
          var l = property.length;
          for (var i=0; i<l; i++) {
              c = property.charAt(i);
              str += (c!="-")?c:property.charAt(++i).toUpperCase();
          }
          return str;
      };

     css.rgb2hex = function(rgbString) {
        if (typeof(rgbString)!="string" || !defined(rgbString.match)) { return null; }
        var result = rgbString.match(/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*/);
        if (result==null) { return rgbString; }
        var rgb = +result[1] << 16 | +result[2] << 8 | +result[3];
        var hex = "";
        var digits = "0123456789abcdef";
        while(rgb!=0) { 
        hex = digits.charAt(rgb&0xf)+hex; 
        rgb>>>=4; 
        } 
        while(hex.length<6) { hex='0'+hex; }
        return "#" + hex;
        };


        css.getStyle = function(o, property) {
        if (o==null) { return null; }
        var val = null;
        var camelProperty = css.hyphen2camel(property);
        // Handle "float" property as a special case
        if (property=="float") {
            val = css.getStyle(o,"cssFloat");
            if (val==null) { 
                val = css.getStyle(o,"styleFloat"); 
            }
        }
        else if (o.currentStyle && defined(o.currentStyle[camelProperty])) {
            val = o.currentStyle[camelProperty];
        }
        else if (window.getComputedStyle) {
            val = window.getComputedStyle(o,null).getPropertyValue(property);
        }
        else if (o.style && defined(o.style[camelProperty])) {
            val = o.style[camelProperty];
        }
        // For color values, make the value consistent across browsers
        // Convert rgb() colors back to hex for consistency
        if (/^\s*rgb\s*\(/.test(val)) {
            val = css.rgb2hex(val);
        }
        // Lowercase all #hex values
        if (/^#/.test(val)) {
            val = val.toLowerCase();
        }
        return val;
        };
        css.get = css.getStyle;

     function getBody() {
          if (document.body) {
              return document.body;
          }
          if (document.getElementsByTagName) {
              var bodies = document.getElementsByTagName("BODY");
              if (bodies!=null && bodies.length>0) {
                  return bodies[0];
              }
          }
          return null;
      }
      function zero(n) {
        return (!defined(n) || isNaN(n))?0:n;
      };


      function getDocumentHeight() {
          var body = getBody();
          var innerHeight =
              (defined(self.innerHeight)&&!isNaN(self.innerHeight))?self.innerHeight:0;
          if (!document.compatMode || document.compatMode=="CSS1Compat") {
              var topMargin = parseInt(css.get(body,'marginTop'),10) || 0;
              var bottomMargin = parseInt(css.get(body,'marginBottom'), 10) || 0;
              return Math.max(body.offsetHeight + topMargin + bottomMargin,
                      document.documentElement.clientHeight,
                      document.documentElement.scrollHeight, zero(self.innerHeight));
          }
          return Math.max(body.scrollHeight, body.clientHeight,
                  screen.zero(self.innerHeight));
      }
      function zoomimage(obj) {
        var body = document.body;
        var cw = body.clientWidth;
        var ch = getDocumentHeight();
        var ch = window.innerHeight;
        var zoomimageobj = document.getElementById('popup' + obj.parentNode.id);
        var imageobj = document.getElementById(obj.id + '_g'); 
        if (!zoomimageobj) {
          alert(obj.parentNode.id + " hat kein Zoombild.");
          return
        }
        if (!imageobj) {
          alert(obj.parentNode.id + ": Id '" + obj.id + '_g' + " ist nicht bekannt.");
          return
        }
        var x=obj.parentNode.offsetLeft;
        var y=obj.parentNode.offsetTop;
        if (x >= (cw / 2)) {
          x+= obj.width - imageobj.width;
        }
        if ((y-window.pageYOffset) >= (ch / 2)) {
          y+= obj.height - (imageobj.height);
        }

        zoomimageobj.style.visibility = "visible"; 
        zoomimageobj.style.left = x + 'px';
        zoomimageobj.style.top = y + 'px';
      }
      function isfading(id) {
          for (i=0; i<=fadinglayers.length; i++) {
              if (fadinglayers[i] == id) {
                  return true;
              }
          }
          return false;
      }
      function removeidfromfadinglist(id) {
          for (i=0; i<=fadinglayers.length; i++) {
              if (fadinglayers[i] == id) {
                fadinglayers.splice(i,1);
                return;
              }
          }
      }
      function fadeout(obj) {
        if (isfading(obj.parentNode.id)) {
          return;
        }
        fadinglayers[fadinglayers.length]=obj.parentNode.id;
        fadeouttimer(obj.parentNode.id,100);
      }
      function fadeouttimer(id,opacity) {
        var obj = document.getElementById(id);
        var opacitypercent = opacity/100;
        obj.style.filter="alpha(opacity=" + opacity + ")"
        obj.style.opacity=opacitypercent;        
        if (opacity >= 2) {
            opacity -= 2;
            window.setTimeout('fadeouttimer("' + id + '",' + opacity  +')', 50);
        } else {
          obj.style.visibility="hidden";
          opacity=100;
          opacitypercent = opacity/100;
          obj.style.filter="alpha(opacity=" + opacity + ")"
          obj.style.opacity=opacitypercent;        
          removeidfromfadinglist(id);
        }
      }

