kryj = 0; id = 0;
function menu(element) {
  i = 1; kryj = 1;
  while (e = document.getElementById("m" + i++))
    e.style.visibility = "hidden";
  document.getElementById(element).style.visibility = "visible";
}

function koniec() {
  clearTimeout(id);
  kryj=0; id = setTimeout(ukryj, 1000)
}

function ukryj() {
  if (kryj==0) {
    i = 1;
    while (e = document.getElementById("m" + i++))
      e.style.visibility = "hidden";
  }
}

function sprawdz_kontakt(t) {

  if (t.tresc.value.length<10) { 
  	alert("Wpisz treść wiadomości!");
	t.tresc.focus(); 
	return false; 
	}		
	
  if (t.imie.value.length<5) { 
  	alert("Wpisz swoje imię i nazwisko!");
	t.imie.focus(); 
	return false; 
	}	

  if (!t.e_mail.value.match(/^[0-9a-z_.-]+@([0-9a-z-]+\.)+[a-z]{2,6}$/)) {
    alert("Podaj poprawny adres e-mail!"); 
    t.e_mail.focus();
    return false;
  	}
	
  if (t.adresat.selectedIndex<1) { 
  	alert("Wybierz adresata z listy!");
	t.adresat.focus(); 
	return false; 
	}
  
  return true;
  
}

function printWindow(url) {
  window.open(url,"okno","width=700,height=500,left=0,top=0,scrollbars=yes");
}

function pop_up(url) {
  window.open(url,"okno","width=500,height=400,left=0,top=0,scrollbars=yes");
}

function foto(url,w,h) {
  Foto =	window.open(url,"okno","width="+w+",height="+h+",left=0,top=0,scrollbars=no");
  Foto.focus();	
}

