function toggleBox(szDivID) {

  if (document.layers) { // NN4+
    if (document.layers[szDivID].visibility == 'visible') {
        document.layers[szDivID].visibility = "hide";
        document.layers[szDivID].display = "none";
        document.layers[szDivID+"SD"].fontWeight = "normal";
    } else {
        document.layers[szDivID].visibility = "show";
        document.layers[szDivID].display = "inline";
    }
  } else if (document.getElementById) { // gecko(NN6) + IE 5+
    var obj = document.getElementById(szDivID);
    if (obj.style.visibility == 'visible') {
        obj.style.visibility = "hidden";
        obj.style.display    = "none";
    } else {
        obj.style.visibility = "visible";
        obj.style.display    = "inline";
    }
  } else if (document.all) { // IE 4
    if (document.all[szDivID].style.visibility == 'visible') {
        document.all[szDivID].style.visibility = "hidden";
        document.all[szDivID].style.display = "none";
    } else {
        document.all[szDivID].style.visibility = "visible";
        document.all[szDivID].style.display = "inline";
    }
  }
}
function doSection(id)
{
     if (document.getElementById(id).style.display == 'none') {
      document.getElementById('polec').style.display = 'none'
       document.getElementById('zapytaj').style.display = 'none'
       document.getElementById('komentarze').style.display = 'none'
       document.getElementById('inne').style.display = 'none'
        document.getElementById(id).style.display = '';

    } else {
        document.getElementById(id).style.display = 'none';
   }
}
function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,left=150')
}
var i=0;
function resize() {
  if (navigator.appName == 'Netscape') i=40;
  if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+60-i);
  self.focus();
}
function newWindow(mypage,myname,w,h,features){
if(screen.width){
var winl=(screen.width-w)/2;
var wint=(screen.height-h)/2;
}else{winl=0;wint=0;}
if (winl < 0) winl=0;
if (wint < 0) wint=0;
var settings='height='+h+',';
settings +='width='+w+',';
settings +='top='+wint+',';
settings +='left='+winl+',';
settings +=features;
win=window.open(mypage,myname,settings);
win.window.focus();
}
function vFormAsk(AForm)
{
if ((!AForm.antispam_z.value) || (AForm.antispam_z.value.length != 5)) {
alert("Proszę podać w poprawnej formie kod bezpieczeństwa. 5 znaków (litery i cyfry).");
return false;
}
if ((!AForm.name_z.value) || (AForm.name_z.value.length < 2)) {
alert("Proszę podać poprawnie imię. " +
"Imię musi zawierać od 2 do 20 liter. " +
"Żadne znaki poza literami nie są dozwolone.");
return false;
}
var reg=/^[^@]+@([a-z0-9\-]+\.)+[a-z]{2,4}$/i;
wyn = AForm.email_z.value.match(reg);
if (wyn == null) {
alert("Proszę podać poprawny adres email. " +
"Poprawny adres musi zawierać znak at (@) " +
"oraz co najmniej dwa człony nazwy serwera, " +
"np. adam@abc.pl lub ala@oddzial.firma.com.");
return false;
}
if ((!AForm.message_body_z.value) || (AForm.message_body.value.length < 5)) {
alert("Wypełnij pole Pytanie, podaj co najmniej 5 znaków!");
return false;
} else {
return true;
}
return true;
}
function vFormTell(AForm)
{
if ((!AForm.antispam_p.value) || (AForm.antispam_p.value.length != 5)) {
alert("Proszę podać w poprawnej formie kod bezpieczeństwa. 5 znaków (litery i cyfry).");
return false;
}
if ((!AForm.name.value) || (AForm.name.value.length < 2)) {
alert("Proszę podać poprawnie podpis. " +
"Podpis musi zawierać od 2 do 20 liter. " +
"Żadne znaki poza literami nie są dozwolone.");
return false;
}
var reg=/^[^@]+@([a-z0-9\-]+\.)+[a-z]{2,4}$/i;
wyn = AForm.email.value.match(reg);
if (wyn == null) {
alert("Proszę podać poprawny adres email. " +
"Poprawny adres musi zawierać znak at (@) " +
"oraz co najmniej dwa człony nazwy serwera, " +
"np. adam@abc.pl lub ala@oddzial.firma.com.");
return false;
}
if ((!AForm.message_body.value) || (AForm.message_body.value.length < 5)) {
alert("Wypełnij pole Treść wiadomości, podaj co najmniej 5 znaków!");
return false;
} else {
return true;
}
return true;
}
