function walidacja(Formularz)
{
	var regex = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;
  	adres = document.getElementById('mail').value;
	
	if ((regex.test(adres)) && (Formularz.mail.value) && (Formularz.osobakontaktowa.value) && (Formularz.wiadomosc.value)) 
		{
    	return true;
		}
	else
		{
		if (!Formularz.osobakontaktowa.value) 
			{
			document.getElementById('osoba_wal').style.display = 'block';
			document.getElementById('osobakontaktowa').style.marginBottom = '4px';
			document.getElementById('osobakontaktowa').style.border = '1px solid red';
			}
		else
			{
			document.getElementById('osoba_wal').style.display = 'none';
			document.getElementById('osobakontaktowa').style.marginBottom = '15px';
			document.getElementById('osobakontaktowa').style.border = '';
			}
		
		if (!Formularz.wiadomosc.value) 
			{
			document.getElementById('wiadomosc_wal').style.display = 'block';
			document.getElementById('telefon').style.marginBottom = '4px';
			document.getElementById('wiadomosc').style.border = '1px solid red';
			}
		else
			{
			document.getElementById('wiadomosc_wal').style.display = 'none'
			document.getElementById('telefon').style.marginBottom = '15px';
			document.getElementById('wiadomosc').style.border = '';
			}
			
		if (!regex.test(adres)) 
			{
			document.getElementById('mail_wal').style.display = 'block'
			document.getElementById('mail').style.marginBottom = '4px';
			document.getElementById('mail').style.border = '1px solid red';
			}
		else
			{
			document.getElementById('mail_wal').style.display = 'none'
			document.getElementById('mail').style.marginBottom = '15px';
			document.getElementById('mail').style.border = '';
			}
		
		return false;
		}
}
		
		
	
