function galeria (plik,szer,wys) 
{
 		 file="images/big/"+plik+"_b.jpg";
    	 okno = window.open ('', "Zdjęcie","toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width="+szer+",height="+wys+",scrollbars=no");
    	 with (okno.document)
		 {
		  	  open();
    	 	  write('<html><head><title>Starosądecka Międzyszkolna Orkiestra Dęta</title></head>');
    	 	  write('<body leftmargin=0 rightmargin=0 bottommargin=0 topmargin=0 bgcolor="black">');
		 	  write('<center><img src="'+file+'" title="Kliknij, aby zamknąć okno" alt="Kliknij, aby zamknąć okno" onClick="javascript:window.close()" style"cursor: hand"></CENTER>');
		 	  write('</body></html>');
    	 	  close();
		 }
    	 okno.focus();
}


function czas(start)
{
 		 jetzt = new Date();
		 rok=jetzt.getFullYear();
		 if (rok<2000) rok+=1900;
		 wiek=rok-start;
		 document.write(wiek);
		 document.write(' ');
		 if (wiek==1){
		 	document.write('rok');
		 }
		 else if (wiek%10<5&&wiek%10>1&&wiek-wiek%10!=10){
		 	  document.write('lata');
		 }
		 else {
		 	  document.write('lat');
		 }
}

function chimg (cel, nazwa)
{
 		 img=new Image();
		 img.src="images/big/"+nazwa+"_b.jpg";
  		 document.images[cel].src=img.src;
}

function refresz()
{
  		 parent.parent.user.online.location.reload();
		 setTimeout("refresz()",5*60*1000);
}

function logowanie (flag,tin,tout)
{
		 if (flag) {
		 	parent.main.location.href="welcome.php?in="+tin+"&out="+tout;
		 	refresz();
		}
}

function check_mail()
{
 		 var email=/^([0-9,a-z,A-Z]+)([.,_]([0-9,a-z,A-Z]+))*[@]([0-9,a-z,A-Z]+)([.,_\,-]([0-9,a-z,A-Z]+))*[.]([0-9,a-z,A-Z]){2}([0-9,a-z,A-Z])?$/
		 if (f.podpis.value.length>0 && f.mail.value.length>0 && f.tekst.value.length>0) {
			if (email.test(f.mail.value)) {
			   return true;
			} else {
			  alert("Niepoprawny adres e-mail!");
			  return false;
			}
		} else {
		  alert("Musisz wypełnić wszystkie pola!");	
		  return false;
		 }
}
