 function checkRes()
   {
   		var typNem = document.getElementById('nemtype');
   		var nemtype = typNem.options[typNem.selectedIndex].value;
   		
   		ajaxUrl='http://www.skanskareality.cz/ajax/ajax_search_info.php';
			ajaxElement = 'total_found';
			ajaxLoadingMsg ="?";
			ajaxUsePost = true;
			
		
			
			var formik = document.getElementById('formie');
			var name;
			var value;
			
			
			for(i=0; i<formik.elements.length; i++)
			{
				 if(formik.elements[i].type=="checkbox" && formik.elements[i].checked == false)
							continue;
				 
				 ajaxPostParams+='&'+formik.elements[i].name + '='+formik.elements[i].value;
			}
						
			RunAjax();
		
   }
   
   
   	function updCombo(from, obj)
  		{
  				var type = document.getElementById('nemtype');
  				var loc = document.getElementById('locality');
  				var cats = document.getElementById('category');
  		
  				
  				
  				var selIdx = loc.selectedIndex;
  				
  				for(i=type.options.length-1;i>=0;i--)
							type.remove(i);
					
					var hasCats=false;
				
  				if (selIdx <= 1)
  				{
  						 hasCats = true;
  						type.options[type.options.length] = new Option("Byt", 0);
  						type.options[type.options.length] = new Option("Dům", 1);
  						type.options[type.options.length] = new Option("Garáž", 2);
  						type.options[type.options.length] = new Option("Nebytový prostor", 4);
  						type.options[type.options.length] = new Option("Pozemek", 5);		
  				}
  				else
  				{
  					
		  			
		  			
		  				if (Types.length >= selIdx-3)
		  				{
				  				
				  				if (selIdx == 2) // cela praha
				  				{
				  							type.options[type.options.length] = new Option("Byt", 0);
					  						type.options[type.options.length] = new Option("Dům", 1);
					  						type.options[type.options.length] = new Option("Garáž", 2);
					  						type.options[type.options.length] = new Option("Nebytový prostor", 4);
					  						
				  							
				  							hasCats = true;
				  				}	
				  				else
				  				{
							  				if (Types[selIdx-3][0])
							  				{
							  						type.options[type.options.length] = new Option("Byt", 0);
							      				 hasCats = true;
							      		}
							      		
							      		if (Types[selIdx-3][1])
							  				{
							  						type.options[type.options.length] = new Option("Dům", 1);
														 hasCats = true;
												}
							  				if (Types[selIdx-3][2])
							  					type.options[type.options.length] = new Option("Garáž", 2);
							  		
							  				if (Types[selIdx-3][3])
							  					type.options[type.options.length] = new Option("Nebytový prostor", 4);
							  					
							  				if (Types[selIdx-3][4])
							  					type.options[type.options.length] = new Option("Pozemek", 5);		
		  						}
		  				}
		  		}
  				
  				 
  				if (hasCats)
  				{
  						cats.disabled = false;
  						
  				}
  				else
  				{
  						cats.disabled = true;
  						cats.selectedIndex=0;
  				}
  					
  				checkRes();
  		}
