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 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 OpenBlock(id)
{
	var obj = getID(id);
	if (!obj) {
		alert('Chyba JS: '+id+' not found.');
		return false;
	}
	obj.style.display = 'block';
}

function CloseObj(id)
{
	var obj = getID(id);
	if (!obj) {
		alert('Chyba JS: '+id+' not found.');
		return false;
	}
	obj.style.display = 'none';
}

function openClose(id)
{
	var obj = getID(id);
	if (!obj) {
		alert('Chyba JS: '+id+' not found.');
		return false;
	}
	if (obj.style.display=='block')
		obj.style.display ='none';
	else
		obj.style.display = 'block';
	return true;
}

