/************************************************
*
* Funkcje BezpieczeÄąÂ„stwa 
*
*	Autor: Dawid "Spanner" Baruch
*
*	website: http://www.baruch.pl
*
************************************************/

function check_email(email)
{
	var re = new RegExp("^([_a-z0-9-]+(\.[_a-z0-9-]+)*){3,}@([0-9a-z]{2,}(-?[0-9a-z])*\.)+[a-z]{2}([zmuvtg]|fo|me)?$", "gi");
	var wynik = re.test(email);

	if (!wynik)
	{
		window.alert("Podany adres e-mail jest niepoprawny!");
		return false;
	}
	else
	{
		return true;
	}
}

function sprawdz_dane()
{
	if((document.kontakt.nazwisko.value == "") || (document.kontakt.email.value == "") || (document.kontakt.tresc.value == ""))
	{
		window.alert("Wszystkie pola muszĂ„Â… byĂ„Â‡ wypeÄąÂ‚nione");
		return false;
	}
	else
	{
		if((document.kontakt.code.value == ""))
		{
			window.alert("Musisz podaĂ„Â‡ kod znajdujĂ„Â…cy siĂ„Â™ na brazku");
			return false;
		}

		if (check_email(document.kontakt.email.value))
		{
			return true;
		}
		else
		{
			return false;
		}
	}
}

function ilosc_znakow()
{
	document.kontakt.ilosc.value = document.kontakt.tresc.value.length;
}

