function search(){

new Ajax.Updater('resultat', 'wait.php?xhttp=1&form=resultat&fs_from='+document.getElementById('fs_from').value+'&fs_to='+document.getElementById('fs_to').value+'&fs_dep_day='+document.getElementById('fs_dep_day').value+'&fs_dep_month='+document.getElementById('fs_dep_month').value+'&fs_ret_day='+document.getElementById('fs_ret_day').value+'&fs_ret_month='+document.getElementById('fs_ret_month').value+'&fs_ticketclass='+document.getElementById('fs_ticketclass').value+'&fs_num_adults='+document.getElementById('fs_num_adults').value+'&fs_num_children='+document.getElementById('fs_num_children').value+'&fs_num_babies='+document.getElementById('fs_num_babies').value,
 {asynchronous:true,  
 onLoading:function(){
  Element.show('ajax_loader');},
 onFailure: function(){
 },
 onComplete:function(){
Element.hide('ajax_loader');
window.location = 'http://www.iledelareunion.net/billet-avion-reunion/index.php';
}
});	

}

function search_slide(v1,v2){
new Ajax.Updater('resultat', 'index.php?xhttp=1&form=resultat&prix='+v1+'&prixmax='+v2,
 {asynchronous:true,  
 onLoading:function(){
  Element.show('ajax_loader');},
 onFailure: function(){
 },
 onComplete:function(){
  load = 'resultat';
	load = document.getElementById(load);
	load.style.display = 'none';
	Element.hide('ajax_loader');
	new Effect.Appear(load, {duration: 0.5});
}
});	

}




function checkmerchant(){
var allinputs= document.getElementsByTagName("input");
if(allinputs!=null){
var envoie="cmerchant=";
for(var i = 0; i < allinputs.length;i++){
if(allinputs[i].type=="checkbox"){

if(allinputs[i]==null){
return;
}

if(allinputs[i].checked){

if(allinputs[i].name=="cmerchant"){
envoie=envoie.concat(allinputs[i].value+',');
}
}
}
}

new Ajax.Updater('resultat', 'index.php?xhttp=1&form=resultat&type=cmerchant&'+envoie,
 {asynchronous:true,  
 onLoading:function(){
  Element.show('ajax_loader');},
 onFailure: function(){
 },
 onComplete:function(){
  load = 'resultat';
	load = document.getElementById(load);
	load.style.display = 'none';
	Element.hide('ajax_loader');
	new Effect.Appear(load, {duration: 0.5});
}
});

}
}


function checkairline(){
var allinputs= document.getElementsByTagName("input");
if(allinputs!=null){
var envoie="cairline=";
for(var i = 0; i < allinputs.length;i++){
if(allinputs[i].type=="checkbox"){

if(allinputs[i]==null){
return;
}

if(allinputs[i].checked){

if(allinputs[i].name=="cairline"){
envoie=envoie.concat(allinputs[i].value+',');
}
}
}
}


new Ajax.Updater('resultat', 'index.php?xhttp=1&form=resultat&type=cairline&'+envoie,
 {asynchronous:true,  
 onLoading:function(){
  Element.show('ajax_loader');},
 onFailure: function(){
 },
 onComplete:function(){
  load = 'resultat';
	load = document.getElementById(load);
	load.style.display = 'none';
	Element.hide('ajax_loader');
	new Effect.Appear(load, {duration: 0.5});
}
});

}
}


function checkdeparture_a(){
var allinputs= document.getElementsByTagName("input");
if(allinputs!=null){
var envoie="cdeparture_a=";
for(var i = 0; i < allinputs.length;i++){
if(allinputs[i].type=="checkbox"){

if(allinputs[i]==null){
return;
}

if(allinputs[i].checked){

if(allinputs[i].name=="cdeparture_a"){
envoie=envoie.concat(allinputs[i].value+',');
}
}
}
}


new Ajax.Updater('resultat', 'index.php?xhttp=1&form=resultat&type=cdeparture_a&'+envoie,
 {asynchronous:true,  
 onLoading:function(){
  Element.show('ajax_loader');},
 onFailure: function(){
 },
 onComplete:function(){
  load = 'resultat';
	load = document.getElementById(load);
	load.style.display = 'none';
	Element.hide('ajax_loader');
	new Effect.Appear(load, {duration: 0.5});
}
});

}
}

function checkdeparture_r(){
var allinputs= document.getElementsByTagName("input");
if(allinputs!=null){
var envoie="cdeparture_r=";
for(var i = 0; i < allinputs.length;i++){
if(allinputs[i].type=="checkbox"){

if(allinputs[i]==null){
return;
}

if(allinputs[i].checked){

if(allinputs[i].name=="cdeparture_r"){
envoie=envoie.concat(allinputs[i].value+',');
}
}
}
}


new Ajax.Updater('resultat', 'index.php?xhttp=1&form=resultat&type=cdeparture_r&'+envoie,
 {asynchronous:true,  
 onLoading:function(){
  Element.show('ajax_loader');},
 onFailure: function(){
 },
 onComplete:function(){
  load = 'resultat';
	load = document.getElementById(load);
	load.style.display = 'none';
	Element.hide('ajax_loader');
	new Effect.Appear(load, {duration: 0.5});
}
});

}
}

function slide_prix(prix_bas,prix_haut){
		 var handles = [$('handle1'), $('handle2')]; 
     var values = [prix_bas, prix_haut]; // First handle at 0, 2nd at 100 
     var slider = new Control.Slider(handles, 'track1', { 
     range:$R(prix_bas, prix_haut, false), 
     step:1, 
     restricted:true, 
     sliderValue: values, 
				onSlide: function(v) { 
        $('debug1').innerHTML = Math.round(v[0])
        $('debug2').innerHTML = Math.round(v[1])
        },
				onChange: function(v) { 
        $('debug1').innerHTML = Math.round(v[0])
        $('debug2').innerHTML = Math.round(v[1])
        
        search_slide(v[0],v[1]);
        
        }});
}
