d=document;l=(d.layers)?1:0;op=navigator.userAgent.toLowerCase().indexOf('opera')!=-1;ie=(d.all)?1:0;
function PotvrditText(text) {
  if(confirm(text)) return true; else return false;
  }
function KategorieOpen(fname,iname) {
  var w=500;
  var h=300;
  mywindow=window.open('../main/catbrowse.php?formular='+fname+'&bunka='+iname,'Kategorie','width='+w+',height='+h+',scrollbars=yes,resizable=yes,menubar=yes,status=yes');
  mywindow.moveTo(screen.width/2-w/2,screen.height/2-h/2-30);
  mywindow.focus();
}
function GenKodOpen(url) {
  mywindow=window.open('../main/server_kod.php?'+url,'GenKod','maximized,resizable=yes,scrollbars=yes,menubar=yes,status=yes');
  mywindow.focus();
}
function getObj(name) {
  if (document.getElementById)
    {this.obj = document.getElementById(name);
    this.style = document.getElementById(name).style;}
  else if (document.all)
    {this.obj = document.all[name];
    this.style = document.all[name].style;}
  else if (document.layers)
    {this.obj = document.layers[name];
    this.style = document.layers[name];}
}
function hidestyle(whichid)
{
  mainobject = new getObj(whichid);
  if (mainobject.style.display=='none')
    {mainobject.style.display='';}
  else
    {mainobject.style.display='none';}
}
function ShodVse() {
  menu1off=1;
  menu2off=1;
  menu3off=1;
  menu4off=1;
  menu5off=1;
}
function Vyrovnat() {
  mainobject = new getObj("menu1");mainobject.style.top=140;mainobject.style.left=winW()/2-178;
  mainobject = new getObj("menu2");mainobject.style.top=129;mainobject.style.left=winW()/2-85;
  mainobject = new getObj("menu3");mainobject.style.top=118;mainobject.style.left=winW()/2+15;
  mainobject = new getObj("menu4");mainobject.style.top=105;mainobject.style.left=winW()/2+145;
  mainobject = new getObj("menu5");mainobject.style.top=92;mainobject.style.left=winW()/2+250;
  setTimeout("Vyrovnat()",1000);
}
function winW(){if(window.innerWidth)return window.innerWidth;else return d.body.clientWidth;}
function winH(){if(window.innerHeight)return window.innerHeight;else return d.body.clientHeight;}

function DisplayOn(id) {
  mainobject = new getObj(id);
  mainobject.style.display='';
}
function DisplayOff(id) {
  mainobject = new getObj(id);
  mainobject.style.display='none';
}
function Ukaz(m) {
  eval(m+"off=99;");
  mainobject = new getObj(m);
  mainobject.style.display='';
}
function Udrz(m) {
  eval(m+"off=99;");
}
function Shod(m) {
  eval(m+"off=1;");
}
function Odpocet() {
  for(c=1;c<=4;c++) {
    eval("temp1=menu"+c+"off");
    mainobject = new getObj("menu"+c);
    if(temp1>1) {
      temp1=temp1-(11-Math.round(temp1/10));
      eval("menu"+c+"off=temp1");
      mainobject.style.display='';
      mainobject.style.filter='alpha(opacity:'+temp1+')';
      }
      else {
      if(mainobject.style.display!='none') {
        mainobject.style.display='none';
        eval("lmenu"+c+".src=imgmenu"+c+"_off.src");
        }
      }
  }
  setTimeout("Odpocet()",150);
}

