$(document).ready(function(){
      $("a.rep1").click(function(){ $("div.areareply").show(); $("a.rep1").hide(); return false; });
      $("input.zr").click(function(){ $("div.areareply").hide(); $("a.rep1").show(); return false; });
      $("a.pnm").click(function(){ $("div.fhnm").toggle(); return false; });
      $("a.t").click(function(){ $("div.tagy").toggle(); return false; });
      $("a.nevh").click(function(){ $("div.nevhodne").toggle(); return false; });
      $("a.nap").mouseover(function(){ $("div.napoveda").show(); return false; });
      $("a.nap").mouseout(function(){ $("div.napoveda").hide(); return false; });
      $("a.nap").click(function(){ $("div.napoveda").toggle(); return false; });
      $("a.ig").click(function(){ $("#skup").toggle(); return false; });
      $("a#up").click(function(){ $(".dn").toggle(); return false; });
      $('#registruj').attr('disabled', true);
    	$('#souhlas').click(function() { $('#registruj').attr('disabled', $(this).attr('checked') != true); });
       	
      $("a#lg").click(function(){ $("div#slg").toggle(); return false; });
      $("a.dnl").click(function(){ $("div#dn").toggle(); return false; });
     $("input#heslo").keyup(function(){ 
        var n = $("input#heslo").val().length;
        if(n == 0){
          $("#sila-hesla").text("nezadáno");
          $("#zshp").html("<div id=\"zshs\"></div>");           
        }
        else if(n >= 1 && n <= 6){
          $("#sila-hesla").html("<span class=\"no\">slabé</span>");
          $("#zshp").html("<div class=\"nog\"></div>");
        }
        else if(n > 6 && n < 13){
          $("#sila-hesla").html("<span class=\"or\">střední</span>");
          $("#zshp").html("<div class=\"org\"></div>");
        }
        else {
          $("#sila-hesla").html("<span class=\"yes\">silné</span>");
          $("#zshp").html("<div class=\"yesg\"></div>");
        }
      });
     $("a#ucet").mouseover(function(){ $("div.rchpr").show(); return false; });
	$("a#ucet").mouseout(function(){ $("div.rchpr").hide(); return false; });
	$("div.rchpr").mouseover(function(){ $("div.rchpr").show(); return false; });
	$("div.rchpr").mouseout(function(){ $("div.rchpr").hide(); return false; });

});



  function SkryjForm(kid){
    document.getElementById("reply"+kid).innerHTML = '';
    if(kid != 0){
    	document.getElementById("rep"+kid).style.display='inline';
    }
  }

  function AlLog(co){
    if(co == "reply"){
      alert("Nejsi příhlášen, nemůžeš komentovat.");
    }
    else if(co == "spam"){
      alert("Nejsi přihlášen, nemůžeš komentář označit za spam.");
    }
    else if(co == "zprava"){
		alert("Musíš vložit komentář!");
	}
    else {
      alert("Nejsi příhlášen, nemůžeš hlasovat.");
    }
  }
  
 function show(id1, id2) {
    var prvek1 = document.getElementById(id1);
    var prvek2 = document.getElementById(id2);

    prvek1.style.display = 'none';
    prvek2.style.display = 'inline';
  }

  function zobrazSkryj(idecko){
    el = document.getElementById(idecko).style;
    el.display=(el.display == 'block')?'none':'block';
}
function select_all(e) {
  for(var i = 0; i < document.getElementById(e).elements.length; i++) {
    if(document.getElementById(e).elements[i].type == "checkbox")
      document.getElementById(e).elements[i].checked = true;
  }
}

function unselect_all(e) {
  for(var i = 0; i < document.getElementById(e).elements.length; i++) {
    if(document.getElementById(e).elements[i].type == "checkbox")
      document.getElementById(e).elements[i].checked = false;
  }
}

function loadrecord(record) {
    document.formular.komu.value = record;
    document.getElementById("jenick").style.display="none"; 
}


function one2two() {
    m1len = m1.length ;
    for ( i=0; i<m1len ; i++){
        if (m1.options[i].selected == true ) {
            m2len = m2.length;
            m2.options[m2len]= new Option(m1.options[i].text);
        }
    }

    for ( i = (m1len -1); i>=0; i--){
        if (m1.options[i].selected == true ) {
            m1.options[i] = null;
        }
    }
}

function two2one() {
    m2len = m2.length ;
        for ( i=0; i<m2len ; i++){
            if (m2.options[i].selected == true ) {
                m1len = m1.length;
                m1.options[m1len]= new Option(m2.options[i].text);
            }
        }
        for ( i=(m2len-1); i>=0; i--) {
            if (m2.options[i].selected == true ) {
                m2.options[i] = null;
            }
        }
        
        for (i=0; i<m2.length; i++) {
          m2.options[i].selected = true;
        }
}

function vloz(text) {
    if(document.formular.zprava.createTextRange && document.formular.zprava.caretPos) {
        var caretPos = document.formular.zprava.caretPos;
        caretPos.text = caretPos.zprava.charAt(caretPos.text.length - 1) == ' ' ? text + ' ': text;
    }  else document.formular.zprava.value += text;
    document.formular.zprava.focus(caretPos)
}

