// script k otvirani pomocnych oken

var Windows = new Array()
var NumWindow = 0;

function NoveOkno(iHref,iWidth,iHeight,iMenuBar) {
    NameWindow = 'Okno' + NumWindow;
    ++NumWindow;
    if (((NameWindow in Windows))&&(!Windows[NameWindow].closed)){Windows[NameWindow].close()}
    var iScroll = 'yes'
    if ((iWidth == null)||(iWidth == 0)||(iWidth > screen.availWidth)) {
        iWidth = screen.availWidth
        iScroll = 'yes'
        }
    if ((iHeight == null)||(iHeight == 0)||(iHeight > screen.availHeight)) {
        iHeight = screen.availHeight
        iScroll = 'yes'
        }
    if ((iMenuBar == null)||(iMenuBar == false)) {
        iMBar = 'no'
        }else{
        iMBar = 'yes'
        }
    iX = (screen.availWidth - iWidth)/2;
    iY = (screen.availHeight - iHeight)/2;
    Windows[NameWindow] = window.open(iHref,NameWindow,'left='+iX+',top='+iY+',width='+iWidth+',height='+iHeight+
',scrollbars='+iScroll+',directories=no,location=no,menubar='+iMBar+',resizable=no,status=no,toolbar=no');
    Windows[NameWindow].resizeTo(iWidth,iHeight)
    }

function ZavriOkna() {
    for (w in BigWindows) if (!BigWindows[w].closed) BigWindows[w].close();
    for (w in Windows) if (!Windows[w].closed) Windows[w].close();
    }