//valo de la liste des continents
function void_valo_lst_continents() {
	
  var olstcontinent = document.frmrecherche.continent;	
	
	//et paf...
  new_option = new Option(tab_continents["EUROPECEE"][1],tab_continents["EUROPECEE"][0]);
	olstcontinent.options[olstcontinent.length]= new_option ;
	
  new_option = new Option(tab_continents["EUROPEHORSCEE"][1],tab_continents["EUROPEHORSCEE"][0]);
	olstcontinent.options[olstcontinent.length]= new_option ;
	
  new_option = new Option(tab_continents["AFRIQUEDUNORD"][1],tab_continents["AFRIQUEDUNORD"][0]);
	olstcontinent.options[olstcontinent.length]= new_option ;
	
  new_option = new Option(tab_continents["AFRIQUEZONEFRANC"][1],tab_continents["AFRIQUEZONEFRANC"][0]);
	olstcontinent.options[olstcontinent.length]= new_option ;
	
  new_option = new Option(tab_continents["AFRIQUEAUTRE"][1],tab_continents["AFRIQUEAUTRE"][0]);
	olstcontinent.options[olstcontinent.length]= new_option ;
	
  new_option = new Option(tab_continents["PROCHEETMOYENORIENT"][1],tab_continents["PROCHEETMOYENORIENT"][0]);
	olstcontinent.options[olstcontinent.length]= new_option ;
	
  new_option = new Option(tab_continents["ANTILLES"][1],tab_continents["ANTILLES"][0]);
	olstcontinent.options[olstcontinent.length]= new_option ;
	
	new_option = new Option(tab_continents["OECEANINDIENDJIBOUTI"][1],tab_continents["OECEANINDIENDJIBOUTI"][0]);
	olstcontinent.options[olstcontinent.length]= new_option ;
	
	new_option = new Option(tab_continents["AMERIQUEDUNORD"][1],tab_continents["AMERIQUEDUNORD"][0]);
	olstcontinent.options[olstcontinent.length]= new_option ;
	
	new_option = new Option(tab_continents["AMERIQUECENTRALE"][1],tab_continents["AMERIQUECENTRALE"][0]);
	olstcontinent.options[olstcontinent.length]= new_option ;
	
	new_option = new Option(tab_continents["AMERIQUEDUSUD"][1],tab_continents["AMERIQUEDUSUD"][0]);
	olstcontinent.options[olstcontinent.length]= new_option ;
	
	new_option = new Option(tab_continents["ASIE"][1],tab_continents["ASIE"][0]);
	olstcontinent.options[olstcontinent.length]= new_option ;
	
	new_option = new Option(tab_continents["AUSTRALIE"][1],tab_continents["AUSTRALIE"][0]);
	olstcontinent.options[olstcontinent.length]= new_option ;
	
	new_option = new Option(tab_continents["PACIFIQUE"][1],tab_continents["PACIFIQUE"][0]);
olstcontinent.options[olstcontinent.length]= new_option ;

olstcontinent.sort();
}	

//valo de la liste des pays pour annuiare TT
function void_valo_lst_pays_TT() {

  	var olstpays = document.frmrecherche.zonedecouverture;
  	void_raz(olstpays);
  	
  	for (i=0; i<tab_pays.length; i++){
  	  var tab_temp = tab_pays[i];
  	  new_option = new Option(tab_temp[1],tab_temp[0]);
  		olstpays.options[olstpays.length]= new_option ;
  	}

  }	

//valo de la liste des pays pour BI
function void_valo_lst_pays(choix) {
	
	var tab_pays_continent = tab_continents[choix][2];	
	var olstpays = document.frmrecherche.pays;
	
	void_raz(olstpays);
	
	for (i=0; i<tab_pays_continent.length; i++){
	  var tab_temp = tab_pays_continent[i];
	  new_option = new Option(tab_temp[1],tab_temp[0]);
		olstpays.options[olstpays.length]= new_option ;
	}

}	


//valo de la liste des regions de france
function void_valo_lst_regionfrance() {
	
	var olstregions = document.frmrecherche.regions;
	
	for (i=0; i<tab_region_france.length; i++){
	  var tab_temp_region = tab_region_france[i];
		new_option = new Option(tab_temp_region[1],tab_temp_region[0]); 
		olstregions.options[olstregions.length]= new_option ;
	}
}



//vidage dune liste
function void_raz(p_liste){
  l=p_liste.length; 
  for (i=l; i>0; i--){ 
   p_liste.options[i]=null;
  }
}    


//affichage div step
function void_afficher_step(p_iddiv){
   document.getElementById(p_iddiv).style.display = "block";	
}

//masquage div step
function void_masquer_step(p_iddiv){
   document.getElementById(p_iddiv).style.display = "none";	
}

//passage d'une div a l'autre 
function void_step_to_step(p_actual,p_other){
	void_masquer_step(p_actual);
  	void_afficher_step(p_other);
}



// --- ETAPE 1
function void_stepone(){
 if(!document.frmrecherche.rad_dis[0].checked && !document.frmrecherche.rad_dis[1].checked){
 	alert('Vous devez  sélectionner une des deux options proposées');
 }else{
  //distibuteur
  if(document.frmrecherche.rad_dis[0].checked){
  	//redirection
  }	
  //entreprise
  if(document.frmrecherche.rad_dis[1].checked){
  	void_step_to_step('div_stepone','div_steptwo');
  } 		
 }
}


// --- ETAPE 2
function void_steptwo(){
	void_step_to_step('div_steptwo','div_stepthree');
}


// --- ETAPE 3
function void_stepthree(p_continent){
    if(document.frmrecherche.rad_dis1[0].checked){
        document.frmrecherche.rad_dis2[0].checked = true;
    }
    if(document.frmrecherche.rad_dis1[1].checked){
        document.frmrecherche.rad_dis2[1].checked = true;
    }
		if(p_continent!='-1'){
		 //valo liste des pays
		 void_valo_lst_pays(p_continent);	
		 void_step_to_step('div_stepthree','div_stepfour');
		}
}


// --- ETAPE 4
function void_stepfour(p_pays){
    if(document.frmrecherche.rad_dis2[0].checked){
        document.frmrecherche.rad_dis3[0].checked = true;
    }
    if(document.frmrecherche.rad_dis2[1].checked){
        document.frmrecherche.rad_dis3[1].checked = true;
    }
    if(p_pays!='-1'){
       if(p_pays=='FRANCE'){
           	void_valo_lst_regionfrance();
            void_step_to_step('div_stepfour','div_stepfive');
       }else{
             if(!document.frmrecherche.rad_dis2[0].checked && !document.frmrecherche.rad_dis2[1].checked){
              	alert('Vous devez  sélectionner une des deux options proposées');
              }else{
			           	 void_raz(document.frmrecherche.regions);
			           	 void_submitform();		
              }
       }
    }
}

//--- ETAPE 4 Bis TT
function void_stepfourBis(p_pays){
	if(p_pays!='-1'){
	  void_submitform();
	}
}


// --- ETAPE 5
function void_stepfive(p_region){
    if(!document.frmrecherche.rad_dis3[0].checked && !document.frmrecherche.rad_dis3[1].checked){
       	alert('Vous devez  sélectionner une des deux options proposées');
       }else{
						if(p_region!='-1'){
						 void_submitform();	
						}
       }
}


// --- SUBMIT
function void_submitform(){
	document.frmrecherche.recherche.value=true;
	document.frmrecherche.submit();
}

// Test quel bouton radio est checke
function testerRadio(radio) {
   for (var i=0; i<radio.length;i++) {
      if (radio[i].checked) {
         document.forms.step1=radio[i].value;
      }
   }
}
