function ZkontrolujRegForm()
{
	var FormElement = document.getElementById("RegistracniForm");
	var je_ok = true;
	
	
		
	je_ok = FormElement.login.value != "";
		if (je_ok == false) {
		alert(FormElement.LoginErrorMessage.value);
		return je_ok;
	}
	
	je_ok = FormElement.password.value != "";
		if (je_ok == false) {
		alert(FormElement.PasswordErrorMessage.value);
		return je_ok;
	}
	
	je_ok = FormElement.password2.value != "";
		if (je_ok == false) {
		alert(FormElement.PasswordErrorMessage.value);
		return je_ok;
	}
	
	if (FormElement.password.value != FormElement.password2.value) {
		je_ok = false;
		alert(FormElement.PasswordErrorMessageRuznaHesla.value);
		return je_ok;
	}
	
	
	
    je_ok = FormElement.Jmeno.value != "";
    if (je_ok == false) {
    	alert(FormElement.JmenoErrorMessage.value);
    	return je_ok;
    }
    
    je_ok = FormElement.Prijmeni.value != "";
    if (je_ok == false) {
    	alert(FormElement.PrijmeniErrorMessage.value);
    	return je_ok;
    }
    
    je_ok = FormElement.Adresa.value != "";
    if (je_ok == false) {
    	alert(FormElement.AdresaErrorMessage.value);
    	return je_ok;
    } 
    
    je_ok = FormElement.Mesto.value != "";
    if (je_ok == false) {
    	alert(FormElement.MestoErrorMessage.value);
    	return je_ok;
    }
    
    je_ok = FormElement.Psc.value != "";
    if (je_ok == false) {
    	alert(FormElement.PscErrorMessage.value);
    	return je_ok;
    }
    
    je_ok = FormElement.Telefon.value != "";
    if (je_ok == false) {
    	alert(FormElement.TelefonErrorMessage.value);
    	return je_ok;
    }
    
    je_ok = FormElement.Email.value != "";
    if (je_ok == false) {
    	alert(FormElement.EmailErrorMessage.value);
    	return je_ok;
    }
    else if (!CheckMail(FormElement.Email.value)) {
    	alert(FormElement.EmailErrorMessage.value);
    	return false;
    }
    
    
    je_ok = FormElement.DatumNarozeni.value != "";
    if (je_ok == false) {
    	alert(FormElement.DatumErrorMessage.value);
    	return je_ok;
    }

    return je_ok; 
}


// -- funkce pro kontrolu validity emailove adresy

function CheckMail(email)
{
	
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(email)) {
		return true;
	}
	else {
		return false;
	}
}