noweOkienko = null;

function galeria(src, w, h)
{
    if(window.screen)
    {
        aw=screen.availWidth;
        ah=screen.availHeight;
    }else{
        aw=640;
        ah=450;
    }

    if(noweOkienko==null || noweOkienko.closed)
    {
        ustawienia=
            "left=" + (aw-w)/2 + ","
            +"top=" + (ah-h)/2 + ","
            +"screenX=" + (aw-w)/2 + ","
            +"screenY=" + (ah-h)/2 + ","
            +"width=" + w + ","
            +"height=" + h + ","
            +"innerWidth=" + w + ","
            +"innerHeight=" + h + ","
            +"toolbar=no,"
            +"location=no,"
            +"directories=no,"
            +"status=yes,"
            +"menubar=no,"
            +"scrollbars=no,"
            +"resizable=no"
        noweOkienko = window.open("",'obrazek',ustawienia);
    }

    noweOkienko.document.open();
    noweOkienko.document.clear();
    noweOkienko.document.write(
        "<html><head><title>Powiększenie</title>\n"
        +"</head><BODY bgcolor=#000000>\n"
        +"<div class=bgfoto id='wait' style='position:absolute; left:" + (w-120)/2 + "px; top:" + h/2 + "px; width:" + w + "; height=" + h + "; z-index:1'><font size='2' font color='#3C436C' face='sans-serif'><b><br> OTWIERANIE</b> </font></div>\n"
        +"<div id='img' style='position:absolute; left:0; top:0; width:300; height:200px; z-index:2'><a href='javascript:window.close()'><img src="+ src +" width=" + w + " height=" + h + "  alt=' Zamknij ' border=0></a></div>\n"
        +"</body></html>"
    );
    noweOkienko.document.close();
    noweOkienko.focus();
}




function textEditPanel(currentFile)
{
    window.open('text_files/panel.php?file_name='+currentFile+'','myWindow','width=640, height=490'); 
};


function imageEditPanel(currentFile,w,h,w_s,h_s)
{
    window.open('image_files/panel.php?file_name='+currentFile+'&w='+w+'&h='+h+'&w_s='+w_s+'&h_s='+h_s+'','myWindow','width=640, height=295');
}







