function waliduj(){
var validValue = 1;
var strEmail = document.getElementById("zapytanie_email").value;
var pustePole = 1;
  validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;   

   // search email text for regular exp matches
    if (strEmail.search(validRegExp) == -1 || strEmail == zlyEmail.text) 
   {
      alert(zlyEmail.text+'!');
      document.getElementById("zapytanie_email").style.color = "red";
      validValue = 0;
    } 
    
    if(document.getElementById('zapytanie_imie').value == "" || document.getElementById('zapytanie_imie').value == frm.imie)
    {
    pustePole = 0;
    validValue = 0;
    }
    if(document.getElementById('zapytanie_tytul').value == "" || document.getElementById('zapytanie_tytul').value == frm.tytul)
    {
    pustePole = 0;
    validValue = 0;
    }
    if(document.getElementById('zapytanie_tresc').value == "" || document.getElementById('zapytanie_tresc').value == frm.tresc)
    {
    pustePole = 0;
    validValue = 0;
    }
    
    if(pustePole == 0) 
    {
    alert(frm.uzupelnij+'!');
    }
    
    if (validValue == 1) {
    document.getElementById('formularz-zapytanie').action = location.href;
    document.getElementById('formularz-zapytanie').submit();
    } 
}


function sprawdz(value) {
if(value == "e-mail") {
document.getElementById('zapytanie_email').value="";
}
}

function wiadomoscWyslana(message) {
var formularzTitle = document.getElementById('formularz-zapytania-title').innerHTML;
var formularzColor = document.getElementById('formularz-zapytania-title').style.color;
document.getElementById('formularz-zapytania-title').style.color = "#4cf350";
document.getElementById('formularz-zapytania-title').innerHTML = message;
setTimeout(function() {
document.getElementById('formularz-zapytania-title').style.color = formularzColor;
document.getElementById('formularz-zapytania-title').innerHTML=formularzTitle;
}, 4000);
}

var ktoryWybrany = new Object;
ktoryWybrany.i = null;



function fullbox(id) {
ktoryWybrany.i = id;
var oHtml = document.documentElement;
var wysokosc = oHtml.childNodes[1].offsetHeight;
var szerokosc = oHtml.childNodes[1].offsetWidth;
//alert(wysokosc);
document.getElementById('fullbox').style.width = szerokosc + 'px';
document.getElementById('fullbox').style.height = wysokosc*1.2 + 'px';
}