
var PicWin=null;
var windowopened=0;

function popup(filename,title,sizex,sizey)
{
        if(windowopened!=0){PicWin.close();}
        PicWin = window.open("","Screenshot","width="+sizex+",height="+sizey+",resizable=no,scrollbars=no,screenX="+((screen.width-sizex)/2)+",screenY="+((screen.height-sizey)/2)+",top="+((screen.height-sizey)/2)+",left="+((screen.width-sizex)/2));
        PicWin.opener = self;
        PicWin.document.write ("<html><head><title>"+title+"</title></head><body bgcolor=#ffffff topmargin=0 leftmargin=0 marginheight=0 marginwidth=0 onLoad='self.opener.windowopened=1;' onUnload='self.opener.windowopened=0;'><a href='javascript:close();'><img src="+filename+" width="+sizex+" height="+sizey+" alt='Click to close' border=0></a></body></html>");
        PicWin.document.close();
}
