function getID(id,doc)
{
    if (!doc) doc = document;
    if (document.all) return doc.all[id];
    else return doc.getElementById(id);
}
function isIE()
{
   /* window.opera identifikuje prohlizec Opera ikdyz je
      nastaven tak, aby se identifikoval jako Explorer */
  if(window.opera) return false;
  return (navigator.appName == 'Microsoft Internet Explorer');
}

function isOpera()
{
  /* window.opera identifikuje prohlizec Opera ikdyz je
     nastaven tak, aby se identifikoval jako Explorer  */
   return window.opera;
}


function openWin(url,width,height,pkey)
{
        if (!pkey) pkey = 'openWin';
        if (!width) width=620;
        if (!height) height=480;
        var w = window.open(url,pkey,"width="+width+",height="+height+",toolbar=0,directories=0,menubar=0,status=0,scrollbars=yes,resizable=yes");
	if (!w) return w;
	w.focus();
	return w;
}

function write_pocitadlo ()
{
   var s = "<a href=\"http://counter.cnw.cz\" target=\"_parent\"><img src=\"http://counter.cnw.cz/trackit.cgi?sallyx&amp;t1&amp;" + escape(top.document.referrer) + "\" alt=\"CNW:Tracker\" border=\"0\" width=\"11\" height=\"11\"></a>&nbsp;";
   
   var obj = getID('pocitadlo');
   if (!obj) return false;
   obj.innerHTML = s;
   return true;
}

function otevri (odkaz) {
       	return window.open(odkaz,"odkaz","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no");
}

function target_blank (odkaz) {
       	var w = window.open(odkaz,"t_blank","copyhistory=yes");
	if (!w) return w;
	w.focus();
	return w;
}

function knackerEvent(eventObject)
{ 
	if (eventObject && eventObject.stopPropagation) { 
		eventObject.stopPropagation(); 
	} 
	else
	if (eventObject && eventObject.cancelBubble) {
		eventObject.cancelBubble = true;
	}
	else
	if (window.event && !window.event.cancelBubble ) { 
		window.event.cancelBubble = true; 
	} 
	/*if (eventObject && eventObject.preventDefault) { 
		eventObject.preventDefault(); 
	} 
	if (window.event) { 
		window.event.returnValue = false; 
	} */
}
	
function show_note(evnt,podminka)
{
	var div = getID('what_note');
	if (!podminka) {div.style.display='none'; return true;}
	x = evnt.x ? evnt.x : evnt.pageX;
	y = evnt.y ? evnt.y : evnt.pageY;
	x = x+20;
	div.innerHTML = podminka;
	div.style.display='block';
	if (isOpera() || isIE()) {
		 x = x +(window.pageXOffset ? window.pageXOffset :
			(document.documentElement.scrollLeft ?
			document.documentElement.scrollLeft : 0));
		 y = y +(window.pageYOffset ? window.pageYOffset :
			(document.documentElement.scrollTop ?
			document.documentElement.scrollTop : 0));
	}
	div.style.left = x +'px';
	div.style.top = y - div.offsetHeight + 'px';
	return true;
}

function visible_obj (id)
{
	var obj = getID(id);
	if (!obj) return false;

	if(obj.style.visibility == 'visible')
		obj.style.visibility = 'hidden';
	else
		obj.style.visibility = 'visible';

	return true;
}
