function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}

function odeslatForm(){
   var chyby = 0;
   id = 'jmeno'; if(trim(document.getElementById(id).value) == ''){chyby += 1;}
   id = 'mail'; if(trim(document.getElementById(id).value) == ''){chyby += 1;}
   id = 'text'; if(trim(document.getElementById(id).value) == ''){chyby += 1;}
   if(chyby == 0){document.forms.kontakt.submit();}else{alert('Vyplňte jméno, e-mailovou adresu a text.');}
}