function wstawT9(wartosc,idWstaw,idCzysz){
	document.getElementById(idWstaw).value = wartosc;
	document.getElementById(idCzysz).style.visibility = 'hidden';
	document.getElementById(idCzysz).style.display = 'none';
}

function ukryjT9(idCzysz){
	document.getElementById(idCzysz).style.visibility = 'hidden';
	document.getElementById(idCzysz).style.display = 'none';
}

function odkryjT9(idCzysz){
	document.getElementById(idCzysz).style.visibility = 'visible';
	document.getElementById(idCzysz).style.display = 'block';
}

function dobre_znaki(Pole, rodzaj) {
							
	if (rodzaj == 'a'){
		var drobneZnaki = " aabccdeefghijkllmnnoóprsstuwyzzzxAABCCDEEFGHIJKLLMNNOÓPRSSTUWYZZZX";
	}
	if (rodzaj == 'c'){
		var drobneZnaki = "1234567890";
	}
	if (rodzaj == 'ac'){
		var drobneZnaki = " aabccdeefghijkllmnnoóprsstuwyzzzxAABCCDEEFGHIJKLLMNNOÓPRSSTUWYZZZX1234567890";
	}
								
	var string = Pole.value
	
	if (Pole.value!="") {
		for (i=0; i<Pole.value.length; i++){	
			
			akcja = 0;
			for (r=0; r<drobneZnaki.length; r++){	
				
				if (drobneZnaki.charAt(r) == Pole.value.charAt(i))
					akcja = 1;
			}									
		
			if (akcja != 1)
				Pole.value = string.substr(0,i);
		}	
	}
	
	if (Pole.value > 5){
		Pole.value = 5;	
	}
	
}

function PoprawnyAdr(EmailAdr) {
	ZleZnaki=" /:;,"
	if (EmailAdr=="") {
		return false
	}
	MalpaPoz=EmailAdr.indexOf("@", 0)
	if (MalpaPoz== -1 || MalpaPoz== 0) {
		return false
	}				
	if (EmailAdr.indexOf("@", MalpaPoz+1)!= -1) {
		return false }		
	return true
}

function PoprawnaLiczba(PoleCyfrowe,IloscCyfr) {
	if (PoleCyfrowe=="") {
		return false }
		for (i=0; i<PoleCyfrowe.length; i++){	
			if (PoleCyfrowe.charAt(i) < "0") { 
				return false }
			if (PoleCyfrowe.charAt(i) > "9") {
				return false }					
		}	
		return true
}

function PoprawnaLiczba_n(PoleCyfrowe,IloscCyfr) {
	if (PoleCyfrowe!="") {
			for (i=0; i<PoleCyfrowe.length; i++){	
				if (PoleCyfrowe.charAt(i) < "0") { 
					return false }
				if (PoleCyfrowe.charAt(i) > "9") {
					return false }		
				if (PoleCyfrowe.length!=IloscCyfr) {
					return false }						
				
		  }	
	}
		return true
}

function PoprawnyAdr(EmailAdr) {
	ZleZnaki=" /:;,"
	if (EmailAdr=="") {
		return false 
	}
	MalpaPoz=EmailAdr.indexOf("@", 0)
	if (MalpaPoz== -1 || MalpaPoz== 0) {
		return false
	}				
	if (EmailAdr.indexOf("@", MalpaPoz+1)!= -1) {
		return false }		
	return true
}

function PoprawnaTekst(PoleTekstowe) {
	if (PoleTekstowe=="") {
		return false }
		return true
}
		
function zaznacz(id){
	  var element=document.getElementById(id)
	  var tablica=element.getElementsByTagName('input')
	  for(var i=0;i<tablica.length;i++)
	   tablica[i].checked=true
}


var popUpWin=0;
function pop_wnd(url,w_name,w_width,w_height,w_scroll) {

   if(popUpWin){
    if(!popUpWin.closed) popUpWin.close();
   }

     scr_width = screen.availWidth;
     scr_height = screen.availHeight;
     left_align = eval(scr_width/2)-eval(w_width/2);
     top_align = eval(scr_height/2)-eval(w_height/2);
popUpWin=window.open(""+url+"",""+w_name+"","width="+w_width+",height="+w_height+",left="+left_align+",top="+top_align+",status=yes,scrollbars="+w_scroll+",resizable=1");
}
