function RedirectTo(url)
{
    document.location.href = url;
}

function ConfirmAction(msg, url)
{
    if (confirm(msg))
    {
        RedirectTo(url);
    }
}

function ShowBlock(id)
{
    block = document.getElementById(id);
    ahref = document.getElementById(id + '_link');
    header = document.getElementById(id + '_header');

    if (block.style.display == 'none')
    {
        block.style.display = 'block';
        block.style.visibility = 'visible';
        ahref.innerHTML = '[zamknij]';
        header.className = 'blockHeader';
        header.parentNode.style.border = '1px solid #BDCF74';
    }
    else
    {
        block.style.display = 'none';
        block.style.visibility = 'hidden';
        ahref.innerHTML = '[pokaż]';
        header.className = 'blockHeaderHidden';
        header.parentNode.style.border = '1px solid #dddddd';
    }
}

function ShowImageInPopup(img, title)
{
    var newWindow;
    
    newWindow = window.open('', 'nw', 'menubar=no, toolbar=no, location=no, scrollbars=no, resizable=yes, status=no, width=600, height=500, left=400, top=400');

    newWindow.document.write("<html><head><title>" + title + "</title></head><body><a href='javascript:window.close();'><img id='imagePreview'  border='0' alt='' src='" + img + "' / onLoad='window.resizeTo(this.width+30, this.height+80); e = ((screen.width - this.width) / 2); f = ((screen.height - this.height) / 2); window.moveTo(f, e);'></a></body></html>");

    newWindow.document.close();
}