
function validate_formmail(f)
 {				
	required = 0;
	wymagane = $(".required_field");
	$.each(wymagane, function () {
		title = $(this).attr('title');
		wartosc = $(this).val();
		if(wartosc.length < 3)
		 {
			alert('Wypelnij pole obowiązkowe: '+title);
			required++;
		 }				
	 });	 
	
	if(required > 0)
	 {
		return false;
	 }
 }

function MailIsValid(Email) 
{ 
	var Pattern = /^[a-z0-9-_]+(\.[a-z0-9-_]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/; 
	return (Pattern.test(Email)) ? true : false; 
} 

function testuj_email(f) {			
  if (!MailIsValid(f.newsletter_add.value)) { alert("Niepoprawny adres e-mail"); return false; }			 
}

function usun (link)
{
	komunikat = "Czy napewno chcesz to zrobić?"
	if (confirm(komunikat))	document.location.href = link;
}

function ask (link, komunikat)
{
	
	if (confirm(komunikat))	document.location.href = link;
}