function not_empty(ret)
{
ret1=ret.value;
if (ret1 == "")
    {
    return (false);  
    }
	return (true);
}

function get_key(e)
{
var code;
if (!e)
  {
  var e = window.event;
  }
if (e.keyCode)
    {
    code = e.keyCode;
	}
else
   {
   if (e.which)
      {
	  code = e.which;
	  }
    }
return code;	  
}

function is_numeric(eX)
{
test = get_key(eX);
if (test < 48 || test > 57)
   {
   return false;
   }
}


function is_num_coma(eX)
{
test = get_key(eX);
if ((test < 45 || test > 57))// && (test != 45) )
   {
   return false;
   }
}



function is_alfa_numeric(eX, diacritic)
{
test = get_key(eX);
set1 =  (test > 32 && test < 48);
set2 =  (test > 57 && test < 65);
set3 =  (test > 90 && test < 97);
if (diacritic == 1)
   {
   set4 =  (test > 122 && test < 127);
   }
else
   {
   set4 =  (test > 122 );  
   }
if (set1 || set2 || set3 || set4)
   { 
   return false;
   }
}     


function safe_chars(eX)
{
test = get_key(eX);
if (test == 34 || test == 39)
   {
   return false;
   }
}
function is_mail(ret){
mm=ret.value;
st1=mm.indexOf("@")<0;
st2=mm.lastIndexOf(".")<mm.indexOf("@");
st3=mm.indexOf(".")<0;
if (st1 || st2 || st3){return false;}else{return true;}


}

function is_date(ret)
{
kalendar = new Array(31,29,31,30,31,30,31,31,30,31,30,31);
mm = ret.substring(ret.indexOf("-")+1,ret.indexOf("-",6 ));
// alert("mm:" + mm);

dd = ret.substring(ret.indexOf("-",6)+1,(ret.length));
// alert("dd:" + dd);
st1 = ((ret.indexOf("-") == 0)|| (ret.indexOf("-")< 4 && ret.indexOf("-",6 )>7));
st2 = (mm > 12 || mm < 1);
st3 = (dd > 31 || mm < 1);
st4 = (mm < 1 || dd > kalendar[(mm-1)]);
// alert("Zadal jste:" + ret+st1+st2+st3+st4);
if (st1 || st2 || st3 || st4  )
   {
   return false;
   }
return true   
}


var fBlink;

function StartBlink(theForm, theField) {
    theField.focus();
    fBlink = true;
    Blink("document.forms['"+theForm.name+"']." + theField.name,"coral");
}  
function Blink(fieldName, theColor) {
    var theField=eval(fieldName);
    // toto je poznamka
    if (fBlink) {
        ChangeColor(theField,theColor);     
        if(theColor=="coral") {
            setTimeout("Blink(\"" + fieldName + "\",\"\")",800);
        } else {
            setTimeout("Blink(\"" + fieldName + "\",\"coral\")",800);
        }    
    } else {
        ChangeColor(theField,"");     
    }
}  
function ChangeColor( theField, theColor ) {
    theField.style.background = theColor
}  
function StopBlink() {
    fBlink = false;
}

