var max_col = 0;

function w(url)
{
	window.open(url, "links", "menubar=yes, status=yes, toolbar=yes, scrollbars=yes, resizable=yes, location=yes");
	return false;
}

function wi(url, width, height)
{
	width += 50; height += 50;
	window.open(url, 'foto', 'width='+width+', height='+height+', toolbar=no, location=no, resizable=yes, scrollbars=yes, top=100, left=100');
	return false;
}

function hdmenu(main_element, sub_element)
{
    if (main_element) {
        var e = document.getElementById('hid' + main_element);
        e.style.display = 'none';
        bsmenu(main_element);
    }
    if (sub_element) {
        var f = document.getElementById('hid' + sub_element);
        f.style.display = 'none';
        bssubmenu(sub_element);
    }
}

function vwmenu(main_element, sub_element)
{
    if (main_element) {
        var e = document.getElementById('hid' + main_element);
        e.style.display = 'block';
        chmenu(main_element);
    }
    if (sub_element) {
        var f = document.getElementById('hid' + sub_element);
        f.style.display = 'block';
        chsubmenu(sub_element);
    }
    window.setTimeout('hdothers(' + main_element + ', ' + sub_element +')', 30);
}

// první úroveň menu
function chmenu(element)
{
    var e = document.getElementById('vis' + element);
    e.className = 'sel-level1';
}


function bsmenu(element)
{
    var e = document.getElementById('vis' + element);
    e.className = 'level1';
}

// druhá úroveň menu
function chsubmenu(element)
{
    var e = document.getElementById('vis' + element);
    e.className = 'sel-level2';
}

function bssubmenu(element)
{
    var e = document.getElementById('vis' + element);
    e.className = 'level2';
}

function hdothers(no_main, no_sub)
{
    var i = 0;
    for (i = 1; i <= max_col; i++) {
        j = 200 + i;
        bottom = ((i - 1) * height) + main_top;
        if (j != no_sub) {
            var e = document.getElementById('hid' + j);
            e.style.display = 'none';
            if (no_sub) {
                var f = document.getElementById('vis' + j);
                if (f.className == 'sel-level2') f.className = 'level2';
            }
        }
    }

    for (i = 1; i <= 6; i ++) {
        if (no_main != i) {
            var g = document.getElementById('hid' + i);
            if (g && g.style && g.style.display) g.style.display = 'none';
            var h = document.getElementById('vis' + i);
            if (h && h.className) h.className = 'level1';
        }
    }
}

function AddFavorite(linkObj,addUrl,addTitle)
{
  if (document.all && !window.opera)
  {
    window.external.AddFavorite(addUrl,addTitle);
    return false;
  }
  else if (window.opera && window.print)
  {
    linkObj.title = addTitle;
    return true;
  }
  else if ((typeof window.sidebar == 'object') && (typeof window.sidebar.addPanel == 'function'))
  {
    if (window.confirm('Přidat oblíbenou stránku jako nový panel?'))
    {
      window.sidebar.addPanel(addTitle,addUrl,'');
      return false;
    }
  }
  window.alert('Po potvrzení stiskněte CTRL-D,\nstránka bude přidána k vašim oblíbeným odkazům.');
  return false;
}

// 11.09.2007

function SlideShow() {
	var aimg = document.getElementById('slide-a');
	var img = document.getElementById('slide-img');

	aimg.href = adata[imgact][0];
	aimg.onClick = adata[imgact][1];

//	img.width = adata[imgact][3];
//	img.height = adata[imgact][4];
	img.alt = adata[imgact][5];
	img.src = adata[imgact][2];

	imgact++;
	if (imgact == imgcnt) imgact = 0;
}

var height = 25; // výška řádku
var main_top = 0; // nastavení spodního řádku
var dom = document.getElementById ? true : false;
var dhtml = dom ? true : false;
if (dhtml) {
	document.write('<style type="text/css">');

    for (i = 1; i <= 20; i++) {
        j = 200 + i;
        bottom = ((i - 1) * height) + main_top;
        document.write('#hid' + j + ' { top:' + bottom +'px }\n');
    }

    for (i = 1; i <=6; i++) {
        document.write('#vis' + i + ' { display:block;}\n');
    }
    document.write('</style>');
}
