document.oncontextmenu = nocontextmenu;
szybkosc=15;
oBy=0;

function dokumentNaglowekUstaw()
	{
		oBy=(szybkosc*oBy+dokumentLeft)/(szybkosc+1)
		document.all('dn').style.left=Math.round(oBy)
		if(Math.round(oBy)!=dokumentLeft)
			setTimeout("dokumentNaglowekUstaw()",20)	
	}

function dokumentNaglowek()
	{
		dokumentLeft=document.body.scrollLeft;
		dokumentNaglowekUstaw();
	}

function dokumentStart()
	{
		dokumentZegar();
	//	setInterval('dokumentNaglowek()',100)
	}


function dokumentMonitoring()
	{
	    xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
       	xmlDoc.async="false";
		xmlDoc.load('monitoring.php');
		setTimeout('dokumentMonitoring()',60000);
	}

function dokumentZegar()
	{
		czasBiezacySekundy++;
		if (czasBiezacySekundy==60)
			{
				czasBiezacyMinuty++;
				czasBiezacySekundy=0;
			}
		if (czasBiezacyMinuty==60)
			{
				czasBiezacyGodziny++;
				czasBiezacyMinuty=0;
			}
		if (czasBiezacyGodziny==24)		
			{
				czasBiezacyGodziny=0;
			}
		czasBiezacyGodzinyW=czasBiezacyGodziny;			
		czasBiezacyMinutyW=czasBiezacyMinuty;
		if (czasBiezacyMinuty<10)
			{
				czasBiezacyMinutyW='0'+czasBiezacyMinuty;
			}
		if (czasBiezacyGodziny<10)
			{
				czasBiezacyGodzinyW='0'+czasBiezacyGodziny;
			}			
		czas=czasBiezacyDzien+' '+miesiacNazwa[czasBiezacyMiesiac-1]+' '+czasBiezacyRok+'r.&nbsp;&nbsp;<br>'+czasBiezacyGodzinyW+':'+czasBiezacyMinutyW+'&nbsp;&nbsp;&nbsp;';
		document.all['zegar'].innerHTML=czas;		
		setTimeout('dokumentZegar()',1000);		
	}

function menuOdslon(szerokosc)
	{
		dokumentOnClick=6;
		document.all['menuWskaznik'].cells[0].style.backgroundColor='#FAFAFA';		
		document.all['menuWskaznik'].style.backgroundColor='#2254b1';
		on_menu = document.getElementById('menuWskaznik');
		document.all["menu"].style.left = get_real_left(on_menu);
		document.all["menu"].style.top = get_real_top(on_menu)+15;
		document.all["menu"].style.visibility = "visible";
		document.all["menu"].innerHTML=dokumentMenuUkryte;
	}


function nawigacjaZrzut()
	{
		this.strona=document.all['strona'].innerHTML;
		this.modul=dokumentModul;
		this.naglowek=document.all['naglowek'].innerHTML;	
		this.logo=document.all['logo'].innerHTML;	
		this.panel=document.all['panel'].innerHTML;
	}

function dokumentPowrot()
	{
		document.all['strona'].innerHTML=nawigacjaWstecz[parseInt(nawigacjaWstecz.length-1)].strona;
		document.all['naglowek'].innerHTML=nawigacjaWstecz[parseInt(nawigacjaWstecz.length-1)].naglowek;
		document.all['logo'].innerHTML=nawigacjaWstecz[parseInt(nawigacjaWstecz.length-1)].logo;		
		document.all['panel'].innerHTML=nawigacjaWstecz[parseInt(nawigacjaWstecz.length-1)].panel;				
		modul=nawigacjaWstecz[parseInt(nawigacjaWstecz.length-1)].modul;
		if ((document.getElementById(dokumentModul)) && (dokumentModul!=modul) && (dokumentModul!=''))
			{
				document.all[dokumentModul].cells[1].style.color='#FFFFFF';
				document.all[dokumentModul].style.backgroundColor='';

				document.all[dokumentModul].style.borderStyle='none';
				document.all[dokumentModul].style.borderWidth='0';
				document.all[dokumentModul].style.paddingLeft='1';
			}
		if ((document.getElementById(modul)))
			{
		document.all[modul].cells[1].style.color='#131FA5';
		document.all[modul].style.backgroundColor='#E6EBF4';

		document.all[modul].style.borderStyle='solid';
		document.all[modul].style.borderWidth='1';
	//	document.all['terminarz'].style.borderColor='transparent';
		document.all[modul].style.paddingLeft='0';

		document.all[modul].style.borderLeftColor='#00238B'
		document.all[modul].style.borderTopColor='#00238B';
		document.all[modul].style.borderRightColor='#578CEB';
		document.all[modul].style.borderBottomColor='#578CEB';
			}
		
		nawigacjaWstecz.pop()
		dokumentModul=modul;
	//	delete nawigacjaWstecz[parseInt(nawigacjaWstecz.length-1)];
	}



function kalendarzUstaw(pole,rok,miesiac,dzien)
	{
		miesiac++;

		biezacyDzien=czasBiezacyDzien;
		biezacyMiesiac=czasBiezacyMiesiac;
		biezacyRok=czasBiezacyRok
		if (biezacyMiesiac<10)
			{
				biezacyMiesiac='0'+biezacyMiesiac;
			}
		if (biezacyDzien<10)
			{
				biezacyDzien='0'+biezacyDzien;
			}
		biezacaData=biezacyRok+'-'+biezacyMiesiac+'-'+biezacyDzien;
		if (miesiac<10)
			{
				miesiac='0'+miesiac;
			}
		if (dzien<10)
			{
				dzien='0'+dzien;
			}
		ustawianaData=rok+'-'+miesiac+'-'+dzien;
	/*	if (ustawianaData<biezacaData)
			{
				ustawianaData=biezacaData;
				alert('Niedozwolona data!!!');						
			}
			*/
		if (dokumentModul=='umowy')
			{
				if (''+rok+miesiac<dokumentMR)
					{
							ustawianaData=biezacaData;
							alert('Błędny MR!');
							return;
					}
				wskaznik=pole.split('_');
			if (pole!='data_r_umowa')
				{
					if ((document.all['usluga_data_r_'+wskaznik[3]].outerText>ustawianaData) && (wskaznik[2]=='z'))
						{
								alert('Błędna data!');
								return;					
						}
					if ((document.all['usluga_data_z_'+wskaznik[3]].outerText<ustawianaData) && (wskaznik[2]=='r'))
						{
							document.all['usluga_data_z_'+wskaznik[3]].innerHTML='';	
						}
				}
			//	alert(pole);	
			}
	//	else
	//		{
				document.all[pole].innerHTML=ustawianaData;
	//		}
	}

function kalendarzPokaz(pole,kolorTlo,rok,miesiac,dzien)
	{
		dokumentOnClick=4;
		stawka='data_r_usluga';
		//kolorTlo='#FF0000';
		dokumentSlownik=pole;
	
		eval('on_menu = document.getElementById("'+pole+'_b")');
		document.all["focus\_"+pole].style.backgroundColor=kolorTlo;
		document.all["menu"].style.left = get_real_left(on_menu)-124;
		document.all["menu"].style.top = get_real_top(on_menu)+15;
		document.all["menu"].style.visibility = "visible";
		if (isNaN(rok))
			{
				rok=czasBiezacyRok;
				
			}
		
		if (isNaN(miesiac))
			{
				miesiac=parseInt(czasBiezacyMiesiac-1);
			}
		if (miesiac==12)
			{
				miesiac=0;
				rok++;
			}
		if (miesiac==-1)
			{
				miesiac=11;
				rok--;
			}
			
						
		if (isNaN(dzien))
			{
				dzien=czasBiezacyDzien;
			}

		outHTML =' <table width="140" border="0" cellspacing="1" cellpadding="1" bgcolor="#7F9DB9">'
				+'  <tr>'
				+'   <td bgcolor="#FFFFFF" valign="top">'
				
				+'   <table width="100%" border="0" cellspacing="0" cellpadding="0">'

			    +'    <tr>'
				+'     <td width="20%">'
				
				+'     <table height="100%" border="0" cellspacing="1" cellpadding="1" align="right" class="pointer" onClick="kalendarzPokaz(\''+pole+'\',\''+kolorTlo+'\','+rok+','+parseInt(miesiac-1)+','+dzien+')" onMouseOver="ustawTlo(this,\'#FEE197\',\'#2254b1\')" onMouseOut="ustawTlo(this,\'\',\'\')">'
				+'      <tr>'
				+'       <td>'
				+'       <table border="0" cellspacing="0" cellpadding="0">'
				+'        <tr>'
				+'         <td><div align="center"><img src="images/arrowright.gif" width="13" height="13"></div></td>'
				+'        </tr>'
				+'       </table>'				
				+'      </tr>'
				+'     </table>'
				+'     </td>'
				+'     <td width="60%" class="vtekst"><div align="center">'+miesiacNazwa[miesiac]+'</div></td>'
				+'     <td width="20%">'
				+'     <table height="100%" border="0" cellspacing="1" cellpadding="1" class="pointer" onClick="kalendarzPokaz(\''+pole+'\',\''+kolorTlo+'\','+rok+','+parseInt(miesiac+1)+','+dzien+')" onMouseOver="ustawTlo(this,\'#FEE197\',\'#2254b1\')" onMouseOut="ustawTlo(this,\'\',\'\')">'
				+'      <tr>'
				+'       <td>'
				+'       <table border="0" cellspacing="0" cellpadding="0">'
				+'        <tr>'
				+'         <td><div align="center"><img src="images/arrowleft.gif" width="13" height="13"></div></td>'
				+'        </tr>'
				+'       </table>'
				+'       </td>'
				+'      </tr>'
				+'     </table>'				
				+'     </td>'
				+'    </tr>'
				+'   </table>'
				

  			    +'   <table width="100%" border="0" cellspacing="0" cellpadding="0">'
				+'    <tr>'
				+'     <td width="33%">'
				
				+'     <table height="100%" border="0" cellspacing="1" cellpadding="1" class="pointer" align="right" onClick="kalendarzPokaz(\''+pole+'\',\''+kolorTlo+'\','+parseInt(rok-1)+','+miesiac+','+dzien+')" onMouseOver="ustawTlo(this,\'#FEE197\',\'#2254b1\')" onMouseOut="ustawTlo(this,\'\',\'\')">'
				+'      <tr>'
				+'       <td>'
				+'       <table border="0" cellspacing="0" cellpadding="0">'
				+'        <tr>'
				+'         <td><div align="center"><img src="images/arrowright.gif" width="13" height="13"></div></td>'
				+'        </tr>'
				+'       </table>'
				+'       </td>'
				+'      </tr>'
				+'     </table>'				
				
				+'     </td>'
				+'     <td width="33%" class="vtekst"><div align="center">'+rok+'</div></td>'
				+'     <td width="33%">'
				
				+'     <table height="100%" border="0" cellspacing="1" cellpadding="1" class="pointer" onClick="kalendarzPokaz(\''+pole+'\',\''+kolorTlo+'\','+parseInt(rok+1)+','+miesiac+','+dzien+')" onMouseOver="ustawTlo(this,\'#FEE197\',\'#2254b1\')" onMouseOut="ustawTlo(this,\'\',\'\')">'
				+'      <tr>'
				+'       <td>'
				+'       <table border="0" cellspacing="0" cellpadding="0">'
				+'        <tr>'
				+'         <td><div align="center"><img src="images/arrowleft.gif" width="13" height="13"></div></td>'
				+'        </tr>'
				+'       </table>'
				+'       </td>'
				+'      </tr>'
				+'     </table>'				
				
				+'     </td>'
				+'    </tr>'
				+'    <tr>'
				+'     <td colspan="3" height="4"></td>'
				+'    </tr>'
				+'   </table>'
				
				+'      <table width="130" border="0" cellspacing="1" cellpadding="0" align="center">'
				+'       <tr>'
				+'        <td><div align="center">Pn</div></td>'
				+'        <td><div align="center">Wt</div></td>'
				+'        <td><div align="center">Sr</div></td>'
				+'        <td><div align="center">Cz</div></td>'
				+'        <td><div align="center">Pi</div></td>'
				+'        <td><div align="center">So</div></td>'
				+'        <td><div align="center">Ni</div></td>'
				+'      </tr>';



		biezacaData=new Date(rok,miesiac,1);
		dzienTydzien=biezacaData.getDay();

		dk=1;
		dni= new Array;
		dni[0]='';
		maxData=new Date(rok,miesiac+1,0);
		de=maxData.getDate();
		for(i=1;i<43;i++)
			{
				if (de>=dk)
					{
						if (i>=dzienTydzien)
							{
									dni[i]=dk;
									dk++;
							}
						else
							{
								dni[i]='';	
							}
					}
			}
		dk=1;
		for(i=0;i<6;i++)
			{
				outHTML+='<tr>';
				for(j=0;j<7;j++)
					{
						if (!isNaN(dni[dk])) 
							{	if (dni[dk]!='')
									{
										outHTML+='<td width="20" class="pointer" onClick="kalendarzUstaw(\''+pole+'\','+rok+','+miesiac+','+dni[dk]+')"><div unselectable="on" align="center">'+dni[dk]+'</div></td>';
									}
								else
									{
										outHTML+='<td width="20"></td>';
										}
									dk++;
								}
						}

				outHTML+='</tr>';
			}
				
		outHTML+='</table>'

				
				+'  </td>'
				+' </tr>'
				+'</table>';
/*

			
		document.all["menu"].innerHTML=outHTML;
		*/
		document.all["menu"].innerHTML=outHTML;		
	}


function dokumentCookie(label)
{
var labelLen=label.length
var cLen=document.cookie.length
var i=0
var  cEnd
while(i<cLen)
{
var j=i+labelLen
if (document.cookie.substring(i,j)==label)
{
cEnd=document.cookie.indexOf(";",j)
if (cEnd==-1)
{
cEnd=document.cookie.length
}
j++
return unescape(document.cookie.substring(j,cEnd))
}
i++
}
return ""
}

function wyjscie()
	{
		if (confirm("Czy na pewno chcesz sie \n          wylogować?"))
			{
				window.location='logout.php';
			}	
	}

function dokumentUkryj()
	{
		if (dokumentInfo=='')
			{
				document.all['infoPrzycisk'].innerHTML='<div align="center"><img src="images/arrowdown.gif" width="13" height="13"></div>';
				dokumentInfo=document.all['info'].innerHTML;
				document.all['info'].innerHTML='';
			}
		else
			{
				document.all['infoPrzycisk'].innerHTML='<div align="center"><img src="images/arrowup.gif" width="13" height="13"></div>';			
				document.all['info'].innerHTML=dokumentInfo;
				dokumentInfo='';
			}	
	}


function stronaPoprzednia(modul)
	{
		if (dokumentStrona>0)
			{
				dokumentStrona--;
				eval(modul+'()');
			}
	}

function stronaNastepna(strony,modul)
	{
		if (dokumentStrona<strony-1)
			{
				dokumentStrona++;
				eval(modul+'()');
			}
	}

function dokumentFiltruj(keyEvent,modul)
	{
		  if(keyEvent.keyCode==13) 
			{
				dokumentStrona=0;
				eval(modul+'()');	
		 	}
	}


function dokumentSortuj(kolumna,modul)
	{
		dokumentSortowanie=kolumna;
		eval(modul+'()');
	}



function dokumentClick()
	{

	 	if (dokumentOnClick==0)
	 		{
			//	document.all["vprint"].innerHTML='';
				document.all["menu"].style.visibility="hidden";
				document.all["podmenu"].style.visibility="hidden";			
			}
		else if (dokumentOnClick==1)
			{
				dokumentOnClick=0;
			}
		else if (dokumentOnClick==2)
			{
				dokumentOnClick=3;
			//	document.all['nowy_element'].cells[0].style.backgroundColor='';		
			//	document.all['nowy_element'].style.backgroundColor='';				
			}
		else if (dokumentOnClick==3)
			{
				dokumentOnClick=0;
				document.all['nowy_element'].cells[0].style.backgroundColor='';		
				document.all['nowy_element'].style.backgroundColor='';
				document.all["menu"].style.visibility="hidden";
				document.all["podmenu"].style.visibility="hidden";				
			}
		else if (dokumentOnClick==4)
			{
				dokumentOnClick=5;
			}			
		else if (dokumentOnClick==5)
			{
				dokumentOnClick=0;
				document.all["focus\_"+dokumentSlownik].style.backgroundColor='#FFFFFF';				
				document.all["menu"].style.visibility="hidden";				
			}						
		else if (dokumentOnClick==6)
			{
				dokumentOnClick=7;
			
			}
		else if (dokumentOnClick==7)
			{
				dokumentOnClick=0;
				document.all['menuWskaznik'].cells[0].style.backgroundColor='';		
				document.all['menuWskaznik'].style.backgroundColor='';
				document.all["menu"].style.visibility="hidden";
				document.all["podmenu"].style.visibility="hidden";				
			}					
	}

function nocontextmenu()  {
ak_node = event.srcElement;
event.cancelBubble = true;
event.returnValue = false;
return false;
}

function get_real_left(myobj) {
    xPos = myobj.offsetLeft;
    tempEl = myobj.offsetParent;
    while (tempEl != null) {
        xPos += tempEl.offsetLeft;
        tempEl = tempEl.offsetParent;
    }
    return(xPos);
}

function get_real_top(myobj) {
    yPos = myobj.offsetTop;
    tempEl = myobj.offsetParent;
    while (tempEl != null) {
        yPos += tempEl.offsetTop;
        tempEl = tempEl.offsetParent;
    }
    return(yPos);
}

function ustawFocus(tabela,kolorTlo,kolorRamka)
	{
	//	alert(kolorTlo);
			tabela.style.backgroundColor=kolorTlo;
			tabela.style.borderStyle='solid';
			tabela.style.borderWidth='1';			
			tabela.style.borderColor=kolorRamka;		
		//	tabela.style.paddingLeft='1';
		//	tabela.style.paddingRight='1';
			//tabela.style.backgroundColor=kolorRamka;

	}




function ustawPrzycisk(tabela,kolorTlo)
	{
			tabela.style.backgroundColor=kolorTlo;		
	}

function ustawTlo(tabela,kolorTlo,kolorRamka)
	{
		if (tabela.cells[0].style.backgroundColor!='#fafafa')
			{
			tabela.cells[0].style.backgroundColor=kolorTlo;		
			tabela.style.backgroundColor=kolorRamka;
			}
	}

function podmenuPopUp()
	{
		dokumentOnClick=1;
		on_menu = document.getElementById("menu");
		document.all["podmenu"].style.left = get_real_left(on_menu)+124;
		document.all["podmenu"].style.top = get_real_top(on_menu);
		document.all["podmenu"].style.visibility = "visible";
        xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
       	xmlDoc.async="false";
		xmlDoc.load('menu.php?uprawnienia=nowy');	
		outHTML ='<table width="125" border="0" cellspacing="1" cellpadding="1" bgcolor="#2254b1" >'
				+' <tr>'
				+'  <td class="popup">'
		i=0;
		while(i<xmlDoc.getElementsByTagName("menu").length)
			{
				outHTML+='   <table width="100%" border="0" cellspacing="1" cellpadding="1" class="pointer" onClick="'+xmlDoc.getElementsByTagName("modul_menu").item(i).text+'Dodaj()" onMouseOver="ustawTlo(this,\'#FEE197\',\'#2254b1\')" onMouseOut="ustawTlo(this,\'\',\'\')">'
						+'    <tr>'
						+'     <td>'
						+'      <table height="16" border="0" cellspacing="0" cellpadding="0">'
						+'       <tr>'
						+'        <td width="26"></td>'
						+'        <td>'+xmlDoc.getElementsByTagName("nowy_menu").item(i).text+'</td>'
						+'        <td width="10"></td>'
						+'       </tr>'
						+'      </table>'
						+'     </td>'
						+'    </tr>'
						+'   </table>'			
				i++;
			}
			
		outHTML+='  </td>'
				+' </tr>'
				+'</table>'				
		document.all['podmenu'].innerHTML=outHTML;								
	}

function menuPopUp(evt)
	{
		
		if (evt.button==2)
			{
				dokumentOnClick=1;
				document.all["menu"].style.left=evt.x;
				document.all["menu"].style.top=evt.y;
				outHTML ='<table width="125" border="0" cellspacing="1" cellpadding="1" bgcolor="#2254b1" >'
						+' <tr>'
						+'  <td class="popup">'
						+'   <table width="100%" border="0" cellspacing="1" cellpadding="1" class="pointer" onClick="podmenuPopUp()" onMouseOver="ustawTlo(this,\'#FEE197\',\'#2254b1\')" onMouseOut="ustawTlo(this,\'\',\'\')">'
						+'    <tr>'
						+'     <td>'
						+'      <table width="100%" border="0" cellspacing="0" cellpadding="0">'
						+'       <tr>'
						+'        <td width="26"><img src="images/newitem.gif" width="16" height="16"></td>'
						+'        <td>Utwórz</td>'
						+'        <td width="13"><img src="images/arrowleft.gif" width="13" height="13"></td>'
						+'       </tr>'
						+'      </table>'
						+'     </td>'
						+'    </tr>'
						+'   </table>'
						+'  </td>'
						+' </tr>'
		/*				+' <tr>'
						+'  <td bgcolor="#FAFAFA">'
						+'   <table width="150" border="0" cellspacing="0" cellpadding="0">'
						+'    <tr>'
						+'     <td width="28"></td>'
						+'     <td width="122" height="1" bgcolor="#2254b1"></td>'
						+'    </tr>'
						+'   </table>'
						+'  </td>'
						+' </tr>'
						+' <tr>'
						+'  <td>'
						+'   <table width="100%" border="0" cellspacing="1" cellpadding="1"  onMouseOver="ustawTlo(this,\'#FEE197\',\'#2254b1\')" onMouseOut="ustawTlo(this,\'\',\'\')">'
						+'    <tr>'
						+'     <td>'
						+'      <table width="100%" border="0" cellspacing="0" cellpadding="0">'
						+'       <tr>'
						+'        <td width="26"><img src="images/newitem.gif" width="16" height="16"></td>'
						+'        <td>Utwórz</td>'
						+'       </tr>'
						+'      </table>'
						+'     </td>'
						+'    </tr>'
						+'   </table>'
						+'  </td>'
						+' </tr>'
		*/
						+'</table>';
				document.all['menu'].innerHTML=outHTML;
				document.all["menu"].style.visibility="visible";
//				document.all["podmenu"].style.visibility="hidden";

		}	
	}


function menuZlicz(menu)
	{
	    xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
       	xmlDoc.async="false";
		xmlDoc.load('menu.php?menu='+menu);
	}

function menuUstaw(modul,menu)
	{
		menuZlicz(menu);
	//	alert(dokumentModul);
	//	if ((document.getElementById(dokumentModul)) && (dokumentModul!=modul) && (dokumentModul!=''))
		if (document.getElementById(dokumentModul))
			{
				document.all[dokumentModul].cells[1].style.color='#FFFFFF';
				document.all[dokumentModul].style.backgroundColor='';

				document.all[dokumentModul].style.borderStyle='none';
				document.all[dokumentModul].style.borderWidth='0';
				document.all[dokumentModul].style.paddingLeft='1';
				for(i=0;i<kolumny;i++)
					{
						if (document.getElementById('filtr'+i))
							{
								document.all['filtr'+i].value='';
							}
					}
			}

		if (document.getElementById(modul))
			{
				document.all[modul].cells[1].style.color='#131FA5';
				document.all[modul].style.backgroundColor='#E6EBF4';
				document.all[modul].style.borderStyle='solid';
				document.all[modul].style.borderWidth='1';
				document.all[modul].style.paddingLeft='0';
				document.all[modul].style.borderLeftColor='#00238B'
				document.all[modul].style.borderTopColor='#00238B';
				document.all[modul].style.borderRightColor='#578CEB';
				document.all[modul].style.borderBottomColor='#578CEB';
		
				if (dokumentModul!=modul)
					{
						dokumentSortowanie=0;
						dokumentStrona=0;
					}
			}			
		dokumentModul=modul;
	}


function dokumentWidok()
	{
		dokumentPokaz=0;
        xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
       	xmlDoc.async="false";
		xmlDoc.load('naglowek.php?modul='+dokumentModul);	

		kolumny=xmlDoc.getElementsByTagName("kolumny").item(0).text;	
	
        xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
       	xmlDoc.async="false";
		vParametry='?filtry='+kolumny+'&';
		
		for(i=0;i<kolumny;i++)
			{
				if (document.getElementById('filtr'+i))
					{
						vParametry+='filtr'+i+'='+escape(document.all['filtr'+i].value)+'&';
						if (document.all['filtr'+i].value!='')
							{
								dokumentPokaz=1;
							}
					}
			}
		vParametry+='sort='+dokumentSortowanie+'&strona='+dokumentStrona;
		xmlDoc.load(dokumentModul+'/view.php'+vParametry);

		outHTML ='<br><table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#DCE3EB">'
				+' <tr height="20">';
		i=0;
		while(i<xmlDoc.getElementsByTagName("szerokosc").length)
			{
				//outHTML+='<td><textarea name="filtr'+i+'" type="text" rows="1" cols="'+xmlDoc.getElementsByTagName("dlugosc").item(i).text+'" onKeyPress="Filtruj(event,\''+dokumentModul+'\')">'+xmlDoc.getElementsByTagName("filtr").item(i).text+'</textarea></td>';
				outHTML+='<td bgcolor="#FAFAFA"><input type="text" name="filtr'+i+'" class="input100" onKeyPress="dokumentFiltruj(event,\''+dokumentModul+'\')" value='+xmlDoc.getElementsByTagName("filtr").item(i).text+'></td>';
				i++
			}
		outHTML+='</tr>'
				+' <tr height="20">'
		i=0;
		while(i<xmlDoc.getElementsByTagName("szerokosc").length)
			{
				outHTML+='<td background="images/tlonaglowek.gif" width="'+xmlDoc.getElementsByTagName("szerokosc").item(i).text+'" class="pointer" onClick="dokumentSortuj('+i+',\''+dokumentModul+'\')"><div align="center">'+xmlDoc.getElementsByTagName("opis").item(i).text+'</div></td>';
				i++
			}		
		outHTML+='</tr>';
		i=0;
		j=0;
		bgcolor=bgcolor_tlo_standard;

		while((i<xmlDoc.getElementsByTagName("wiersz").item(0).text) && (dokumentPokaz==1))
			{
				outHTML+='<tr height="20" class="pointer" onDblClick="'+dokumentModul+'Info('+xmlDoc.getElementsByTagName("id").item(i).text+')">';
				j=0;
				while(j<xmlDoc.getElementsByTagName("szerokosc").length)
					{
						outHTML+='<td bgcolor="'+bgcolor+'"><div nowrap="true" unselectable="on" style="text-overflow: ellipsis; overflow: hidden; width: '+xmlDoc.getElementsByTagName("szerokosc").item(j).text+'px;">&nbsp;'+xmlDoc.getElementsByTagName(xmlDoc.getElementsByTagName("nazwa_pole").item(j).text).item(i).text+'</div></td>';
						j++
					}
				outHTML+='</tr>';
				if (bgcolor==bgcolor_tlo_standard)
					{
						bgcolor=bgcolor_tlo_alternatywa;
					}
				else
					{
						bgcolor=bgcolor_tlo_standard;
					}
				i++
			}
		if ((dokumentPokaz==0) | (i==0))
			{
				outHTML+='<tr height="20">';
				j=0;
				while(j<xmlDoc.getElementsByTagName("szerokosc").length)
					{
						outHTML+='<td bgcolor="'+bgcolor+'"><div nowrap="true" unselectable="on" style="text-overflow: ellipsis; overflow: hidden; width: '+xmlDoc.getElementsByTagName("szerokosc").item(j).text+'px;">&nbsp;</div></td>';
						j++
					}
				outHTML+='</tr>';			
			}
		
		document.all['strona'].innerHTML=outHTML;
		outHTML ='<table width="180" border="0" cellspacing="0" cellpadding="0">'
				+' <tr>'
				+'  <td width="35"><div align="center"><img src="images/prevs.gif" width="20" height="20" alt="poprzednia" class="pointer" onClick="stronaPoprzednia(\''+dokumentModul+'\')"></div></td>'
				+'  <td><div align="center" class="vtekst">strona '+parseInt(dokumentStrona+1)+' z '+xmlDoc.getElementsByTagName("strony").item(0).text+'</div></td>'
				+'  <td width="35"><div align="center"><img src="images/nexts.gif" width="20" height="20" alt="następna" class="pointer" onClick="stronaNastepna('+xmlDoc.getElementsByTagName("strony").item(0).text+',\''+dokumentModul+'\')""></div></td>'
				+' <tr>'
				+'</table>';
		document.all['panel'].innerHTML=outHTML;

	}

