function getPos(el)
{
    var lx=0, ly=0;
    
    if(el)
    {
        while(el!=null)
        {
            lx += el.offsetLeft;
            ly += el.offsetTop;
            el  = el.offsetParent;
        }
        
        return new Array(lx, ly);
    }

    return false;
}

function show_image_info_icon(iid, xoff, yoff)
{
    var pos  = getPos(document.getElementById("img"+iid));
    var elem = document.getElementById("imginfo"+iid);

    elem.style.left = (pos[0] + xoff)+"px";
    elem.style.top  = (pos[1] + yoff)+"px";
    elem.style.display = "";
    elem.style.zIndex = "11";
}

function new_frame(location, width, height)
{
    sWidth = screen.width;
    sHeight = screen.height;

    xPos = (sWidth  - width)  / 2;
    yPos = (sHeight - height) / 2;
    yPos = 50;

    prob  = "left="+xPos+",";
    prob += "top="+yPos+",";
    prob += "screenX="+xPos+",";
    prob += "screenY="+yPos+",";
    prob += "width="+width+",";
    prob += "height="+height+",";
    prob += "menubar=0,";
    prob += "toolbar=0,";
    prob += "statusbar=0,";
    prob += "scrollbars=1,";
    prob += "resizable=1,";
    prob += "locationbar=0,";
    prob += "directories=0";

    win = window.open(location, "FRAME", prob);
    win.focus();
    
    return false;
}

function new_imgwin(location, width, height, winname)
{
    sHeight = screen.height; yPos = (sHeight - height) / 2; yPos -= 150; if(yPos < 30) { yPos = 30; }
    sWidth  = screen.width;  if(sWidth > 2000) { xPos = ((sWidth/2) - width)  / 2; } else { xPos = (sWidth  - width)  / 2; } if(xPos < 20) { xPos = 20; }

    prob  = "left="+xPos+",";
    prob += "top="+yPos+",";
    prob += "screenX="+xPos+",";
    prob += "screenY="+yPos+",";
    prob += "width="+width+",";
    prob += "height="+height+",";
    prob += "menubar=0,";
    prob += "toolbar=0,";
    prob += "statusbar=0,";
    prob += "scrollbars=1,";
    prob += "resizable=1,";
    prob += "locationbar=0,";
    prob += "directories=0";

    win = window.open(location, winname, prob);
    win.focus();
    
    return false;
}

function bookmark(url, title)
{
    if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4))
    {
        window.external.AddFavorite(url, title);
    }
    else if (navigator.appName == "Netscape")
    {
        alert("Bitte drücken Sie zum Speichern der Seite die Tastenkombination STRG+D auf Ihrer Tastatur.");
    }
    else
    {
        alert("Bitte drücken Sie zum Speichern der Seite die Tastenkombination STRG+T auf Ihrer Tastatur.");
    }
}

function lowLight(item)
{
    if(item.className == "hvr") { item.className = "nrml"; }
}

function highLight(item)
{   
    if(item.className == "nrml") { item.className = "hvr"; }
}

function mkFocus(item)
{
    item.className = "fcs";
}

function mkBlur(item)
{
    item.className = "nrml";
}

function getWinHeight()
{
         if(typeof document.body.clientWidth            == "number") { return(document.body.clientHeight);            }
    else if(typeof window.innerWidth                    == "number") { return(window.innerHeight);                    }
    else if(typeof document.documentElement.clientWidth == "number") { return(document.documentElement.clientHeight); }

    return(-1);
}

function getWinWidth()
{
         if(typeof document.body.clientWidth            == "number") { return(document.body.clientWidth);            }
    else if(typeof window.innerWidth                    == "number") { return(window.innerWidth);                    }
    else if(typeof document.documentElement.clientWidth == "number") { return(document.documentElement.clientWidth); }

    return(-1);
}

function getScrollY()
{
         if(document.body && document.body.scrollTop)                       { return(document.body.scrollTop);            }
    else if(typeof(window.pageYOffset) == "number")                         { return(window.pageYOffset);                 }
    else if(document.documentElement && document.documentElement.scrollTop) { return(document.documentElement.scrollTop); }

    return(0);
}

function addEvent(obj, type, fn)
{
        if(obj.addEventListener) { obj.addEventListener(type, fn, false); } 
   else if(obj.attachEvent)      { obj.attachEvent("on" + type, function () { return fn.call(obj, window.event); }); }
}

function check_container_heights() /* IE-BUGFIX: 100%-HEIGHT-BUG BEIM IE KOMPENSIEREN (SL + CN AUF GLEICHE HOEHE BRINGEN) */
{
    var sl = document.getElementById("resl");      slh = sl.offsetHeight;
    var cn = document.getElementById("recontent"); cnh = cn.offsetHeight;

    if(cnh > slh) { sl.style.height = cnh + "px"; cn.style.height = cnh + "px"; }
    if(slh > cnh) { sl.style.height = slh + "px"; cn.style.height = slh + "px"; }
}
