function openwin(url,name,width,height){
  wasOpen  = false;
  win = window.open(url,name,"width="+width+",height="+height+",scrollbars=no");    
  return (typeof(win)=='object')?true:false;
}
//onclick="return !openWindow(this.href);"
function openWindow(url){
   wasOpen  = false;
   win = window.open(url);    
   return (typeof(win)=='object')?true:false;
}
function openWindowSize(url,width,height){
   wasOpen  = false;
   win = window.open(url,'picture','toolbar=0,location=0,directories=0,status=yes,menubar=0,scrollbars=yes,resizable=yes,width='+width+',height='+height+',titlebar=yes')
   return (typeof(win)=='object')?true:false;
}
function fitWinToContent() {
	if (typeof(objGet('obsah'))=='object') {
		var rozmer_vyska;
		if (window.screen) {
		  rozmer_vyska = objGet('obsah').offsetHeight;
		  if (rozmer_vyska >= screen.availHeight){
		  	rozmer_vyska = screen.availHeight;
		}else{
			rozmer_vyska = objGet('obsah').offsetHeight;
		}
			window.resizeTo(objGet('obsah').offsetWidth+10,
rozmer_vyska+29);
			window.focus();
		}
	}
}
 function objGet(x) {
   if (typeof x != 'string') return x;
   else if (Boolean(document.getElementById))
      return document.getElementById(x);
   else if (Boolean(document.all))
      return eval('document.all.'+x);
   else if (Boolean(document.ids))
      return eval('document.ids.'+x);
   else
      return null;
}



var mbW=250;
var mbA,mbT,mbTf,mbSf;
var mbR = [];

function mbSet(m,c) {
if (document.getElementById&&document.createElement) {
	var m=document.getElementById(m);
	m.className=c;
	mbR[mbR.length] = m;
	var i;

	e=m.getElementsByTagName('a');
	if (!mbTf) mbTf=new Function('mbHT();');
	if (!mbSf) mbSf=new Function('mbS(this);');
	for (i=0;i<e.length;i++) {
		e[i].onmouseout=e[i].onblur=mbTf;
		e[i].onmouseover=e[i].onfocus=mbSf;
	}

	m=m.getElementsByTagName('ul');
	for (i=0;i<m.length;i++) {
		mbH(mbL(m[i]));
	}
}}

function mbHA() {
	if (mbA) {
		while (mbA) mbH(mbA);
		mbHE('visible');
	}
}

function mbHT() {
	if (!mbT) mbT=setTimeout('mbHA();', mbW);
}

function mbTC() {
	if (mbT) {
		clearTimeout(mbT);
		mbT=null;
	}
}

function mbS(m) {
	mbTC();
	if (mbA) while (mbA&&m!=mbA&&mbP(m)!=mbA) mbH(mbA);
	else mbHE('hidden');

	if (mbM(m)) {
		mbSH(m,'visible');
		mbA=m;
	}
}

function mbH(m) {
	if (m==mbA) mbA=mbP(m);
	mbSH(m,'hidden');
	mbT=null;
}

function mbL(m) {
	while (m && m.tagName != 'A') m = m.previousSibling;
	return m;
}

function mbM(l) {
	while (l && l.tagName != 'UL') l = l.nextSibling;
	return l;
}

function mbP(m) {
	var p = m.parentNode.parentNode;
	if (p.tagName == 'UL') {
		var i = 0;
		while (i < mbR.length) {
			if (mbR[i] == p) return null;
			i++;
		}
	} else {
		return null;
	}
	return mbL(p);
}

function mbSH(m,v) {
	m.className=v;
	mbM(m).style.visibility=v;
}

function mbHE(v) {
	//mbHEV(v,document.getElementsByTagName('select'));
}

function mbHEV(v,e) {
	for (var i=0;i<e.length;i++) e[i].style.visibility=v;
} 


function goUrl(arg)
{
	window.location=arg;
}



	var hover_color = null;
	function highlight_row(obj,w){
		if (hover_color == null) hover_color = getStyle('hover', "backgroundColor");
		var tds = obj.getElementsByTagName('td');
		for(i=0;i < tds.length;i++) {
			if (w == 1) {
				tds[i].style.backgroundColor = hover_color;
			} else tds[i].style.backgroundColor = "";
		}
	}
	
	// zjistime hodnotu z CSS, pouze pro IE!
	function getStyle(el, style) {
		el = document.getElementById(el);
		var value = el.style[style];
		if(!value) value = el.currentStyle[style];
		return value;
	}
	
	// inicializacni fce
	function hover_init() {
		if (document.all && document.getElementById && !window.opera) {
			
			// ZDE JE POTREBA DAT ID tabulky nebo upravit podle vlastnich potreb :)
			table = document.getElementById('htabulka');
			
			// nahodime na vsechny radky fci highlight_row
			trs = table.getElementsByTagName('tr');
			for(var i = 0; i < trs.length; i++){
				trs[i].onmouseover = function(){ highlight_row(this,1); }
				trs[i].onmouseout = function(){ highlight_row(this,0); }
			}
		}
	}

	function addBookmarkForBrowser() {
if (document.all)
{
	window.external.AddFavorite(document.location.href, document.title);
} else {
	window.sidebar.addPanel(document.title, document.location.href,"");
}
}
