function emailValidator(elem, helperMsg){
	var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
	if(elem.value.match(emailExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}

/*
<form>
Email: <input type='text' id='emailer'/>
<input type='button' 
	onclick="emailValidator1(document.getElementById('emailer'), 'Špatná forma emailu.')"
	value='Zkontroluj email' />
</form>
 */


function notEmpty(elem, helperMsg){
	if(elem.value.length == 0){
		alert(helperMsg);
		elem.focus();
		return false;
	}
	return true;
}


/*
<form>
Text: <input type='text' id='req1'/>
<input type='button' 
	onclick="notEmpty(document.getElementById('req1'), 'Vyplňte vše potřebné')"
	value='Prazné ?' />
</form>
    */
