		function Serwis(name, id, url, label, s1, s2, adv, uri) 
		{ 			
			this.name=name; 
			this.id=id; 				
			this.label=label; 
			this.url=url; 
			this.s1=s1; 
			this.s2=s2; 
			this.adv=adv; 
			if(uri==undefined)this.uri=url;				
			  else this.uri=uri;
			  			  			 
			if(typeof Serwis._initialized=="undefined") 
			{ 
				Serwis.prototype.setZ=function(x,ajx) 
				{														
					if(this.id==active) 
					{ 						
						getEl('zL'+this.id).className='biz_left_a'; 
						getEl('zC'+this.id).className='biz_middle_a text_small'; 
						getEl('zR'+this.id).className='biz_right_a'; 
						getEl('label').innerHTML=this.label; 
						getEl('wyszuk_prosta').action="/"+this.url; 						
												
						 	
						if(!main){													
							getEl('advanced_table').style.display="block";
							getEl('advanced_link').href=this.adv;
						}
						else getEl('advanced_table').style.display="none";						
						getEl('zL'+this.id).innerHTML='';
						if(ajx){
							if(active==177 || active==178)
								getEl('slow_2').innerHTML=getEl(this.s2).innerHTML;
							else
								this.wojewodztwo();								
							this.branza();
						}
						else{
							getEl('slow_2').innerHTML=getEl(this.s2).innerHTML;
							getEl('slow_1').innerHTML=getEl(this.s1).innerHTML;						
						}
						return(0);																		
					} 
					else 
					{ 						
						getEl('zL'+this.id).className='biz_tlo_top'; 
						getEl('zC'+this.id).className='biz_tlo_top text_small'; 
						getEl('zR'+this.id).className='biz_tlo_top'; 
						if(x!=0)											
							getEl('zL'+this.id).innerHTML='<img src="/img/rozdzielacz3.gif"/>'; 						 													
						else getEl('zL'+this.id).innerHTML='';
						return(1);
					}
				}	

				Serwis.prototype.branza=function(){												
					var request='/server.php?akcja=branze&uri='+this.uri;		
					var ajax = new sack();						
					ajax.requestFile = request;
					ajax.method = 'POST';							
					ajax.onCompletion =  function(){ getEl('slow_1').innerHTML=ajax.response;};
					ajax.runAJAX();		
					return(0);
				}
				
				Serwis.prototype.wojewodztwo=function(){												
					var request='/server.php?akcja=wojewodztwa&uri='+this.uri;		
					var ajax = new sack();						
					ajax.requestFile = request;
					ajax.method = 'POST';							
					ajax.onCompletion =  function(){ getEl('slow_2').innerHTML=ajax.response;};
					ajax.runAJAX();		
					return(0);
				}						
				Serwis._initialized=true; 
			} 
		}
		
	function szablon(dop)
	{
		document.write('<form name="wyszuk_prosta" id="wyszuk_prosta" style="margin: 0pt;" method="post">'+
					   '<table border="0" cellpadding="0" cellspacing="0" id="labels"><tr>'); 
		var width=0;			   
		for(i=0; i<arr.length;i++) 
		{ 
			document.write('<td><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>'+ 
						   '<td height="19" width="5" id="zL'+arr[i].id+'"></td>'+ 
						   '<td height="19" id="zC'+arr[i].id+'" onclick="ckZ('+arr[i].id+',1)">'+arr[i].name+'</td>'+ 
						   '<td height="19" width="5" id="zR'+arr[i].id+'"></td>'+ 
						   '</tr></table></td>');			
		}				
		
		document.write('<td width="'+dop+'" class="biz_tlo_top"></td></tr></table>'+ 
					   '<table border="0" cellpadding="0" cellspacing="0"><tr>'+ 
					   '<td class="biz_tlo_left" height="39" width="5"></td>'+ 
					   '<td class="biz_tlo produkt_blue_font" width="135" align="center" id="label">szukaj</td>'+ 
					   '<td class="biz_tlo" width="5"></td>'+ 
					   '<td class="biz_tlo" width="350" id="slow_1"></td>'+ 
					   '<td class="biz_tlo" width="5"></td>'+ 
					   '<td class="biz_tlo" width="170" id="slow_2"></td>'+ 
					   '<td style="cursor: pointer;" class="biz_tlo" align="center" width="105">'+ 
					   '<img src="/img/szukaj.gif" alt="" onclick="getEl(\'wyszuk_prosta\').submit();" /></td>'+ 
					   '<td class="biz_tlo_right" width="5"></td>'+ 
					   '</tr></table>'+
					   '<input type="hidden" name="select_data_wprow" value="'+select_data_wprow+'"/>'+
					   '</form>');
					   
					   
		document.write('<table cellpadding="0" cellspacing="0" border="0" align="center" id="advanced_table" style="display:none;">'+
					   '<tr><td width="480"></td>'+
					   '<td width="300" align="right"><span><img src="/img/lupa2.gif" /></span>'+
					   '<span style="padding-left:5px">'+
					   '<a href="/inwestycje/wyszukiwanie" class="text_small" style="text-decoration:underline;" id="advanced_link">'+
					   'Przejd&#378; do wyszukiwarki zaawansowanej</a></span>'+
					   '</td></tr></table>'); 
	}
					   					   
	function ckZ(id,ajx) 
	{ 			
		var x=0;
		active=id; 			
		for(i=0; i<arr.length;i++){				
			x=arr[i].setZ(x,ajx); 																										
		}
	}