function text_edit_panel( file_name )
{
    if (typeof(edico_panel) != "undefined") edico_panel.close();
    wdth = 640;
    hght = 480;
    lft  = screen.width/2 - wdth/2;
    tp   = screen.height/2 - hght/2;
    edico_panel = window.open('edc_main/text_edit_panel.php?file='+file_name+'','edico_panel','width='+wdth+', height='+hght+', left='+lft+', top='+tp+'');
}

function gallery_panel( name )
{
    if (typeof(edico_panel) != "undefined") edico_panel.close();
    wdth = 640;
    hght = 480;
    lft  = screen.width/2 - wdth/2;
    tp   = screen.height/2 - hght/2;
    edico_panel = window.open('edc_modules/mod_gallery/MainPanel.php?gallery='+name+'','edico_panel','width='+wdth+', height='+hght+', left='+lft+', top='+tp+'');
}

function news_edit_panel( file_name )
{
    if (typeof(edico_panel) != "undefined") edico_panel.close();
    wdth = 640;
    hght = 480;
    lft  = screen.width/2 - wdth/2;
    tp   = screen.height/2 - hght/2;
    edico_panel = window.open('edc_modules/mod_news_1/news_main_panel.php?file='+file_name+'','edico_panel','width='+wdth+', height='+hght+', left='+lft+', top='+tp+'');
}

function news_edit_panel_2( file_name )
{
    if (typeof(edico_panel) != "undefined") edico_panel.close();
    wdth = 640;
    hght = 480;
    lft  = screen.width/2 - wdth/2;
    tp   = screen.height/2 - hght/2;
    edico_panel = window.open('edc_modules/mod_news_2/news_main_panel.php?file='+file_name+'','edico_panel','width='+wdth+', height='+hght+', left='+lft+', top='+tp+'');
}

function news_edit_panel_3( file_name )
{
    if (typeof(edico_panel) != "undefined") edico_panel.close();
    wdth = 640;
    hght = 480;
    lft  = screen.width/2 - wdth/2;
    tp   = screen.height/2 - hght/2;
    edico_panel = window.open('edc_modules/mod_news_3/news_main_panel.php?file='+file_name+'','edico_panel','width='+wdth+', height='+hght+', left='+lft+', top='+tp+'');
}

function popup_image_uplader_panel( image_name, width, height )
{
    if (typeof(edico_panel) != "undefined") edico_panel.close();
    wdth = 370;
    hght = 250;
    lft  = screen.width/2 - wdth/2;
    tp   = screen.height/2 - hght/2;
    edico_small_panel = window.open('edc_plugins/plu_popup_image_uploader/image_upload_panel.php?color=green&image_name='+image_name+'&width='+width+'&height='+height,'tiny_mce_image_uploader','width='+wdth+', height='+hght+', left='+lft+', top='+tp);  
}

noweOkienko = null;

function popup_image(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();
}
