function check_length(my_form){
      maxLen = 1500;
      my_form.odkaz_num.value = maxLen - my_form.odkaz.value.length;
}
            
function vymaz(id)
{
  document.myform.idkomentara.value=id;
  var agree = confirm("Naozaj chcete komentár vymazať?");

  if (agree) document.myform.submit();
}         

function confirmDelete(id)
      {
      var agree=confirm("Naozaj chcete správu vymazať?");
      if (agree)
      	nacitanie_dat(0, 'spravy_ajax.php?vymazat='+id);
      else
      	return false ;
}

function confirmWarn(id)
      {
      var agree=confirm("Naozaj chcete obrázok nahlásiť?");
      if (agree)
      	nacitanie_dat(0, 'ajax_galeria.php?nahlasit='+id);
      else
      	return false ;
}          

function confirmDeleteImg(id)
      {
      var agree=confirm("Naozaj chcete obrázok vymazať?");
      if (agree)
      	nacitanie_dat(0, 'ajax_galeria.php?vymazat='+id);
      else
      	return false ;
}    
            
function checkUncheckAll(theElement) {
     var theForm = theElement.form, z = 0;
	  for(z=0; z<theForm.length;z++){
           if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall'){
      	      theForm[z].checked = theElement.checked;
      	  }
     }
}

