function $() {
  var elements = new Array();

  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);

    if (arguments.length == 1)
      return element;

    elements.push(element);
  }

  return elements;
}

function switchBlock(id) {
	var s = $(id); 
	if (s.style.display == 'none') s.style.display = 'block'; 
		else s.style.display = 'none';
}

function switchBlockAnimated(id) {
	var d = $(id);
	if (!d) return false;
	var o = d.parentNode;
	if (!o) return false;
	if (d.showStatus) {
		var newsize = { width: bytefx.$size(d).width, height: 0 };
		bytefx.size(o, newsize, 40);
		bytefx.color(d, 'color', '#000', '#FFF', 40);
		d.showStatus = false;
	}
	else {		
		d.style.color = '#FFF';
		var newsize = { width: bytefx.$size(d).width, height: bytefx.$size(d).height };
		bytefx.size(o, newsize, 40);
		bytefx.color(d, 'color', '#FFF', '#000', 40);
		d.showStatus = true;
	}

}

document.write('<style type="text/css" media="screen">.skryt{overflow: hidden; height: 0px;}</style>');

function setTabActive(id) {
	var zalozky = document.getElementById('zalozky_telo');
	var prepinace = document.getElementById('prepinace');
	var bloky = zalozky.getElementsByTagName('div');
	var bunky = prepinace.getElementsByTagName('td');
	var divy = prepinace.getElementsByTagName('div');
	for (var i = 0; i < bloky.length; i++) {
		if (bloky[i].id == 'blok_'+id) {
			bloky[i].style.display = 'block';
			bunky[i].className = 'zalozka_aktivni';
			}
			else {
				bloky[i].style.display = 'none';
				bunky[i].className = 'zalozka';
			}
		divy[i].className = '';
		if (i == 0) divy[i].className = 'zalozka_prvni';
		if (i == bloky.length-1) divy[i].className = 'zalozka_posledni';
		if (i != bloky.length-1) if (bloky[i+1].id != 'blok_'+id) divy[i].className += ' zalozka_predel';
	}
	return false;
}
