function objGet(x)
{
  return document.getElementById(x);  
}

function getObj(x)
{
  return document.getElementById(x); 
}

function zvyrazni(co)
{
  var obj = getObj(co);
  if (obj && obj.style){
    obj.style.background='#ffd0ff';
  }
}

function zpet(co,stul)
{
  var obj = getObj(co);
  if (obj && obj.style){
    if (stul=='1') obj.style.background='#ffffe0';
    if (stul=='2') obj.style.background='#ffe0ff';
    if (stul=='3') obj.style.background='#e0ffff';
    if (stul=='4') obj.style.background='#ffe0e0';
    if (stul=='5') obj.style.background='#e0ffe0';
  } 
}

function rollup(x){
  menu[x] = 0;
  window.setTimeout('rollup_now("'+x+'");',cas);
}

function rollup_now(x){
  var n = getObj('menu'+x);
  var m = getObj('sm'+x);
  if ((m)&&(m.style)){
    if (menu[x] == 0){ 
      if (x <= 6){
        m.style.background='#d6d3e7';
      }
      else{
        m.style.background='#8d86a4';
        m.style.color='#ffffff';
      }
    }
  }
  if ((n)&&(n.style)){
    if (menu[x] == 0){ 
      n.style.display = 'none';
      if (x <= 6){
        m.style.background='#d6d3e7';
      }
      else{
        m.style.background='#8d86a4';
        m.style.color='#ffffff';
      }
      menu[x] = -1;
    }
  }
}

function rolldown(x){
  if (zust == 0){
    for (i=prvni;i<=max;i++){
      rollup_now(i);
    }
  }
//  alert(x);
  var n = getObj('menu'+x);
  var m = getObj('sm'+x);

  if ((m)&&(m.style)){
    if (x <= 6){
      m.style.background='#f0f1fa';
    }
    else{
      m.style.background='#d6d3e7';
      m.style.color='#313149';
    }
  }
  if ((n)&&(n.style)){
    n.style.display = 'block';
    if (menu[x] == 1){
      window.clearTimeout();
    }
    menu[x] = 1;
  }
}

function colorize(x,variant){
  var n = getObj(x);

  if ((n)&&(n.style)){
    if (variant==0){
      n.style.background='#f0f1fa';
    }
    else{
      n.style.background='#d6d3e7';
    }
  }
}

function hideit()
{
  var obj = getObj('uvodni_napis');
  if (obj&&obj.style){
    obj.style.display = 'none';
  }
}

