function sprawdzFormularz_x()
{
  var email = document.getElementById('input_email').value;
  var tresc = document.getElementById('input_wiadomosc').value;  
  var regex = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;
  
  if(regex.test(email)==false || tresc=='')
    {
      alert('Proszę poprawnie wypełnić formularz!');
      return false;
    }
  else return true;
}

function email_test(src)
{
  var reg = /^[a-zA-Z0-9.\-_]+@[a-zA-Z0-9\-.]+\.[a-zA-Z]{2,4}$/;
  return reg.test(src);
}

function sprawdzFormularz() {
  var brak_danych=false;
  var kolor_ok='#ffffff';
  var kolor_err='#ff0036';
  var email = document.getElementById('input_email');
  var tresc = document.getElementById('input_wiadomosc');
    
  if(!email_test(email.value)) 
  {
    email.style.border='1px solid '+kolor_err;
    brak_danych=true;
  }
  else 
  {
    email.style.border='1px solid '+kolor_ok;
  }

  if(tresc.value=='') 
  {
    tresc.style.border='1px solid '+kolor_err;
    brak_danych=true;
  }
  else 
  {
    tresc.style.border='1px solid '+kolor_ok;
  }  
  
  
  if(brak_danych==false) document.forms['frm_zapytanie'].submit();
  else alert('Proszę poprawić zaznaczone pola!');  
} 

