function ch_tara(elem){
			var id_tara = elem.value;
			var xhttp = ajaxFunction();
			var url = 'http://www.easytour.ro/filtru_avansat/filtrulocalitati.php?tara='+id_tara;
			var oferta ='';
			if (document.getElementById('oferta_sejur').checked) {
				oferta = '&oferta=sejur';
			}
			if (document.getElementById('oferta_cazare').checked) {
				oferta = '&oferta=cazare';
			}
			if (document.getElementById('oferta_circuit').checked) {
				oferta = '&oferta=circuit';
			}
			if (document.getElementById('oferta_transport').cheched) {
				oferta = '&oferta=transport';
			}
			var categ_oferta = document.getElementById('s_categ_oferta').value;
			if (categ_oferta != '0'){
				categ_oferta = '&categ_oferta='+categ_oferta;
			} else {
				categ_oferta = '';
			}
			url += oferta+categ_oferta;
			document.getElementById('search_localitatea').style.display= "block";
			xhttp.onreadystatechange = function(){
				if(xhttp.readyState==4){
					document.getElementById('search_localitatea').innerHTML = xhttp.responseText;
				} else {
					document.getElementById('search_localitatea').innerHTML = 'Loading..';
				}
			}
			xhttp.open("POST",url,true);
			xhttp.send(null);
			
		}

function validare_form(){
		var nr  = 0;
		var oferta = '';
		var ales = 'Nu ai ales nimic!';
		if (document.getElementById('oferta_sejur').checked) {
			oferta = 'oferta=sejur';
		}
		if (document.getElementById('oferta_cazare').checked) {
			oferta = 'oferta=cazare';
		}
		if (document.getElementById('oferta_circuit').checked) {
			oferta = 'oferta=circuit';
		}
		if (document.getElementById('oferta_transport').cheched) {
			oferta = 'oferta=transport';
		}
			if (oferta != '') {
				nr++;	
				ales = 'Ai ales doar oferta!';
			}
			if (valoare('s_categ_oferta')!= '0'){
				ales = 'Ai ales doar tipul de oferta!';
				nr++;
			}
			if (valoare('s_tara')!= '0'){
				ales = 'Ai ales doar tara!';
				nr++;
			}
			if (valoare('s_localitatea')!= '0'){
				ales = 'Ai ales doar localitatea!';
				nr++;
			}
			if (valoare('s_pret_min')!= 'Pret minim'){
				nr++;
				ales = 'Ai ales doar pretul!';
			}
			if (valoare('s_masa')!= '0'){
				ales = 'Ai ales doar masa!';
				nr++;
			}
			if (valoare('s_an_plecare')!= '0'){
				ales = 'Ai ales doar data de plecare!';
				nr++;
			}
			if (valoare('s_categ_cazare')!= '0'){
				nr++;
				ales = 'Ai ales doar categoria de cazare';
			}
			if (valoare('s_hotel_id')!= '0'){
				nr++;
				ales = 'Ai ales doar hotelul!';
			}
			if (nr>=2){
				return true;
			} else {
				alert('Trebuiesc alese cel putin 2 criterii de cautare! \n'+ales);
				return false;
			}	
	}
function setMaxDate(datamax){
		max_an = datamax.charAt(0)+datamax.charAt(1)+datamax.charAt(2)+datamax.charAt(3);
		max_luna = datamax.charAt(5)+datamax.charAt(6);
		max_zi = datamax.charAt(8)+datamax.charAt(9);
		var textdata = '<b>Data plecarii: </b><select name="s_an_plecare" id="s_an_plecare" style="width:60px;border:1px solid #999; margin-top:10px;" onChange="ch_year(this);"><option value="0" checked> An </option>';
		var ij= 0;
		for (ij = c_an; ij <=max_an; ij++){
			textdata+='<option value="'+ij+'">'+ij+'</option>';
		}
		textdata+= '</select> <select name="s_luna_plecare" onchange="ch_month(this);" style="border:1px solid #999; margin-top:10px;"  id="s_luna_plecare"><option value="0" checked>Luna</option></select> <select name="s_zi_plecare" id="s_zi_plecare" style="width:40px;border:1px solid #999; margin-top:10px;"><option value="0" checked>Zi</option></select>';
		document.getElementById('search_dataplecare').innerHTML = textdata;
	}
function ajaxFunction(){
	    if (window.XMLHttpRequest) {
	        return new window.XMLHttpRequest;
	    }
	    else {
	        try {
	            return new ActiveXObject("MSXML2.XMLHTTP.3.0");
	        }
	        catch(ex) {
	            return null;
	        }
	    }
	}

	function ch_year(elem){
			if (elem.value == max_an) {
				document.getElementById('s_luna_plecare').options.length = 0;
				var i = 0;
				document.getElementById('s_luna_plecare').options[0] = new Option ('Luna', '0', true, true);
				if (max_an == c_an) {
					var lnu = c_luna; 
				} else {
					var lnu = 1;
				}
				for (i=lnu; i<max_luna; i++) {
					document.getElementById('s_luna_plecare').options[document.getElementById('s_luna_plecare').options.length] = new Option(luni[i], i, false, false);
				}
				if (c_zi <= max_zi) {
					document.getElementById('s_luna_plecare').options[document.getElementById('s_luna_plecare').options.length] = new Option(luni[max_luna], max_luna, false, false);
				}
			} else {
				document.getElementById('s_luna_plecare').options.length = 0;
				if (elem.value == c_an) {
					var lnu = c_luna;
				} else {
					var lnu = 1;
				}
				document.getElementById('s_luna_plecare').options[0] = new Option('Luna', '0', true, true);
				for (i=lnu; i<=12; i++){
					document.getElementById('s_luna_plecare').options[document.getElementById('s_luna_plecare').options.length] = new Option(luni[i], i, false, false);
				}
			}
	}
    
function ch_month(elem){
			var zi_plecare = document.getElementById('s_zi_plecare');
			var i = 0;
			if ((elem.value == max_luna)&&(document.getElementById('s_an_plecare').value == max_an)) {
				if (elem.value == c_luna) {
					var ziijin = c_zi;
				} else {
					var ziijin = 1;
				}
				zi_plecare.options.length = 0;
				zi_plecare.options[0] = new Option('Zi', '0', true, true);
				for (i=ziijin; i<=max_zi; i++) {
					zi_plecare.options[zi_plecare.options.length] = new Option(i,i);
				}
	
			} else {
				if (elem.value == c_luna) {
					var zin = c_zi;
				} else {
					var zin = 1;
				}
				zi_plecare.options.length = 0;
				zi_plecare.options[0] = new Option('Zi', '0', true, true);
				for (i=zin; i<=31; i++) {
					zi_plecare.options[zi_plecare.options.length] = new Option(i,i);
				}
			}
	}

	function ch_class(elem, text, clas1, clas2, mod) {
		if (mod == 1) {
			if (elem.value == text) {
				elem.value = '';
				elem.setAttribute("class", clas2);
			}
		} else {
			if (elem.value == '') {
				elem.value = text;
				elem.setAttribute("class", clas1);
			}
		}
	}

	function ignora_pret(elem) {
		if (elem.checked) {
            document.getElementById('euro').style.visibility= 'hidden';
            document.getElementById('s_pret').style.visibility= 'hidden';
			document.getElementById('s_pret_min').style.visibility= 'hidden';
			document.getElementById('s_pret_max').style.visibility= 'hidden';
		} else {
            document.getElementById('euro').style.visibility= 'visible';		  
		    document.getElementById('s_pret').style.visibility= 'visible';
			document.getElementById('s_pret_min').style.visibility= 'visible';
			document.getElementById('s_pret_max').style.visibility= 'visible';
		}
	}
    

	function valid_pret(elem,caz) {
		var text= elem.value;
		var validchar = '0123456789';
		var is_number = true;
		var i = 0;
		for (i= 0; i< text.length; i++) {
			if (validchar.indexOf(text.charAt(i)) == -1) {
				is_number = false;
			}
		}
		var idelem = 'eroare_pret';
		if (caz == 1) idelem = 'eroare_pret_max';
		if (text != ''){
			if (!is_number) {
				document.getElementById(idelem).style.display="block";
			} else {
				document.getElementById(idelem).style.display="none";
			}
		} else {
			document.getElementById(idelem).style.display="none";
		}
	}
	
	function refresh_date(pas, val) {
		var oferta ='ok';
        if (document.getElementById('oferta_circuit').checked==false){
            document.getElementById('search_hotel').style.display = 'block';
		    document.getElementById('s_hotel_ales').innerHTML = '';
		    document.getElementById('s_hotel_id').value = '0';
		    document.getElementById('s_hotel').value = 'Scrie aici numele hotelului..';
            if (document.getElementById('search_hotel_lista').style.display != 'none')
                filtruhotel(document.getElementById('s_hotel'));
		}
		
        if (document.getElementById('oferta_sejur').checked) {
			oferta = 'oferta=sejur';
            document.getElementById('search_zona').style.display="none";
            document.getElementById('search_zona_croaziera').style.display="none";
            document.getElementById('search_linia_croaziera').style.display="none";
            document.getElementById('search_vas_croaziera').style.display="none";
            document.getElementById('search_tara').style.display="block";
            document.getElementById('search_hotel').style.display="block";
		}
		
        if (document.getElementById('oferta_cazare').checked) {
			oferta = 'oferta=cazare';
            document.getElementById('search_zona').style.display="none";
            document.getElementById('search_zona_croaziera').style.display="none";
            document.getElementById('search_linia_croaziera').style.display="none";
            document.getElementById('search_vas_croaziera').style.display="none";
            document.getElementById('search_tara').style.display="block";
            document.getElementById('search_hotel').style.display="block";
		}
		
        if (document.getElementById('oferta_circuit').checked) {
			oferta = 'oferta=circuit';
            document.getElementById('search_zona').style.display="block";
            document.getElementById('search_zona_croaziera').style.display="none";
            document.getElementById('search_linia_croaziera').style.display="none";
            document.getElementById('search_vas_croaziera').style.display="none";
            document.getElementById('search_tara').style.display="none";
            document.getElementById('search_localitatea').innerHTML = '';
            document.getElementById('search_masa').innerHTML = '';
            document.getElementById('search_categ_cazare').innerHTML = '';
            document.getElementById('search_hotel').style.display="none";
		}
        
        if (document.getElementById('oferta_croaziera').checked) {
			oferta = 'oferta=croaziera';
            document.getElementById('search_zona').style.display="none";
            document.getElementById('search_zona_croaziera').style.display="block";
            document.getElementById('search_linia_croaziera').style.display="block";
            document.getElementById('search_vas_croaziera').style.display="block";
            document.getElementById('search_categ_oferta').innerHTML = '';
            document.getElementById('search_tara').style.display="none";
            document.getElementById('search_localitatea').innerHTML = '';
            document.getElementById('search_masa').innerHTML = '';
            document.getElementById('search_categ_cazare').innerHTML = '';
            document.getElementById('search_hotel').style.display="none";    
		}
		/*if (document.getElementById('oferta_transport').cheched) {
			oferta = 'oferta=transport';
		}
		if (val == 'transport') {
			oferta = 'oferta=transport';
		}
		if (oferta == 'oferta=transport'){
			document.getElementById('search_hotel').style.display= 'none';
		} else {
			document.getElementById('search_hotel').style.display = 'block';
		}*/
		var url1 = 'http://www.easytour.ro/filtru_avansat/filtrucoferta.php?'+oferta;
		var url2 = 'http://www.easytour.ro/filtru_avansat/filtrutara.php?'+oferta;
		var url3 = 'http://www.easytour.ro/filtru_avansat/filtrumasa.php?'+oferta;
		var url4 = 'http://www.easytour.ro/filtru_avansat/filtruplecare.php?'+oferta;
		var url5 = 'http://www.easytour.ro/filtru_avansat/filtrucazare.php?'+oferta;
        var url6 = 'http://www.easytour.ro/filtru_avansat/filtruzona.php?'+oferta;
        var url7 = 'http://www.easytour.ro/filtru_avansat/filtruzona_croaziera.php?'+oferta;
        var url8 = 'http://www.easytour.ro/filtru_avansat/filtrulinie_croaziera.php?'+oferta;
        var url9 = 'http://www.easytour.ro/filtru_avansat/filtruvas_croaziera.php?'+oferta;
 
		if (pas == 1){
            if (document.getElementById('oferta_croaziera').checked==false){
    			
                var xhttp = ajaxFunction();
    			xhttp.onreadystatechange = function(){
    				if(xhttp.readyState==4){
    					document.getElementById('search_categ_oferta').innerHTML = xhttp.responseText;
    				} else {
    					document.getElementById('search_categ_oferta').innerHTML = 'Loading..';
    				}
    			}
    			xhttp.open("POST",url1,true);
    			xhttp.send("t=a");
                
                if (document.getElementById('oferta_circuit').checked==false){
        			var xhttp1 = ajaxFunction();
        			xhttp1.onreadystatechange = function(){
        				if(xhttp1.readyState==4){
        					document.getElementById('search_tara').innerHTML = xhttp1.responseText;
        				} else {
        					document.getElementById('search_tara').innerHTML = 'Loading..';
        				}
        			}
        			xhttp1.open("POST",url2,true);
        			xhttp1.send("t=a");
        			var xhttp2 = ajaxFunction();
        			xhttp2.onreadystatechange = function(){
        				if(xhttp2.readyState==4){
        					document.getElementById('search_masa').innerHTML = xhttp2.responseText;
        				} else {
        					document.getElementById('search_masa').innerHTML = 'Loading..';
        				}
        			}
                    xhttp2.open("POST",url3,true);
        			xhttp2.send("t=a");
                } 
                			
    			var xhttp3 = ajaxFunction();
    			xhttp3.onreadystatechange = function(){
    				if(xhttp3.readyState==4){
    					//setMaxDate(xhttp3.responseText);
                        document.getElementById('search_dataplecare').innerHTML = xhttp3.responseText;
    				} else {
    					document.getElementById('search_dataplecare').innerHTML = 'Loading..';
    				}
    			}
    			xhttp3.open("POST",url4,true);
    			xhttp3.send("t=a");
   
                if (document.getElementById('oferta_circuit').checked==false){
        			var xhttp4 = ajaxFunction();
        			xhttp4.onreadystatechange = function(){
        				if(xhttp4.readyState==4){
        					document.getElementById('search_categ_cazare').innerHTML = xhttp4.responseText;
        				} else {
        					document.getElementById('search_categ_cazare').innerHTML = 'Loading..';
        				}
                      
        			}
        			xhttp4.open("POST",url5,true);
        			xhttp4.send("t=a");
                }
            }
            else {
            	var xhttp = ajaxFunction();
    			xhttp.onreadystatechange = function(){
    				if(xhttp.readyState==4){				    
    					document.getElementById('search_zona_croaziera').innerHTML = xhttp.responseText;
    				} else {
    					document.getElementById('search_zona_croaziera').innerHTML = 'Loading..';
    				}
    			}
    			xhttp.open("POST",url7,true);
    			xhttp.send("t=a");
                var xhttp3 = ajaxFunction();
    			xhttp3.onreadystatechange = function(){
    				if(xhttp3.readyState==4){
    					//setMaxDate(xhttp3.responseText);
                        document.getElementById('search_dataplecare').innerHTML = xhttp3.responseText;
    				} else {
    					document.getElementById('search_dataplecare').innerHTML = 'Loading..';
    				}
    			}
    			xhttp3.open("POST",url4,true);
    			xhttp3.send("t=a");
            }
		} 
        else {
			if (document.getElementById('oferta_croaziera').checked==false){
                var categ_oferta = document.getElementById('s_categ_oferta').value;
                if(categ_oferta==33) 
                    document.getElementById('search_zona').style.display="block";
                
    			if (categ_oferta != '0'){
    				url2 += '&categ_oferta='+categ_oferta;
    				url3 += '&categ_oferta='+categ_oferta;
    				url4 += '&categ_oferta='+categ_oferta;
    				url5 += '&categ_oferta='+categ_oferta;
    			}
            }
            if (pas == 2) {
                if (document.getElementById('oferta_croaziera').checked==false){ 
                    if (document.getElementById('oferta_circuit').checked==false){
        				var xhttp = ajaxFunction();
        				xhttp.onreadystatechange = function(){
        					if(xhttp.readyState==4){
        						document.getElementById('search_tara').innerHTML = xhttp.responseText;
        					} else {
        						document.getElementById('search_tara').innerHTML = 'Loading..';
        					}
        				}
               
        				xhttp.open("POST",url2,true);
        				xhttp.send("t=a");
        				var xhttp1 = ajaxFunction();
        				xhttp1.onreadystatechange = function(){
        					if(xhttp1.readyState==4){
        						document.getElementById('search_masa').innerHTML = xhttp1.responseText;
        					} else {
        						document.getElementById('search_masa').innerHTML = 'Loading..';
        					}
        				}
                    }
    				xhttp1.open("POST",url3,true);
    				xhttp1.send("t=a");
    				var xhttp2 = ajaxFunction();
    				xhttp2.onreadystatechange = function(){
    					if(xhttp2.readyState==4){
    						//setMaxDate(xhttp2.responseText);
                            document.getElementById('search_dataplecare').innerHTML = xhttp2.responseText;
    					} else {
    						document.getElementById('search_dataplecare').innerHTML = 'Loading..';
    					}
    				}
    				xhttp2.open("POST",url4,true);
    				xhttp2.send("t=a");
    				var xhttp3 = ajaxFunction();
    				xhttp3.onreadystatechange = function(){
    					if(xhttp3.readyState==4){
    						document.getElementById('search_categ_cazare').innerHTML = xhttp3.responseText;
    					} else {
    						document.getElementById('search_categ_cazare').innerHTML = 'Loading..';
    					}
    				}
    				xhttp3.open("POST",url5,true);
    				xhttp3.send("t=a");
                }
           } 
           else {
                if (document.getElementById('oferta_croaziera').checked==false){
                    if (document.getElementById('oferta_circuit').checked==false){
				        var masa = document.getElementById('s_tara').value;
        				if (masa != '0'){
        					url3 += '&tara='+masa;
        					url4 += '&tara='+masa;
        					url5 += '&tara='+masa;
        				}
        				
        				var localitatea = document.getElementById('s_localitatea').value;
        				if (localitatea != '0'){
        					url3 += '&localitatea='+localitatea;
        					url4 += '&localitatea='+localitatea;
        					url5 += '&localitatea='+localitatea;
        				}
                    }
                    else {
                        var zona = document.getElementById('s_zona').value;
        				if (zona != '0'){
        					url3 += '&zona='+zona;
        					url4 += '&zona='+zona;
        					url5 += '&zona='+zona;  
                        }
                    }
                }
                else {
                    var zona_croaziera = document.getElementById('s_zona_croaziera').value;
    				if (zona_croaziera != '0'){
    				    url4 += '&zona_croaziera='+zona_croaziera;
    					url8 += '&zona_croaziera='+zona_croaziera;
    					url9 += '&zona_croaziera='+zona_croaziera;
                    }
                }
               
				if (pas == 3) { 
                    if (document.getElementById('oferta_croaziera').checked==false){
				        if (document.getElementById('oferta_circuit').checked==false){
        					var xhttp = ajaxFunction();
        					xhttp.onreadystatechange = function(){
        						if(xhttp.readyState==4){
        							document.getElementById('search_masa').innerHTML = xhttp.responseText;
        						} else {
        							document.getElementById('search_masa').innerHTML = 'Loading..';
        						}
        					}
        					xhttp.open("POST",url3,true);
        					xhttp.send("t=a");
                            
        					var xhttp1 = ajaxFunction();
        					xhttp1.onreadystatechange = function(){
        						if(xhttp1.readyState==4){
        							//setMaxDate(xhttp1.responseText);
                                    document.getElementById('search_dataplecare').innerHTML = xhttp1.responseText;
        						} else {
        							document.getElementById('search_dataplecare').innerHTML = 'Loading..';
        						}
        					}
        					xhttp1.open("POST",url4,true);
        					xhttp1.send("t=a");
        					
                            var xhttp2 = ajaxFunction();
        					xhttp2.onreadystatechange = function(){
        						if(xhttp2.readyState==4){
        							document.getElementById('search_categ_cazare').innerHTML = xhttp2.responseText;
        						} else {
        							document.getElementById('search_categ_cazare').innerHTML = 'Loading..';
        						}
        					}
        					xhttp2.open("POST",url5,true);
        					xhttp2.send("t=a");
                        }
                        else {
        					var xhttp1 = ajaxFunction();
        					xhttp1.onreadystatechange = function(){
        						if(xhttp1.readyState==4){
        							document.getElementById('search_dataplecare').innerHTML = xhttp1.responseText;
        						} else {
        							document.getElementById('search_dataplecare').innerHTML = 'Loading..';
        						}
        					}
        					xhttp1.open("POST",url4,true);
        					xhttp1.send("t=a");
        					var xhttp2 = ajaxFunction();
        					xhttp2.onreadystatechange = function(){
        						if(xhttp2.readyState==4){
        							document.getElementById('search_categ_cazare').innerHTML = xhttp2.responseText;
        						} else {
        							document.getElementById('search_categ_cazare').innerHTML = 'Loading..';
        						}
        					}
        					xhttp2.open("POST",url5,true);
        					xhttp2.send("t=a"); 
                         }
                    }
                    else {
                        var xhttp = ajaxFunction();
        					xhttp.onreadystatechange = function(){
        						if(xhttp.readyState==4){
        							document.getElementById('search_linia_croaziera').innerHTML = xhttp.responseText;
        						} else {
        							document.getElementById('search_linia_croaziera').innerHTML = 'Loading..';
        						}
        					}
        					xhttp.open("POST",url8,true);
        					xhttp.send("t=a");
                            
                        var xhttp1 = ajaxFunction();
        					xhttp1.onreadystatechange = function(){
        						if(xhttp1.readyState==4){
        							document.getElementById('search_vas_croaziera').innerHTML = xhttp1.responseText;
        						} else {
        							document.getElementById('search_vas_croaziera').innerHTML = 'Loading..';
        						}
        					}
        					xhttp1.open("POST",url9,true);
        					xhttp1.send("t=a");
                            
                        var xhttp2 = ajaxFunction();
        					xhttp2.onreadystatechange = function(){
        						if(xhttp2.readyState==4){
        							document.getElementById('search_dataplecare').innerHTML = xhttp2.responseText;
        						} else {
        							document.getElementById('search_dataplecare').innerHTML = 'Loading..';
        						}
        					}
        					xhttp2.open("POST",url4,true);
        					xhttp2.send("t=a");
                    }  
                
                
				} 
                else {
                    if (document.getElementById('oferta_croaziera').checked==false){    
    					var masa = document.getElementById('s_masa').value;
    					if (masa!= '0'){
    						url5 += '&masa='+masa;
    						url4 += '&masa='+masa;
    					}
                    }
                    else {
                        var linia_croaziera = document.getElementById('s_linia_croaziera').value;
    				    if (linia_croaziera != '0')
    					   url4 += '&linie_croaziera='+linia_croaziera;
                           url9 += '&linia_croaziera='+linia_croaziera;
                           
                    }
					if (pas == 4) {
                        if (document.getElementById('oferta_croaziera').checked==false){    
    						var xhttp = ajaxFunction();
    						xhttp.onreadystatechange = function(){
    							if(xhttp.readyState==4){
    								document.getElementById('search_dataplecare').innerHTML = xhttp.responseText;
    							} else {
    								document.getElementById('search_dataplecare').innerHTML = 'Loading..';
    							}
    						}
    						xhttp.open("POST",url4,true);
    						xhttp.send(null);
    						var xhttp1 = ajaxFunction();
    						xhttp1.onreadystatechange = function(){
    							if(xhttp1.readyState==4){
    								document.getElementById('search_categ_cazare').innerHTML = xhttp1.responseText;
    							} else {
    								document.getElementById('search_categ_cazare').innerHTML = 'Loading..';
    							}
    						}
    						xhttp1.open("POST",url5,true);
    						xhttp1.send("t=a");
                        }
                        else {
    						var xhttp1 = ajaxFunction();
    						xhttp1.onreadystatechange = function(){
    							if(xhttp1.readyState==4){
    								document.getElementById('search_vas_croaziera').innerHTML = xhttp1.responseText;
    							} else {
    								document.getElementById('search_vas_croaziera').innerHTML = 'Loading..';
    							}
    						}
    						xhttp1.open("POST",url9,true);
    						xhttp1.send("t=a");    
                            
                            var xhttp2 = ajaxFunction();
        					xhttp2.onreadystatechange = function(){
        						if(xhttp2.readyState==4){
        							document.getElementById('search_dataplecare').innerHTML = xhttp2.responseText;
        						} else {
        							document.getElementById('search_dataplecare').innerHTML = 'Loading..';
        						}
        					}
        					xhttp2.open("POST",url4,true);
        					xhttp2.send("t=a");
                            
                        }
					} 
                    else {
                        if (document.getElementById('oferta_croaziera').checked==false){
                            var plecare = document.getElementById('s_luna_plecare').value;
                            if ( plecare != '0')
                                url5 += '&dataplecare='+plecare;
						      
							var xhttp = ajaxFunction();
							xhttp.onreadystatechange = function(){
								if(xhttp.readyState==4){
									document.getElementById('search_categ_cazare').innerHTML = xhttp.responseText;
								} else {
									document.getElementById('search_categ_cazare').innerHTML = 'Loading..';
								}
							}
							xhttp.open("POST",url5,true);
							xhttp.send(null);
                        }
                        else {
                            var vas_croaziera = document.getElementById('s_vas_croaziera').value;
    				        if (vas_croaziera != '0')
                                url4 += '&vas_croaziera='+vas_croaziera;
                            
                            if(pas == 5) {
                                var xhttp2 = ajaxFunction();
            					xhttp2.onreadystatechange = function(){
            						if(xhttp2.readyState==4){
            							document.getElementById('search_dataplecare').innerHTML = xhttp2.responseText;
            						} else {
            							document.getElementById('search_dataplecare').innerHTML = 'Loading..';
            						}
            					}
            					xhttp2.open("POST",url4,true);
            					xhttp2.send("t=a");
                            }
                        }    
					}
				}
			}
		}
	}       
 
		function filtruhotel_ajax(){
			var xhttp = ajaxFunction();
			var detalii = '?text_cautat=' + document.getElementById('s_hotel').value;
			detalii += '&s_categ_cazare='+document.getElementById('s_categ_cazare').value;
			//detalii += '&s_an_plecare='+document.getElementById('s_an_plecare').value;
			detalii += '&s_luna_plecare='+document.getElementById('s_luna_plecare').value;
			//detalii += '&s_zi_plecare='+document.getElementById('s_zi_plecare').value;
			detalii += '&s_masa='+document.getElementById('s_masa').value;
			detalii += '&s_localitatea='+document.getElementById('s_localitatea').value;
			if (!document.getElementById('s_pret_ignora').checked){
				if (document.getElementById('s_pret_min').value != 'Pret minim'){
					detalii += '&s_pret_min='+document.getElementById('s_pret_min').value;
				}
				if (document.getElementById('s_pret_max').value != 'Pret maxim'){
					detalii += '&s_pret_max='+document.getElementById('s_pret_max').value;
				}
			}
			if (document.getElementById('search_localitatea').style.display=='block') {
			}
			//oferta_sejur oferta_cazare oferta_circuit oferta_transport
			if (document.getElementById('oferta_sejur').checked) {
				detalii += '&s_tip_oferta=sejur';
			}
			if (document.getElementById('oferta_cazare').checked) {
				detalii += '&s_tip_oferta=cazare';
			}
			if (document.getElementById('oferta_circuit').checked) {
				detalii += '&s_tip_oferta=circuit';
			}
			
			if (document.getElementById('oferta_transport').checked) {
				detalii += '&s_tip_oferta=transport';
			}
			detalii += '&s_categ_oferta='+document.getElementById('s_categ_oferta').value;
			detalii += '&s_tara='+document.getElementById('s_tara').value;
			xhttp.onreadystatechange = function(){
				if(xhttp.readyState==4){
					document.getElementById('search_hotel_lista').innerHTML = xhttp.responseText;
				} else {
					document.getElementById('search_hotel_lista').innerHTML = 'loading..';
				}
			}
			xhttp.open("POST","http://www.easytour.ro/filtru_avansat/filtruhotel.php"+detalii,true);
			xhttp.send(null);
		}
		
		function filtruhotel(elem){
			if (elem.value.length>=3) {
				filtruhotel_ajax();
				document.getElementById('search_hotel_lista').style.display="block";
			} else {
				document.getElementById('search_hotel_lista').style.display="none";
			}
		}
		
		function valoare(id){
			return document.getElementById(id).value;
		}
		
		function filtruhotel_jv(){

		}
		
		function alegehotel(elem){
			document.getElementById('search_hotel_lista').style.display = 'none';
			document.getElementById('s_hotel_ales').innerHTML = ' ';
			document.getElementById('s_hotel').value = elem.innerHTML;
			document.getElementById('s_hotel_id').value = elem.getAttribute('id_hotel');
		} 
