if ((document.referrer.length>0) && (document.images) && ((document.referrer.toLowerCase().indexOf('ikzm-d.de')<0))) {
   refererimg=new Image(1,1);
   refererimg.src="/statistik_referer.php?counter=1&ref="+escape(document.referrer);
}

function ZeigeAbbildung(graphid,width,height) {
  var Properties="resizable=yes,scrollbars=yes,width="+width+",height="+height+",left=10,top=10";
  EinFenster=window.open("/showaddon.php?graphid="+graphid,"abb_detail",Properties);
  EinFenster.focus();
  return;
}
function ZeigeAddon(addontyp,subid,width,height) {
  var scrollbars="auto";
  if (height>700) {
    height=700;
    scrollbars="yes";
  }
  if ((height>400) || (width>400)) {
    scrollbars="yes";
  }
  var Properties="resizable=yes,scrollbars="+scrollbars+",width="+width+",height="+height+",left=10,top=10";
  AddonFenster=window.open("/showaddon.php?"+addontyp+"="+subid,"addon",Properties);
  AddonFenster.focus();
  return;
}
// Bei Netscape muss das Hinweis-Fenster mit body.onBlur geschlossen
// werden
function CloseOnBlur(mywindow) {
  if (document.all) {
    mywindow.close();
    return;
  }
}
// Beim Internet-Explorer muss das Hinweis-Fenster mit a.onClick geschlossen
// werden
function CloseOnClick(mywindow) {
  if (document.all) {
    mywindow.close();
    return;
  }
}

// Dreamweaver-Funktionen für Rollover-Effekte
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function checkCheckboxes(frm, do_check) {
    var n = document.forms[frm].elements.length;
    for (var i=0;i<n;i++) {
      if (typeof(document.forms[frm].elements[i]) !='undefined') {
        document.forms[frm].elements[i].checked = do_check;
      } else {
        alert("typeof["+i+"]="+typeof(document.forms[frm].elements[i]));
      }
    }
    return true;
}

function setOptimalWindowSize(theWindow) {
  var positionObject = totalElementXYOffset(theWindow.document.images['rechtsunten']);
//  var newwidth=theWindow.document.body.scrollWidth;
//  var newheight=theWindow.document.body.scrollHeight;
  var newwidth=positionObject.x;
  var newheight=positionObject.y;
  if (newwidth>screen.width-100) {
    newwidth=screen.width-100;
  } else {
    newwidth = theWindow.outerWidth;
    if (newwidth==null) {
      newwidth = theWindow.document.body.clientWidth+29;
    }
  }
  if (newheight>screen.height-150) {
    newheight=screen.height-150;
  }
  theWindow.resizeTo(newwidth,newheight+38+29);
//  theWindow.resizeTo(newwidth+12,newheight+32);
}

function totalElementXYOffset(obj){
/* http://groups.google.de/groups?q=position+of+image+on+html+page&hl=de&lr=&ie=UTF-8&selm=auo6no%245cp%241%24830fa17d%40news.demon.co.uk&rnum=8
The function parameter 'obj' is a reference to the HTML element for
which the page X and Y co-ordinates of the top left corner are required.
*/
    var xOffset, yOffset, elParent;
/*Define local variables for use within this function. */
    if(typeof obj.offsetTop == 'number'){
/*Test to see if the HTML element has an 'offsetTop' property that is a
number. If the browser does not support the offsetTop (and by
implication offsetLeft) then  -  typeof obj.offsetTop  -  will be
'undefined'. Modern browsers all use offsetTop/Left.*/
        yOffset = ((obj.offsetTop)?obj.offsetTop:0);
/*This line cautiously assigns the value of obj.offsetTop to the local
variable 'yOffset'. The test is used to avoid the condition where
obj.offsetTop is null and guarantees that the value assigned to yOffset
is a number (this has been an occasional problem on a few old browsers
(Opera 5 was an example, I think)*/
        xOffset = ((obj.offsetLeft)?obj.offsetLeft:0);
/*This line is much the same as the previous but for offsetLeft*/
        elParent = obj.offsetParent;
/*Each element (except the outermost) has an offsetParent property,
which is a reference to the element from which the current element is
offset by the values of offsetTop/Left. Following the chain of
offsetParent references eventually arrives at the outermost element (the
documentElement in most cases). The offsetParent property of the
outermost element is always null. */
        while(elParent){
/*If the reference held in 'elParent' is null then 'elParent' will
evaluate to false and the while loop will not execute, otherwise the
loop will execute until the 'elParent' value is null (ie, until the
outermost element has been examined).*/
            yOffset += ((elParent.offsetTop)?elParent.offsetTop:0);
/*Add the value of elParent.offsetTop to the (numeric) value of
'yOffset' (again cautiously).*/
            xOffset += ((elParent.offsetLeft)?elParent.offsetLeft:0);
/*The same for offsetLeft.*/
            elParent = elParent.offsetParent;
/*assign the offsetParent reference to 'elParent' for the next execution
of the loop. If the chain of offset parents has reached the outermost
element, this value will be null and the while loop will end. */
        }
/*At this point (if offsetTop/Left are numbers) the local variables
yOffset and xOffset will contain the sum of the offsets for each element
in the chain of offset parents from the element that was passed as a
parameter up to the outermost element. These values represent the total
offset of the element on the HTMl page.*/
    }else if(typeof obj.top == 'number'){ //some Net 4 DIVs
/*Netscape 4 does not support offsetTop/Left but layer elements may have
usable top/left properties. */
        yOffset = obj.top;
        xOffset = obj.left;
    }else if(typeof obj.y == 'number'){  // Net 4 IMG & A
/* Netscape 4 does not support offsetTop/Left but IMG and A elements have
x and y properties that represent their co-ordinates on the page. */
        yOffset = obj.y;
        xOffset = obj.x;
    }else{      //information is not available
/*There may (will) be browsers that do not support any of these
mechanisms for location the elements on a page. This block is intended
to provide values that can be tested to see if a valid position was
available in the browser. */
        yOffset = -1; //maybe use NaN instead.
        xOffset = -1;
/*The alternative of using:-
        yOffset = NaN;
        xOffset = NaN;
might make distinguishing unavailable co-ordinates from real but
negative co-ordinates easier. On the other hand, it might be better to
just return null at this point so that the object returned from this
function can be simply tested for null-ness without accessing it's
properties.*/
    }
    return {x:xOffset,y:yOffset};
/*This final line returns an object literal. The object returned has two
properties 'x' and 'y' which have been assigned the values held in the
local variables 'xOffset' and 'yOffset' respectively.*/
}
