function NewWindow(mypage,myname,w,h,scroll){
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
var settings ='height='+h+',';
settings +='width='+w+',';
settings +='top='+wint+',';
settings +='left='+winl+',';
settings +='scrollbars='+scroll+',';
settings +='resizable=yes';
win=window.open(mypage,myname,settings);
if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

function PopUp2(nFileId,nFileTableNameId,strFile,nId, nWidth, nHeight,nTable)
{
    if(typeof WindowPopUp != "undefined")
            WindowPopUp.close();

    WindowPopUp = window.open("popup_image.php?id="+nId+"&t="+nTable+"&file="+strFile+"&fileid="+nFileId+"&filetablenameid="+nFileTableNameId, "image", "left="+((screen.width-nWidth)/2)+", top="+((screen.height-nHeight)/2)+", width="+nWidth+", height="+nHeight+" , scrollbars=no");
    WindowPopUp.focus();
    }

function PopUp(strFile, nWidth, nHeight)
{
    if((typeof WindowPopUp != "undefined") && (WindowPopUp != null))
        WindowPopUp.close();

    WindowPopUp = window.open("popup.php?file="+strFile, "popup", "left="+((screen.width-nWidth)/2)+", top="+((screen.height-nHeight)/2)+", width="+nWidth+", height="+nHeight);
    if(WindowPopUp != null)
        WindowPopUp.focus();
}

function PopUpSug(strTable, nId, nWidth, nHeight)
{
    if((typeof WindowPopUp != "undefined") && (WindowPopUp != null))
        WindowPopUp.close();

    WindowPopUp = window.open("popup-sug.php?id="+nId+"&table="+strTable, "popup", "left="+((screen.width-nWidth)/2)+", top="+((screen.height-nHeight)/2)+", width="+nWidth+", height="+nHeight);
    if(WindowPopUp != null)
        WindowPopUp.focus();
}

function PopUpCarte(strTable, nId, nWidth, nHeight)
{
    if((typeof WindowPopUp != "undefined") && (WindowPopUp != null))
        WindowPopUp.close();

    WindowPopUp = window.open("popup-carte.php?id="+nId+"&table="+strTable, "popup", "left="+((screen.width-nWidth)/2)+", top="+((screen.height-nHeight)/2)+", width="+nWidth+", height="+nHeight);
    if(WindowPopUp != null)
        WindowPopUp.focus();
}

function PopUpImages(nId, nWidth, nHeight)
{
    if((typeof WindowPopUp != "undefined") && (WindowPopUp != null))
        WindowPopUp.close();

    WindowPopUp = window.open("popup_image.php?id="+nId, "popup", "left="+((screen.width-nWidth)/2)+", top="+((screen.height-nHeight)/2)+", width="+nWidth+", height="+nHeight);
    if(WindowPopUp != null)
        WindowPopUp.focus();
}