
			var ajaxObject;
			function getDestination(GATEWAY_CODE){
				displayWaitingMessage();
				var params = "GATEWAY_CODE=" + encodeURI(GATEWAY_CODE) + "&LNG=fr";
				ajaxObject = getHTTPObject();
				ajaxObject.onreadystatechange = SetDestination;
				ajaxObject.open("POST", "sv_form/GetDestination.php", true);
				ajaxObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
				ajaxObject.setRequestHeader("Content-length", params.length);
				ajaxObject.setRequestHeader("Connection", "close");
				ajaxObject.send(params);
			}
			function SetDestination (){			
				if(ajaxObject.readyState == 4){
					var JSONtext = ajaxObject.responseText;
					var JSONobject = JSON.parse(JSONtext);
							
					var selDestDep = document.getElementById('dest_dep');
					selDestDep.options.length=0;
					
					var i, j;
					j=0;
					var bSep = false;
					var a = JSONobject.rows;
					for(i=0;i<a.length;i++){
						var dest = a[i].dest;
						var code = a[i].code;
						
						if(dest.indexOf('Tout ')!=0 && bSep==false){
							selDestDep.options[j]=new Option('', '', false, false)
							bSep=true;
							j++;
						}
						
						var bSel = false;
						if(dest == 'Tout Sud'){bSel=true;}
						selDestDep.options[j]=new Option(dest, code, false, bSel)
						if(dest.indexOf('- ')!=0){
							selDestDep.options[j].style.color = "#ffffff";
							selDestDep.options[j].style.backgroundColor = "#ef7600";
						}
						if(dest.indexOf('-')==0){selDestDep.options[j].innerHTML = '&nbsp;&bull;' + selDestDep.options[j].innerHTML.replace('-','');}
						j++;
					}
					closeMessage();
					
					getHotel(document.getElementById('gateway_dep').options[document.getElementById('gateway_dep').selectedIndex].value, document.getElementById('dest_dep').options[document.getElementById('dest_dep').selectedIndex].value)
				}
			}
			function getHotel(GATEWAY_CODE, DEST_CODE){
				displayWaitingMessage();
				var params = "GATEWAY_CODE=" + encodeURI(GATEWAY_CODE) + "&DEST_CODE=" + encodeURI(DEST_CODE) + "&LNG=fr";;
				ajaxObject = getHTTPObject();
				ajaxObject.onreadystatechange = SetHotel;
				ajaxObject.open("POST", "sv_form/GetHotel.php", true);
				ajaxObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
				ajaxObject.setRequestHeader("Content-length", params.length);
				ajaxObject.setRequestHeader("Connection", "close");
				ajaxObject.send(params);
			}
			function SetHotel (){			
				if(ajaxObject.readyState == 4){
					var JSONtext = ajaxObject.responseText;
					var JSONobject = JSON.parse(JSONtext);
							
					var selHotel = document.getElementById('no_hotel');
					selHotel.options.length=0;
					document.getElementById('duration').options.length=0;
					
					var i;
					var a = JSONobject.rows;
					var nbChain = 0;
					var nbDure = 0;
					var nbDest = 0;
					for(i=0;i<a.length;i++){
						if(a[i].name!= undefined){
							var hname = a[i].name;
							var code = a[i].code;
							nbDest++;
							
							selHotel.options[i]=new Option(hname, code, false, false)
							if(hname.indexOf('Tous les ')==0){
								selHotel.options[i].style.color = "#ffffff";
								selHotel.options[i].style.backgroundColor = "#ef7600";
								nbChain++;
							}
							if(hname.indexOf('-')==0){selHotel.options[i].innerHTML = '&nbsp;&bull;' + hname.replace('-','');}
						}else{
							var bSel = false;
							if(a[i].dure == '5 à 10 jours'){bSel=true;}
							
							document.getElementById('duration').options[i-nbDest]=new Option(a[i].dure, a[i].dure_code, false, bSel)
							nbDure++;
						}
					}
					if(nbChain == i-nbDure){
						for(i=1;i<selHotel.options.length;i++){
							selHotel.options[i].style.color = "#000000";
							selHotel.options[i].style.backgroundColor = "#ffffff";
						}
					}
					
					closeMessage();
				}
			}
			function getHTTPObject(){
				var xhr = false;
				if (window.XMLHttpRequest){
					xhr = new XMLHttpRequest();
				}else if (window.ActiveXObject){
					try{
						xhr = new ActiveXObject("Msxml2.XMLHTTP");
					}catch(e){
						try{xhr = new ActiveXObject("Microsoft.XMLHTTP");}
						catch(e){xhr = false;}
					}
				}
				return xhr;
			}
