// JavaScript Document
var URL = '/';
dirImages = URL+'images/';

function onerror()
{
    //alert('err image loading');
}

function toggleChkb(form, stat, id)
{
    if (f=getElement(form))
    {
        rList = f.getElementsByTagName('INPUT');
        exp = RegExp('' + id + '.*', 'i');
        for (var i = 0; i < rList.length; i++)
        {
            if (rList[i].type=='checkbox')
            {
                if (id!='' && rList[i].id.toString().match(exp))
                    rList[i].checked = stat ? true : false;
                else if (id=='')
                    rList[i].checked = stat ? true : false;
            }
        }
    }
}

function popUp(type, href, x, y)
{
    switch (type)
    {
        case 'galerie':
            if (!x)
                x=640;
            if (!y)
                x=480;
            nw = window.open(href,'Foto','width='+x+', height='+y+', toolbar=0, scrollbars=yes, resizable');
            break;
        case 'vozovy':
            if (!x)
                x=640;
            if (!y)
                x=480;
            nw = window.open(href,'Foto','width='+x+', height='+y+', toolbar=0, scrollbars=yes, resizable');
            break;
    }
    if ( typeof(nw) != 'undefined' )
        nw.focus();
}

function popUpImage(url, x, y, wname, title)
{
    if (!x)
        x=640;
    if (!y)
        x=480;
    if (!wname)
        wname = 'popUpImageWindow'
    if (!title)
        wname = 'Image';
    nw = window.open('_blank','_blank','width='+x+', height='+y+', toolbar=0, scrollbars=yes, resizable');
    if ( typeof(nw) != 'undefined' )
    {
        ne = nw.document.createElement('body');
        nw.document.appendChild(ne);
        nw.document.getElementsByTagName('body')[0].innerHTML = '<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs"><head><meta http-equiv="content-type" content="text/html; charset=utf-8"><title>'+title+'</title><style type="text/css" media="all">html {height: 98%; padding: 0; margin: 0;} body {margin: 0px; padding: 0; text-align: center; height: 99%;} #table {border-collapse: collapse; width: 100%; margin: 0 auto; height: 100%;} #table td {height: auto;} #pager {height: 100%;} table td {vertical-align: middle; text-align: center; padding: 10px;}</style></head><body onclick="window.close();"><div id="pager"><table id="table" cellpadding="0" cellspacing="0"><tr><td><img src="'+url+'" alt="'+title+'" title="'+title+'"></td></tr><table></div></body></html>';
        nw.focus();
        //nw.document.onclick = nw.close;
    }
    return false;
}

function onLoad()
{
    unBlurAllLinks();
}

function redir(url, delay)
{
    if (typeof(delay)=='undefined' || delay=='')
        window.location.href = url;
    else
        setTimeout('window.location.href = \''+url+'\'', delay*1000);
}

function foc()
{
    if (f = getElement('focusThis'))
    {
        f.focus();
    }
}

function truebody()
{
    return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}


window.onload = onLoad;

