/* -------------------------------------------  */
/* vytazeno z TD pred nadpisem -  background="../../0images/zahl_obl.gif"  */


function Titul1(nadpis) {
      var TXT;
      TXT = '<div class="centr">';
      TXT+= '<table border="0" class="zahlavi1" width="100%" height="60" cellspacing="0" cellpadding="0">';
      TXT+= '<tr>';
      TXT+= '<td height="60" background="../../0images/zahl_obl.gif">' + nadpis + '</td>';
      TXT+= '<td height="60" width="205" background="../../0images/zahl_ols.gif" >&nbsp;</td>';
      TXT+= '</tr>';          
      TXT+= '</table></div>';
      document.write(TXT);    
}  


function Zapati1(datum) {
      var TXT;
      TXT = '<div class="centr">';
      TXT+= '<hr class="zapati1" size="1">';
      TXT+= '<table border="0" class="zapati1" cellspacing="0" cellpadding="0">';
      TXT+= '<tr>';
      TXT+= '<td class="zapati1_dat" width="50%"> Poslední aktualizace: ' + datum + '</td>';
      TXT+= '<td class="zapati1_hyp" width="50%">';
      TXT+= '<a target="_self" class="hyp" href="#ZAC">Nahoru</a></td>';
      TXT+= '</tr>';          
      TXT+= '</table></div>';
      document.write(TXT);    
}  



/* --------- Zatim nepouzito ------------------- */


function Titul2(nadpis) {
      var TXT;
      TXT = '<div class="centr">';
      TXT+= '<table border="0" class="titul2" cellspacing="0" cellpadding="0">';
      TXT+= '<tr>';
      TXT+= '<td>' + nadpis + '</td>';
      TXT+= '</tr>';          
      TXT+= '</table></div>';
      document.write(TXT);    
}  

function Zapati2(datum) {
      var TXT;
      TXT = '<div class="centr">';
      TXT+= '<hr class="zapati1" size="1">';
      TXT+= '<table border="0" class="zapati1" cellspacing="0" cellpadding="0">';
      TXT+= '<tr>';
      TXT+= '<td class="zapati1_dat" width="50%"> Poslední aktualizace: ' + datum + '</td>';
      TXT+= '<td class="zapati1_hyp" width="50%">';
      TXT+= '<a target="_self" class="hyp" href=javascript:Zpet()> Zpět </a>';
      TXT+= '&nbsp;|&nbsp;';
      TXT+= '<a target="_self" class="hyp" href="#ZAC"> Nahoru </a></td>';
      TXT+= '</tr>';          
      TXT+= '</table></div>';
      document.write(TXT);    
}  


/* -------------------------------------------  */




/* --------- Zatim nepouzito ------------------- */


Tlacitko_0 = new Array ();
Tlacitko_1 = new Array ();

function Prirad_obr (index, zapnuty, vypnuty) {
	Tlacitko_1[index] 	= new Image ();
	Tlacitko_1[index].src 	= zapnuty;
	Tlacitko_0[index] 	= new Image ();
	Tlacitko_0[index].src	= vypnuty;
}

function Vymen_obr (aktivni, jmenoobr) {
	if (aktivni) 
		document[jmenoobr].src = Tlacitko_1[jmenoobr].src;
	else 
		document[jmenoobr].src = Tlacitko_0[jmenoobr].src;
}

var semafor = "";

function Roluj_menu (menuID) {
var index, semafor_pom;
	semafor_pom = semafor;
	if (semafor != "") {
		index = "Menu_" + semafor;
		semafor = "";
		document.all.item(index).style.display = "none"; }
	if ((menuID != null) && (semafor_pom != menuID)) {
		index = "Menu_" + menuID;
		document.all.item(index).style.display = "";
		semafor = menuID; }
}


/* -------------------------------------------  */

var PoleJmen = new TvorPole (
  "<- JINY WWW ->",
  "TITULNÍ STRANA",
  "Sluníčkový stránky",
  "Přírodovědecká fakulta"
);

var PoleURLs = new TvorPole (
  "",
  "../default.htm",
  "../slunicko/default.htm",
  "../mu/default.htm"

);

function TvorPole() {
  this.length = TvorPole.arguments.length;
  for (var i = 0; i < this.length; i++)
  this[i + 1] = TvorPole.arguments[i];
}

function Jdi(polozka) {
  polindex = polozka.selectedIndex;
  polvalue = polozka.options[polindex].value;
  var RODIC = window.parent;
  if (polindex > 0)
    RODIC.location.href = polvalue;
}

function VytvorMenu() {
  document.writeln('<select class="menu" name="URL" onChange="Jdi(this)">');
  poc = PoleJmen.length;
  for (var i = 1; i <= poc; i++)
    document.writeln('<option value="' + PoleURLs[i] + '">' + PoleJmen[i] + '</option>');
  document.writeln('</select>');
}


/* -------------------------------------------  */
function Okno(obrazek, text) {
  nove_okno=window.open ("", "FOTKA", 
  "toolbar=no, location=no, directories=no, "+
  "status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, "+
  "width=700, height=550, top=5, left=5");

  with (nove_okno) {
    document.write('<HTML>\n<TITLE>Velka fotka</TITLE>\n<BODY>\n');
    document.write('<div align="center">\n');
    document.write('<h3>' + text + '</h3>\n');
    document.write('<IMG SRC="' + obrazek + '" onmouseout="window.close()">\n');
    document.write('</div>\n');
    document.write('</BODY>'); 
  }
}
  
/* -------------------------------------------  */

function Fotkovac(cesta, sloupce, predp, smaz) {
//sloupce - pocet kykreslenych sloupcu
//predp - predpona souboru s nahledem
//smaz - pocet umazanych znaku z kraje souboru pri prepisovani nazvu a popisu (parametr "X" ve fci Pridej)
  this.poc = 0;
  this.cesta = cesta;
  this.sloupce = sloupce;
  this.predp = predp;
  this.smaz=smaz;
  this.soubory = new Array();
  this.nazvy = new Array();
  this.popisy = new Array();
  
// je-li nazev nebo popis "X" tak prepisuje soubor 
// je-li popis "XX" tak prepisuje nazev
  this.Pridej = function (soubor, nazev, popis) { 
    this.poc++
    this.soubory[this.poc] = soubor;
    if (nazev=="X") this.nazvy[this.poc] = soubor.substring(this.smaz, soubor.lastIndexOf("."));
      else this.nazvy[this.poc] = nazev;
    if (popis=="X") this.popisy[this.poc] = soubor.substring(this.smaz, soubor.lastIndexOf("."));
      else if (popis=="XX") this.popisy[this.poc] = nazev;
           else this.popisy[this.poc] = popis;
  }

  this.Kresli = function() {
      var TXT;
      TXT = '<div align="center">'
      TXT+= '<table border="0" class="nahledy" cellspacing="3" cellpadding="3">';
      for (var pos=1; pos<=this.poc; pos+=this.sloupce) {
        for (var i=0; i<this.sloupce; i++) {
          if (i==0) TXT+= '<tr>';
          if ((i+pos)<=this.poc) {
            TXT+= '<td class="nahl"><a class="hyp" href="javascript:Okno(\'';
            TXT+= this.cesta + this.soubory[pos+i] + '\', \'' + this.popisy[pos+i] + '\')">';
            TXT+= '<img border="1" src="' + this.cesta + this.predp + this.soubory[pos+i] + '"';
            TXT+= 'alt="' + this.popisy[pos+i] + '"><br>';
            TXT+= this.nazvy[pos+i];
            TXT+= '</a></td>';
          } else {
            TXT+= '<td>&nbsp;</td>';
          }
          if (i==(this.sloupce-1)) TXT+= '</tr>';
        }
      }
      TXT+= '</table></div>';
      document.write(TXT);    
  }
}



/* -------------------------------------------  */

function Zpet() {
  history.back(1);
}


/* -------------------------------------------  */

var DalkOvl=null;

function DoStart() {
  DalkOvl=window.open("", "DOWIN", "directories=no, location=no, menubar=no, "+
  "resizable=no, scrollbars=no, status=no, toolbar=no, width=70, height=180, left=8, top=8");
  if (DalkOvl!==null) {
    if (DalkOvl.opener==null)
      DalkOvl.opener=self;
    DalkOvl.location.href="dalkovl.htm";
  }
}

/* -------------------------------------------  */
