function hideDiv(){
              if (document.getElementById) { // DOM3 = IE5, NS6
                  document.getElementById('error').style.display = 'none';
              }
              else {
                  if (document.layers) { // Netscape 4
                      document.error.display = 'none';
                  }
                  else { // IE 4
                      document.all.error.style.display = 'none';
                  }
              }
          }
          
          function showDiv(){
              if (document.getElementById) { // DOM3 = IE5, NS6
                  document.getElementById('error').style.display = 'block';
              }
              else {
                  if (document.layers) { // Netscape 4
                      document.error.display = 'block';
                  }
                  else { // IE 4
                      document.all.error.style.display = 'block';
                  }
              }
          }
          
          function email_validate(src){
              var regex = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;
              return regex.test(src);
          }
          
          
          function checkForm(){
              
			  stan=0;
			  var formularz = document.forms[0];
              text = "";
              
              
              if (formularz.name.value == "") {
                  stan = 1;
                  text += "- Nie wypełniono pola imię, nazwisko  <br>\n";
              }
              
              if (formularz.topic.value == "") {
                  stan = 1;
                  text += "- Nie wypełniono pola temat  <br>\n";
              }
              
		      if(!email_validate(formularz.email.value)) {
			  	stan = 1;
                text += "- Nie poprawny adres e-mail <br>\n";
			  }
			  
			  
              if (formularz.message.value == "") {
                  stan = 1;
                  text += "- Nie wypełniono pola wiadomość <br>\n";
              }
              
              
              
              
              if (stan == 1) {
                  document.getElementById('error').innerHTML = text+"<br><br>\n";
                  showDiv()
              }
              else {
              	hideDiv();
				document.formularz.submit();
              }
          }
             function resetform() {
     document.formularz.reset();
}
      
