            function isEmail(who) {
var email=/^[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*@[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*\.([A-Za-z]){2,4}$/i;
return(email.test(who));
}

function onlyLetters(thisElement)
{
thisElement.value = thisElement.value.replace(/[^ąćęłńóśźżĄĆĘŁŃÓŚŹŻa-zA-Z-\s]/,"");
thisElement.value = thisElement.value.replace(/[^ąćęłńóśźżĄĆĘŁŃÓŚŹŻa-zA-Z-\s]/,"");
thisElement.value = thisElement.value.replace(/[^ąćęłńóśźżĄĆĘŁŃÓŚŹŻa-zA-Z-\s]/,"");
//ąćęłńóśźżĄĆĘŁŃÓŚŻŹ
return false;
}

            
function isPostcode(e)
{
e.value = e.value.replace(/[^0-9]/,"");
e.value = e.value.replace(/[^0-9]/,"");
return false;
}

function isPostcode2(e)
{
e.value = e.value.replace(/[^0-9-]/,"");
e.value = e.value.replace(/[^0-9-]/,"");
return false;
}
            
function validateForm(AForm)
{
    
    wyn = AForm.osoba.value;
    if (wyn == "") {
        alert("Proszę podać poprawne imię i nazwisko!");
        return false;
    }
    
    
    wym = AForm.mail.value
    if (!isEmail(wym)) {
        alert("Proszę podać poprawny Adres Mail!");
        return false;
    }
    
    wym = AForm.tresc.value
      if (wym == "") {
        alert("Proszę podać treść powiadomienia!");
        return false;
    }
    return true;
}

