<!--
function setHeight(mydiv) {
  var mydivEl = document.getElementById(mydiv);
  var heightMydiv = mydivEl.style.height;
  if (heightMydiv == "" || heightMydiv != "auto") {
  mydivEl.style.height='auto';
  return;
  } else {
    mydivEl.style.height='42px';
  return;
  }
}
function trim( item ) {
	while( '' + item.value.charAt( item.value.length - 1 ) == ' ' ){
		item.value = item.value.substring( 0, item.value.length - 1 );
    }
}

function checkRequired( item, name ) {
	trim( item );
	if( item.value.length == 0) {
		item.focus();
		alert( "Položka " + name + " je povinná!" );
		return 0;
	}
	return 1;
}
function contentEmail(m){
  re = /^[^.]+(\.[^.]+)*@([^.]+[.])+[a-zA-Z0-9]{2,4}$/;
  return m.search(re) == 0;
}
function checkEmail(item, name){
		if (contentEmail(item.value)==0){
			alert("Bylo nepravdivě vyplněno pole "+ name+". ");
			item.focus();
			return 0;
		}
	return 1;
}
/* check form send mail*/
function checkForm(field){
    if (checkRequired (field.name, "JMÉNO A PŘÍJMENÍ" ) == 0){
		return false;
	}
    if (checkEmail (field.email, "EMAIL" ) == 0){
        return false;
    }

    if (checkRequired (field.text, "TEXT" ) == 0){
		return false;
	}
}
function setDisplay(elementId,display) {
	if( display ) {document.getElementById( elementId ).style.display='block';}
	else {document.getElementById( elementId ).style.display='none';}
}
//-->
