
if (navigator.appName == 'Netscape') {
    document.writeln('<style type="text/css">');
    document.writeln('<!--');
    document.writeln('li { margin-top:3px; }');
    document.writeln('-->');
    document.writeln('</style>');
}


var bigWin;


function popup(bildname, width, height) {
    
    if (checkWindowOpen() == 'open') {
        //alert('bin noch offen');
        
        //alert(bigWin.innerWidth);
        //alert(bigWin.innerHeight);
        //
        //var currentWidth = bigWin.innerWidth;
        //var currentHeight = bigWin.innerHeight;
        //
        //alert(currentWidth);
        //alert(currentHeight);
        //
        //var currentOuterWidth = bigWin.outerWidth;
        //var currentOuterHeight = bigWin.outerHeight;
        //
        //alert(currentOuterWidth);
        //alert(currentOuterHeight);
        
        //bigWin.resizeTo(width, height);
        
        //bigWin.images.detail.src = 'images/gallery/' + bildname;
        
        bigWin.close();
        openwindow(bildname, width, height);
        bigWin.focus();
        
        
    } else {
        openwindow(bildname, width, height);
    }
}



function farbpalette(width, height) {
    
    if (checkWindowOpen() == 'open') {
        //alert('bin noch offen');
        
        //alert(bigWin.innerWidth);
        //alert(bigWin.innerHeight);
        //
        //var currentWidth = bigWin.innerWidth;
        //var currentHeight = bigWin.innerHeight;
        //
        //alert(currentWidth);
        //alert(currentHeight);
        //
        //var currentOuterWidth = bigWin.outerWidth;
        //var currentOuterHeight = bigWin.outerHeight;
        //
        //alert(currentOuterWidth);
        //alert(currentOuterHeight);
        
        //bigWin.resizeTo(width, height);
        
        //bigWin.images.detail.src = 'images/gallery/' + bildname;
        
        bigWin.close();
        openFarbpalette(width, height);
        bigWin.focus();
        
        
    } else {
        
        openFarbpalette(width, height);
    }
}


function checkWindowOpen() {
    var returnValue = 'closed';
    
    if (bigWin) {
        if (bigWin.closed == false ){
            //alert('Fenster noch offen');
            //bigWin.close();
            returnValue = 'open';
        }
    }
    return returnValue;
}


function openFarbpalette(width, height) {
    
    
    
    var pix2add = 3;
    
   
    bigWin = eval("window.open('/farbpalettepopup.php','bigWin','dependent=yes,toolbar=no,scrollbars=yes,resizable=no,width="+(width+pix2add)+",height="+(height+pix2add)+",screenX=0,screenY=0,left=60,top=20')");
    
    bigWin.focus();
}


function openwindow(bildname, width, height) {
    
    //alert('openwindow');
    
    var pix2add = 0;
    
    bigWin = eval("window.open('','bigWin','dependent=yes,toolbar=no,resizable=no,width="+(width+pix2add)+",height="+(height+pix2add)+",screenX=0,screenY=0,left=20,top=80')");
    
    bigWin.document.writeln('<head><title>www.christians.world.com</title></head>');
    bigWin.document.writeln('<body bgcolor="#FFFFFF" marginheight="0" marginwidth="0">');
    bigWin.document.writeln('<div style="position:absolute;top:0;left:0">');
    bigWin.document.writeln('<a href="javascript:self.close()">');
    bigWin.document.write('<img src="images/gallery/' + bildname );
    bigWin.document.writeln('" border="0" alt="Klicken Sie zum Schliessen auf das Bild"></a>');
    bigWin.document.writeln('</div>');
    bigWin.document.writeln('</body>');
    bigWin.focus();
}


if (navigator.appName == 'Netscape') {
    document.writeln('<style type="text/css">');
    document.writeln('<!--');
    document.writeln('li { margin-top:3px; }');
    document.writeln('-->');
    document.writeln('</style>');
}