/**
 * Versucht die für das relative Layout verwendete Basis-Schriftgröße auf Basis
 * der tatsächlichen DPI-Einstellung des Bildschirms zu korrigieren
 */
var LAYOUT_BASE_DPI      = 96;
var LAYOUT_BASE_FONTSIZE = 16;
function adaptFontSize()
{
    if (screen.logicalXDPI) {
        document.body.style.fontSize = Math.round((LAYOUT_BASE_DPI / screen.logicalXDPI) * 100) + '%';
    } else {
        var id = 'calulateFontsize-div-test';
        var test = document.getElementById(id);
        if (!test) {
            test = document.createElement('DIV');
            test.id = id;
            test.stylefontSize ='100%';        
            test.style.position='absolute';
            test.style.visibility='hidden';
            test.style.left=test.style.top='-1000px';
            test.style.height=test.style.width='1em';
            document.body.appendChild(test);
        }
        document.body.style.fontSize = Math.round((LAYOUT_BASE_FONTSIZE / test.offsetHeight) * 100) + '%';
    }
}


// PopUp Fenster
function popup(page,width,height,name,props) {
    if(width && document.layers) width -= 10;
    if(!width) screen.availWidth;
    if(!height) screen.availHeight;
    if(!name) name="swr3pop";
    if(!props) props = 'toolbar=no,location=no,directories=no,status=no,resizable=yes,menubar=no,scrollbars=no,copyhistory=no';
    if (win && win.closed) {
        win.focus();
        win.document.location.href = page;
    }
    var win = window.open(page, name, props+',width=' + width + ',height=' + height );
    win.focus();
    win = null;
}
