// JavaScript Document
//camIMg
function get_CamImg(anObj, box){
    var cleft = 0;
    var ctop = 0;
    var obj = anObj;

    while (obj.offsetParent){
        cleft += obj.offsetLeft;
        ctop += obj.offsetTop;
        obj = obj.offsetParent;
    }

    box.style.left = cleft + 135 + 'px';

    ctop +=  2;
    
    if (document.body.currentStyle && document.body.currentStyle['marginTop']){
        ctop += parseInt(document.body.currentStyle['marginTop']) - 10;
    }

    box.style.top = ctop + 'px';
}

//infolayer
function get_box(anObj, box)
{
    var cleft = 0;
    var ctop = 0;
    var obj = anObj;

    while (obj.offsetParent)
    {
        cleft += obj.offsetLeft;
        ctop += obj.offsetTop;
        obj = obj.offsetParent;
    }

    box.style.left = cleft + 'px';

    ctop += anObj.offsetHeight + 2;

    // Handle Internet Explorer body margins,
    // which affect normal document, but not
    // absolute-positioned stuff.
    if (document.body.currentStyle &&
        document.body.currentStyle['marginTop'])
    {
        ctop += parseInt(
            document.body.currentStyle['marginTop']);
    }

    box.style.top = ctop + 'px';
}

function hide_box(anId){
        //alert(anId); 
        element = document.getElementById(anId);
        element.style.display='none';
    
}

// Shows a box if it wasn't shown yet or is hidden
// or hides it if it is curre
function show_hide_box(anObj,aLink, width, height, borderStyle)
{
   
    var href = aLink;
    var boxdiv = document.getElementById(href);
    
    anObj.onmouseout = function(){ hide_box(href); }
    
    
    if (boxdiv != null)
    {
        
        if (boxdiv.style.display=='none')
        {
            // Show existing box, move it
            // if document changed layout
            get_box(anObj, boxdiv);
            boxdiv.style.display='block';
        }
       /* 
       else
            // Hide currently shown box.
            boxdiv.style.display='none';
       */
        return false;
    }

    // Create box object through DOM
    boxdiv = document.createElement('div');
    boxdiv.setAttribute('id', href);
    //alert(boxdiv.getAttribute('id'));
    boxdiv.style.display = 'block';
    boxdiv.style.position = 'absolute';
    boxdiv.style.width = width + 'px';
    boxdiv.style.height = height + 'px';
    boxdiv.style.border = borderStyle;
    boxdiv.style.textAlign = 'right';
    boxdiv.style.padding = '8px';
    boxdiv.style.background = '#FEE6E6';
    boxdiv.style.zIndex = '9999';
    document.body.appendChild(boxdiv);

    var offset = 0;

    // Remove the following code if 'Close' hyperlink
    // is not needed.
    //var close_href = document.createElement('a');
    //close_href.href = 'javascript:void(0);';
    //close_href.className = 'fndLinkFussPartner';
    //close_href.onclick = function()
    //    { show_hide_box(anObj,aLink, width, height, borderStyle); }
    //close_href.appendChild(document.createTextNode('schliessen'));
    //boxdiv.appendChild(close_href);
    //offset = close_href.offsetHeight;
    // End of 'Close' hyperlink code.

    var contents = document.createElement('iframe');
    contents.scrolling = 'no';
    contents.frameBorder = '0';
    contents.style.width = width + 'px';
    contents.style.height = (height - offset) + 'px';
    //contents.onmouseout = function()
    //    { hide_box(href); }
    boxdiv.appendChild(contents);

    get_box(anObj, boxdiv);

    if (contents.contentWindow)
        contents.contentWindow.document.location.replace(
            href);
    else
        contents.src = href;

    

    // The script has successfully shown the box,
    // prevent hyperlink navigation.
    return false;
}
//camIMG
function show_hide_camIMG(anObj,width, height,imgsrc)
{
   
    var href = anObj.href;
    var boxdiv = document.getElementById(href);
    
    anObj.onmouseout = function(){hide_box(href);}
  
    if (boxdiv != null){
        if (boxdiv.style.display=='none'){
            get_CamImg(anObj, boxdiv);
            boxdiv.style.display='block';
        }
        return false;
    }

    // Create box object through DOM
    boxdiv = document.createElement('div');
    boxdiv.setAttribute('id', href);
    boxdiv.style.display = 'block';
    boxdiv.style.position = 'absolute';
    boxdiv.style.width = width + 'px';
    boxdiv.style.height = height + 'px';
    boxdiv.style.border = 'solid 1px #990099';
    boxdiv.style.background = '#F4E6F5';
    boxdiv.style.zIndex = '9999';
    document.body.appendChild(boxdiv);

    var offset = 0;

    var contents = document.createElement('div');
    contents.innerHTML = '<img src=\''+imgsrc+'\' border=0 />';
    //alert(contents.innerHTML);
    boxdiv.appendChild(contents);

    get_CamImg(anObj, boxdiv);

    // The script has successfully shown the box,
    // prevent hyperlink navigation.
    return false;
}