function show(co) {
  wtf = document.getElementById(co);
  if (wtf.style.display=="none")
    wtf.style.display = "block";
  op = Number(wtf.style.opacity);
  if (op<1) {
    op+=0.03;
    setTimeout("show('"+co+"')",10);
  }
  else  {
    op = 1;
  }
  wtf.style.opacity = op;
}
function show_tl(num) {
  show("tlacitko"+num);
}
function hide(co) {
  wtf = document.getElementById(co);
  op = Number(wtf.style.opacity);
  if (op>0) {
    op-=0.03;
    setTimeout("hide('"+co+"')",10);
  }
  else  {
    op = 0;
    wtf.style.display = "none";
  }
  wtf.style.opacity = op;
}
function hidenow(co)  {
  wtf = document.getElementById(co);
  wtf.style.opacity = 0;
  wtf.style.display = "none";
}

function show_size(id,but,size)  {
  wtf = document.getElementById(id);
  wtf.style.height = size+"px";
  wtf2 = document.getElementById(but);
  
  size+=5;
  if (size<wtf2.offsetHeight)
    setTimeout("show_size('"+id+"','"+but+"',"+size+")",10);
  else
    wtf.style.height = wtf2.offsetHeight;
}

function showcontent()  {
  div = document.getElementById("content");
  div.style.display = "block";
  setTimeout(opened,10);
  show("content");
}

function get_out()  {
  window.location.href = "http://www.google.com";
}

function skrytclanek(id)
{
  hidenow("obrazek"+id);
  clanek_mene(id,-1);
  document.getElementById("hb"+id).innerHTML = "<a href='#' onclick='otevritclanek(\""+id+"\")'>O</a>";
}
function otevritclanek(id)
{
  show("obrazek"+id);
  clanek_vice(id,0);
  document.getElementById("hb"+id).innerHTML = "<a href='#' onclick='skrytclanek(\""+id+"\")'>X</a>";
}


function clanek_mene(id,size)
{
  div = document.getElementById("clanek"+id);
  if (size==-1)
    size = div.offsetHeight;
  div.style.height = size+"px";
  div2 = document.getElementById("nadpis"+id);
  size -= 10;
  if (size>div2.offsetHeight+10) {
    setTimeout("clanek_mene('"+id+"',"+size+")",10);
  }
  else
    div.style.height = (div2.offsetHeight+10)+"px";
}
function clanek_vice(id,size)
{
  div = document.getElementById("clanek"+id);
  if (size==-1)
    size = div.offsetHeight;
  div.style.height = size+"px";
  div2 = document.getElementById("clanek"+id+"2");
  size += 10;
  //document.getElementById("debug").innerHTML = div2.offsetHeight+"-"+size;
  if (size<div2.offsetHeight) {
    setTimeout("clanek_vice('"+id+"',"+size+")",10);
  }
  else
    div.style.height = (div2.offsetHeight)+"px";
}
function logo() {
  tricolor = "#FFFFFF";
  dvacolor = "#62749D";
  setTimeout("setcolor('p1','"+tricolor+"')",10);
  setTimeout("setcolor('p1','"+dvacolor+"')",100);
  setTimeout("setcolor('p2','"+tricolor+"')",100);
  setTimeout("setcolor('p2','"+dvacolor+"')",200);
  setTimeout("setcolor('p3','"+tricolor+"')",200);
  setTimeout("setcolor('p3','"+dvacolor+"')",300);
  setTimeout("setcolor('p4','"+tricolor+"')",300);
  setTimeout("setcolor('p4','"+dvacolor+"')",400);
  setTimeout("setcolor('p5','"+tricolor+"')",400);
  setTimeout("setcolor('p5','"+dvacolor+"')",500);
  setTimeout("logo()",10000);
}
function setcolor(id,color){
  document.getElementById(id).style.color = color;
}
function preview(wt,wt2)  {
  div = document.getElementById('preview_text');
  div.innerHTML = document.getElementById(wt).value;
  div = document.getElementById('preview_nadpis');
  div.innerHTML = document.getElementById(wt2).value;
  setTimeout("preview('"+wt+"','"+wt2+"')",1000);
}
