function Fotogalerie(server, tabulka, id, vybrany_dokument)
{
  var okno;
  var vyska, sirka;
  var url, nazev, vlastnosti;

  sirka = 800;
  vyska = 598;

  url        = "fotogalerie.php?server="+server+"&tabulka="+tabulka+"&id="+id+"&vybrany_dokument="+vybrany_dokument;
  nazev      = "Fotogalerie_"+id;
  vlastnosti = "width="+sirka+", height="+vyska+", resizable=yes, scrollbars=yes";

  okno = window.open(url, nazev, vlastnosti);

  okno.moveTo(screen.width / 2 - sirka / 2, screen.height / 2 - vyska / 2);  
}

function ExternalLink(URL)
{
  var okno;

  /*
  var vlastnosti;
  var vyska, sirka;

  vyska = Math.round(screen.height * 0.6);
  sirka = Math.round(screen.width * 0.6); 
    
  vlastnosti = "width="+sirka+", height="+vyska+", resizable=yes, scrollbars=yes, toolbar=yes, menubar=yes, adressbar=yes, status=yes, location=yes, directories=yes";
  */
  if (okno = window.open(URL, "_blank"))
    return true;
  else
    return false;
}


function PodbarviPrvek(prvek, stav)
{
  if (stav == 2)
    prvek.style.backgroundColor = '#F7F7F7';    
  else if (stav == 1)
    prvek.style.backgroundColor = '#FCD4B3';    
  else if (stav == 0)
    prvek.style.backgroundColor = '#F7F7F7';
  else
    prvek.style.backgroundColor = '#FFFFFF';
}

function WriteEmbed(typ, lang)
{
  var text;
  if (typ == "produkty")
    text = "<embed src='/"+lang+"/images/menu_index.swf' quality='high' bgcolor='#FFFFFF' width='800' height='122' name='menu_flash' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed>";
  else if (typ == "motiv")
    text = "<embed src='/"+lang+"/images/motiv.swf' menu='false' quality='high' bgcolor='#FFFFFF'  width='177' height='229' name='motiv_flash' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed>";
  document.writeln(text);
}


function Fotogalerie(server, tabulka, id, vybrany_dokument)
{
  var okno;
  var vyska, sirka;
  var url, nazev, vlastnosti;

  sirka = 800;
  vyska = 598;

  url        = "/cz/fotogalerie.php?server="+server+"&tabulka="+tabulka+"&id="+id+"&vybrany_dokument="+vybrany_dokument;
  nazev      = "Fotogalerie_"+id;
  vlastnosti = "width="+sirka+", height="+vyska+", resizable=yes, scrollbars=yes";

  okno = window.open(url, nazev, vlastnosti);

  okno.moveTo(screen.width / 2 - sirka / 2, screen.height / 2 - vyska / 2);  
}



function TextPokracovani(id)
{
  var tecky = document.getElementById("tritecky_"+id);
  var text  = document.getElementById("text_"+id);
  if (tecky.style.display == "") {
    tecky.style.display = "none";
    text.style.display = "";
  }
  else {
    tecky.style.display = "";
    text.style.display = "none";
  }
}
/*
function Rezervace(id)
{
   document.forms.rezervace.v_termin.value = id;
   document.forms.rezervace.submit();
}*/

function Rezervace(id, selector)
{

   document.getElementById(selector).v_termin.value = id;
   document.getElementById(selector).submit();
}

function PodbarviRadek(radek, stav)
{
  if (stav == 1)
    radek.className = 'radek_podbarveny';
  else
    radek.className = 'radek';
}

function DalsiCestujici()
{
  var text;
  _dalsi_cestujici++;

  text  = "";

  text += "     <table class='cestujici' cellspacing='0' cellpadding='2'>";
  text += "      <input type='hidden' name='c_poradi[]' value='" + _dalsi_cestujici + "'>";
  text += "      <tr class='cestujici_polozky'>";
  text += "       <td width='4%'>&nbsp;</td>";
  text += "       <td width='17%'>Příjmení</td>";
  text += "       <td width='17%'>Jméno</td>";
  text += "       <td width='17%'>Datum narození<br><span class='mensi'>DD. MM. RRRR</span></td>";
  text += "       <td width='17%'>Číslo cest. dokladu (pasu)</td>";
  text += "       <td colspan='2'>&nbsp;</td>";
  text += "      </tr>";

  text += "      <tr>";
  text += "       <td><div class='poradi'>" + _dalsi_cestujici + ".</div></td>";
  text += "       <td><input type='text' name='c_prijmeni[]'></td>";
  text += "       <td><input type='text' name='c_jmeno[]'></td>";
  text += "       <td><input type='text' name='c_narozeni[]'></td>";
  text += "       <td><input type='text' name='c_pas[]'></td>";
  text += "       <td colspan='2'>&nbsp;</td>";
  text += "      </tr>";


  text += "      <tr class='cestujici_polozky'>";
  text += "       <td>&nbsp;</td>";
  text += "       <td width='17%'>PSČ</td>";
  text += "       <td width='17%'>Město</td>";
  text += "       <td colspan='2'>Ulice a č.p.</td>";
  // text += "       <td width='17%'>Č.P., Č.O.</td>";
  text += "       <td>Telefon</td>";
  text += "       <td>Mobil</td>";
  text += "      </tr>";

  text += "      <tr>";
  text += "       <td>&nbsp;</td>";
  text += "       <td><input type='text' name='c_psc[]'></td>";
  text += "       <td><input type='text' name='c_mesto[]'></td>";
  text += "       <td colspan='2'><input type='text' name='c_ulice[]' style='width: 100%'></td>";
  // text += "       <td><center><input type='text' name='c_cp[]' style='width: 28px'> &nbsp; <input type='text' name='c_co[]' style='width: 28px'></center></td>";
  text += "       <td><input type='text' name='c_telefon[]' class='telefon'></td>";
  text += "       <td><input type='text' name='c_mobil[]' class='telefon'></td>";
  text += "      </tr>";
  text += "     </table>";
  document.getElementById("dalsi_cestujici").innerHTML += text; 
}

var barva = true;

function Blikej(el) {
  if (barva) {
    document.getElementById('last').style.backgroundColor = '#fff';
    document.getElementById('last').style.color = '#F82B22';
    document.getElementById('last').style.borderColor = '#F82B22';
    barva = false;  
  }  
  else {
    document.getElementById('last').style.backgroundColor = '#F82B22';
    document.getElementById('last').style.color = '#fff';
    document.getElementById('last').style.borderColor = '#fff';
    barva = true; 
  }
  pom = setTimeout("Blikej()", 500);
}


