function openFoto($mkey) {
msg = window.open('foto_d.php?cislo='+$mkey, '_blank', 'toolbar=no, menubar=no, location=no, directories=no, scrollbars=no, resizable=no, status=no, width=40, height=40, top=40, left=40')
}

function openPrint($mkey) {
msg = window.open('tisk.php?id='+$mkey, '_blank', 'toolbar=yes, menubar=yes, location=no, directories=no, scrollbars=yes, resizable=no, status=no, width=660, height=550, top=40, left=40')
}

var id, akt, top
    left1 = -250,       // počáteční průhlednost
    step1 = 1;     // krok
    left2 = -800,       // počáteční průhlednost
    step2 = 1;     // krok
    left3 = -1200,       // počáteční průhlednost
    step3 = 1.15;     // krok
    poc = 5;       // počet snímků

function Start()
{
    akt=1;
    id = window.setInterval("Move()", 3);
}

function Move()
{
    left1 += step1;
    left2 += step2;
    left3 += step3;
    top = Math.round(Math.random()*150);
//    alert(left);

    if (left1 < window.screen.width) {
      document.getElementById("mrak1").style.left = left1;
    } else {
      document.getElementById("mrak1").style.left = -250;
      document.getElementById("mrak1").style.top = top;
      left1= -250;
    };

    if (left2 < window.screen.width) {
      document.getElementById("mrak2").style.left = left2;
    } else {
      document.getElementById("mrak2").style.left = -250;
      document.getElementById("mrak2").style.top = top;
      left2= -250;
    };

    if (left3 < window.screen.width) {
      document.getElementById("mrak3").style.left = left3;
    } else {
      document.getElementById("mrak3").style.left = -250;
      document.getElementById("mrak3").style.top = top;
      left3= -250;
    };

}

function Kytky()
{
//  alert(document.getElementById("mbd").offsetHeight);
  offset_top = document.getElementById("page_in").offsetTop+550;
  height = document.getElementById("page").clientHeight; 
  width = document.getElementById("page").clientWidth;
  for (i=1;i<=30;i++)
  {
    top = Math.round(Math.random()*(height-offset_top))+offset_top;
    if(top>=(height)) {
      alert(top);
      top=top-(height-offset_top);
    }
    left = Math.round(Math.random()*(width-50));
    num = Math.floor(Math.random()*7+1);
    document.write("<img class='kytka' id='kytka"+i+"' src='img/kytka"+num+".png' border='0' vspace='0' hspace='0' alt=''>\n");
    document.getElementById("kytka"+i).style.left = left;
    document.getElementById("kytka"+i).style.top = top;
  }
}

