var whitespace = " \t\n\r";
function isEmpty(s){return ((s == null) || (s.length == 0))}
function isWhitespace (s)
{
	var i;
	if (isEmpty(s)) return true;
	for (i = 0; i < s.length; i++)
	{   
		var c = s.charAt(i);
		if (whitespace.indexOf(c) == -1) return false;
	}
	return true;
}
function allValid(checkStr, add) {
  var checkOK = "AÁÄBCČDĎEÉĚFGHIÍJKLĹĽMNŇOÔÓÖPQRŔŘSŠTŤUÚŮÜVWXYÝZŽaáäbcčdďeéěfghiíjklĺľmnňoôóöpqrsštťuúůüvwxyýzž0123456789"+add;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++) { if (ch == checkOK.charAt(j)) break;}
    if (j == checkOK.length) return false;
  }
return true;
}


function ValidatorRegAlcotest(alcotest)
{

if (isWhitespace(alcotest.vald.value))
  {
    alert("Prosíme, zadajte množstvo nápoja!");
    alcotest.vald.focus();
    alcotest.vald.select();
    return (false);
  }
  
  
if (isWhitespace(alcotest.vale.value))
  {
    alert("Prosíme, zadajte zastúpenie alkoholu!");
    alcotest.vale.focus();
    alcotest.vale.select();
    return (false);
  }
  
  	if (isWhitespace(alcotest.valp.value))
  {
    alert("Prosíme, zadajte hmotnosť konzumenta!");
    alcotest.valp.focus();
    alcotest.valp.select();
    return (false);
  }
	

  return (true);
}

