moz=document.getElementById&&!document.all;
var isVeryOldIEcrap = false; var isIEcrap = false; var isIE = false;

var a = new Array();
var b = null;
var d = 0;

function frame(){
  b.src = a[d].src;
  d++;
  if(d>59)d=0;
  if(isIE)
    setTimeout('frame()',200);
  else
    setTimeout('frame()',70);
}

function anime(){
  b = document.getElementById('digianca');
  var c = '0';
  for(i=0;i<60;i++){
    a[i]=new Image();
    if(i>9)c='';
    a[i].src = 'hlava/u/anca_hlava_00'+c+i+'.png';
  } 
  //setTimeout('frame()',5000);  
}

//alert('?');
//if(isIEcrap)document.getElementById('bottomone').innerHTML = document.getElementById('bottomone').innerHTML+'<br>'+'You are using old MS browser crap, please consider to try something else.';

function pngsupport(){

var arVersion = navigator.appVersion.split("MSIE");
if(arVersion.length>1){
var version = parseFloat(arVersion[1]);

if ((version >= 7)) 
{
  //alert('browser not ok, but it should go');
}else if ((version >= 5.5) && (document.body.filters)) 
{
   //alert('with a little help...');
   for(var i=0; i<document.images.length; i++)
   {
      var img = document.images[i];
      var imgName = img.src.toUpperCase();
      if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
      {
         var imgID = (img.id) ? "id='" + img.id + "' " : "";
         var imgClass = (img.className) ? "class='" + img.className + "' " : "";
         var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
         var imgStyle = "display:inline-block;" + img.style.cssText ;
         if (img.align == "left") imgStyle = "float:left;" + imgStyle;
         if (img.align == "right") imgStyle = "float:right;" + imgStyle;
         if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
         var strNewHTML = "<span " + imgID + imgClass + imgTitle;
         strNewHTML = strNewHTML + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";";
         strNewHTML = strNewHTML + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader";
         strNewHTML = strNewHTML + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"; 
         img.outerHTML = strNewHTML;
         i = i-1;
      }
   }
}else{
   //alert('gee, browser is very old crap');
   for(var i=0; i<document.images.length; i++)
   {
      var img = document.images[i];
      var imgName = img.src.toUpperCase();
      if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
      {
         img.src=imgName.substring(0,imgName.length-3)+'gif';
         img.style.display='none';
         img.style.display='block';
      }
   }
}
}else{
   //alert('browser is ok');
}

    return false;
}
function showElementAtItemWithOffset(id_element, id_item, ox, oy)
{
    var p;
    var x = 0;
    var y = 0;
    var parent;
    p = document.getElementById(id_item);
    while(p && p.offsetParent)
    {
        x += p.offsetLeft;
        y += p.offsetTop;
        if (p.parentNode.scrollTop != undefined)
        {
            y -= p.parentNode.scrollTop;
        }
        p = p.offsetParent;
    }
    

    document.getElementById(id_element).style.left = String(Number(x)+Number(ox))+'px';
    document.getElementById(id_element).style.top = String(Number(y)+Number(oy))+'px';
    document.getElementById(id_element).style.position = 'absolute';
    document.getElementById(id_element).style.display = 'block';
    
    return false;                    
}

//--[@OPACITY]--/
function setOpac(o,t) {
  t=(t==100)?99.999:t;
  if(typeof o.style.opacity !== 'undefined'){
// W3C
    o.style.opacity=t/100;
  }else if (typeof o.style.MozOpacity !== 'undefined') {
// Older Mozilla
    o.style.MozOpacity=t/100;
  }else if (typeof o.style.filter != 'undefined') {
// IE 
    o.style.filter='alpha(opacity:'+t+')';
  }else if (typeof o.style.KHTMLOpacity != 'undefined') {
// Older KHTML Based Browsers 
    o.style.KHTMLOpacity=t/100;
  }
};
//--[/@OPACITY]--/
function menuBase(){
  var odd=false;

  if(isVeryOldIEcrap){
  
  obj_showElementAtItemWithOffset('menuline','menubox',0,0);
  }
  else if(isIEcrap)
  obj_showElementAtItemWithOffset('menuline','menubox',18,16);
  else
  obj_showElementAtItemWithOffset('menuline','menubox',0,0);
  var d = document.getElementById('menuline');
  var dd=d.getElementsByTagName('DIV');
  for(var i=0;i<dd.length;i++){
    dd[i].style.display='none';
    if(isVeryOldIEcrap){
      //dd[i].style.width='90px';
      dd[i].parentNode.style.width='99px';
      dd[i].parentNode.style.overflow='hidden';
    }
    
  }
  var uu=d.getElementsByTagName('UL');
  var l=uu[0].getElementsByTagName('LI');
  for(var ii=0;ii<l.length;ii++){
    if(Math.round(ii/2)==(ii/2))odd=true; else odd=false;

              if(odd){      
                l[ii].style.color = '#000000';
                var a = l[ii].getElementsByTagName('A');
                if(a.length>0)
                a[0].style.color = '#000000';
              }else{
                l[ii].style.color = '#E1D708';
                var a = l[ii].getElementsByTagName('A');
                if(a.length>0)
                a[0].style.color = '#E1D708';
              }    
    
  }

}
function submenu(o){
  var n=o.id;var odd=false;
  document.getElementById('sub_'+n).style.display='block';

    var s=document.getElementById('sub_'+n);
    if(isIE) s.style.backgroundImage='url(none.gif)';
    var u=s.getElementsByTagName('UL');
    if(u.length>0) {
        var h=0;
        for (var i=0;i<u.length;i++){
          if(isIE)u[i].style.backgroundImage='url(none.gif)';
          h=Math.floor(Number(h)+u[i].offsetHeight);
          
            var l = u[i].getElementsByTagName('LI');
            for (var ii=0;ii<l.length;ii++){
              if((isIEcrap)||(isVeryOldIEcrap)) l[ii].style.marginLeft = '-16px';

              if(n=='program'){
                if(Math.round(ii/2)==(ii/2))odd=false; else odd=true;
              }else{
                if(Math.round(ii/2)==(ii/2))odd=true; else odd=false;
              }
              if(odd){      
                l[ii].style.backgroundColor = '#E1D708';
                var a = l[ii].getElementsByTagName('A');
                if(a.length>0)
                a[0].style.color = '#000000';
              }else{
                l[ii].style.backgroundColor = '#E1D708';
                var a = l[ii].getElementsByTagName('A');
                if(a.length>0)
                a[0].style.color = '#000000';
              }

            }
          
        }
        s.style.height=h+'px';
      }
  
}
function busmenu(o){
  var n=o.id;
  document.getElementById('sub_'+n).style.display='none';
}

function startup(){
  if(window.opera){
    //opera not works as intended
  }else{
    document.getElementById('hlavicka').innerHTML = '<a href="index.php"><img id="digianca" src="hlava/u/anca_hlava_0000.png" style="border-width:0px;"></a>';
  }
var arVersion = navigator.appVersion.split("MSIE");
if(arVersion.length>1){
var version = parseFloat(arVersion[1]);
  if (version<6)isVeryOldIEcrap = true;
  else
  if (version<8)isIEcrap = true;
  isIE = true;
}


  menuBase();
  pngsupport();
if(isIEcrap)  
  obj_showElementAtItemWithOffset('langchanger','head',800,30);//30
else
  obj_showElementAtItemWithOffset('langchanger','head',800,30);

  if(window.opera){
    obj_showElementAtItemWithOffset('hlavicka','head',80,10);//10
  }else{
    obj_showElementAtItemWithOffset('hlavicka','head',70,-20);//10
  }

  
  
document.getElementById('langchanger').style.visibility='visible';
var aanch = document.getElementsByTagName('A');
var ch = new CookieHandler;
var l = ch.getCookie('lng');
var xslang = 'lng='+l;
//alert(xslang);
  for(x=0;x<aanch.length;x++){
    if (l.toUpperCase().match(aanch[x].innerHTML)) aanch[x].style.textDecoration='underline';
    //if (document.URL.match(aanch[x].href)) aanch[x].style.backgroundColor='yellow';
    //if (aanch[x].href.match(xslang)) aanch[x].style.backgroundColor='yellow';
  }

if(window.opera){
  document.getElementById('hlavicka').innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="160" height="160" id="fl01" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="hlava.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent"><embed src="hlava.swf" wmode="transparent" quality="high" width="160" height="160" name="fl01" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
}else{
  anime();
}  
  var a=document.getElementById('mainbody');
  if(window.opera){
    //opera not works as intended
    //setOpac(a,80);
  }else{
    setOpac(a,80);
  }
  var im = a.getElementsByTagName('IMG');
  for (var ii=0;ii<im.length;ii++){
    //setOpac(im[ii],99);
    im[ii].style.zIndex = '100';
  }
  
  
}
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	}
	else {
		window.onload = function() {
			if (oldonload) {
				oldonload();
			}
			func();
		}
	}
}
addLoadEvent(startup);

function showDetail(x){
  //alert('sorry, toto ešte nie je hotovo.');
  return true;
}

function setlang(x){
  //alert('sorry, toto ešte nie je hotovo.');
  return true;
}
function setaltlang(x){
return true;
}
function CookieHandler() {
 
	this.setCookie = function (name, value, seconds) {
 
		if (typeof(seconds) != 'undefined') {
			var date = new date();
			date.setTime(date.getTime() + (seconds*1000));
			var expires = "; expires=" + date.toGMTString();
		}
		else {
			var expires = "";
		}
 
		document.cookie = name+"="+value+expires+"; path=/";
	}
 
	this.getCookie = function (name) {
 
		name = name + "=";
		var carray = document.cookie.split(';');
 
		for(var i=0;i < carray.length;i++) {
			var c = carray[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(name) == 0) return c.substring(name.length,c.length);
		}
 
		return null;
	}
 
	this.deleteCookie = function (name) {
		this.setCookie(name, "", -1);
	}
 
}

function obj_showElementAtItemWithOffset(id_element, id_item,l,t)
{
    var p;
    var x = 0;
    var y = 0;
    var parent;
    p = document.getElementById(id_item);
    while(p && p.offsetParent)
    {
        x += p.offsetLeft;
        y += p.offsetTop;
        if (p.parentNode.scrollTop != undefined)
        {
            //y -= p.parentNode.scrollTop;
        }
        p = p.offsetParent;
    }
    
    document.getElementById(id_element).style.left = Number(x+l)+'px';
    document.getElementById(id_element).style.top = Number(y+t)+'px';
    document.getElementById(id_element).style.position = 'absolute';//absolute
    document.getElementById(id_element).style.display = 'block';
    
    return false;                    
}

function setPage(x){
return true;
}