function validate_email(field,alerttxt,mejl)
{
with (field)
{
apos=value.indexOf("@")
dotpos=value.lastIndexOf(".")
if (apos<1||dotpos-apos<2)
  {alert(alerttxt);return false}
else {noweOkno = window.open("index.php?mode=newsletter&id=" + mejl + "",'okno','width=600, height=400'); noweOkno.focus(); return false; }
}
}

function validate_form(thisform)
{
mejl = thisform.email.value;
with (thisform)
{

if (validate_email(email,"Wpisz poprawny adres e-mail!", mejl)==false)
  {email.focus();return false}
}
}

