function test() {
  text = document.getElementsByTagName('<a>').toString();
  alert (text);
}


function validate_login(formular)  {
	if (formular.jmeno.value=="")  {
		alert ("CHYBA: vyplňte prosím položku 'už.jméno'");
		formular.jmeno.focus();
		return false;
      	}
	
	if (formular.heslo.value=="")  {
		alert ("CHYBA: vyplňte prosím položku 'heslo'");
		formular.heslo.focus();
		return false;
      	}
}

function logout(sesid, timeout, lang)  {
  countdown(((timeout*60)*1000), sesid, lang);
}

function countdown(timeout, sesid, lang)  {
	timeout = timeout - 1000;
	strTimeout = timeout / 1000;
	strTimeoutMin = strTimeout / 60;
	strTimeoutMin = Math.floor(strTimeoutMin);
	strTimeoutSec = strTimeout - (strTimeoutMin*60);
	strTimeoutSec = Math.floor(strTimeoutSec);
	if (strTimeoutSec<'10') {
		strTimeoutSec = "0"+strTimeoutSec;
	}
	if (strTimeoutMin<'0') {
 		document.location=("index.php?act_login=odhlaseni&sesid="+sesid+"&lang="+lang+"&odhlaseni=false")
	} else {
		document.getElementById('logout').innerHTML = 'Vaše připojení vyprší za <b>'+strTimeoutMin+':'+strTimeoutSec+'</b>.';
		timerID = setTimeout("countdown('"+timeout+"', '"+sesid+"', '"+lang+"')",1000);
	}
}

function redirectSelect(t) {
  if (t.options[t.selectedIndex].value!='-') {
    location = t.options[t.selectedIndex].value;
  }
}

var marked_row = new Array;
var highlight_row = new Array;


function setPointer(theRow, theRowNum, theAction, styl, theCheckBox, theOdkaz) {
    if ( (typeof(theRow.style) == 'undefined')
    || (typeof(document.getElementsByTagName) == 'undefined') ) {
            return false;
    }

    var theCells = null;
    theCells = theRow.getElementsByTagName('td');
    var rowCellsCnt = theCells.length;
    var newStyle = null;
    var newChecked = null;

    if( theAction == 'over' ) {
        if ( (typeof(highlight_row[theRowNum]) == 'undefined') || (!highlight_row[theRowNum]) ) {
            newStyle = "vysvicene";
        }
        highlight_row[theRowNum] = true;
    }

    if( theAction == 'out' ) {
        if ( highlight_row[theRowNum] ) {
            if ( marked_row[theRowNum] ) {
                newStyle = "vybrane";
            } else {
                newStyle = styl;
            }
        }
        highlight_row[theRowNum] = null;
    }

    if( theAction == 'click' ) {
        location = theOdkaz;
        //if ( marked_row[theRowNum] ) {
//            marked_row[theRowNum] = null;
//            newStyle = "vysvicene";
//        } else {
//            marked_row[theRowNum] = true;
//            newStyle = "vybrane";
//        }
    }

    if( theAction == 'odebrat' ) {
      marked_row[theRowNum] = null;
      newStyle = styl;
    }

    if( theAction == 'vybrat') {
      marked_row[theRowNum] = true;
      newStyle = "vybrane";
    }

    if (newStyle) {
        theRow.className = newStyle;
    }

    SubmitIt();
}

function SubmitIt(){
  var t = "";
  for(i=0;i<marked_row.length;i++) {
      if(marked_row[i]) t+= i + ";";
  }
}


    function prepni_obr(number){
				document.getElementById("oWebu").style.background="url(img/index_"+number+".jpg)";
      }     
	
        var pocet_log=1				
				function opakovana(count){
				  count=count+1;
					if (count==pocet_log+1) {
						count=1;
					}
					casovac=window.setTimeout("opakovana("+count+")", 5000); // volá sebe samu odloženou o sekundu
					prepni_obr(count);
				}
	
	
	
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-59587-53']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

