
//****************************************************
//*** Tableau niveau depence/force
var g_tbl_depense = f_init_table_depense_force();
 
//****************************************************
var v_Location=new String(document.location);
v_Location=v_Location.split("#", 1)[0];

var v_Bookmark="";
var v_ChampErreur="";

function f_Action(p_Action){
  f_determine_niveau_depense();
  
  switch (parseInt(p_Action)){
    case 0 :
      return;
    break;
    case 1 :
      if (f_ControleSaisie(document.FORM_MULTIUSE)==true){
        document.FORM_MULTIUSE.target="_self"
        // ajout gael : message pop up à destination du moteur de regle
        f_InitMessageForm("FORM_MULTIUSE", "DOM01", "devis", document.FORM_MULTIUSE.URL_MSG.value); 
        // puis on poste comme avant
        //f_InitWait("/DM/Particulier/Asp/V3_CreationDemandeParticulier.asp", "")
        //document.FORM_MULTIUSE.action="/KA/General/Asp/Wait.asp"
      }
      else{
        alert("Le champ " + v_ChampErreur + " est mal renseigné");
        document.location=v_Bookmark;
        return;
      }
    break;
    case 2 :
      if (f_ControleSaisie(document.FORM_MULTIUSE)==true){
        document.FORM_MULTIUSE.target="_self";
        // ajout gael : message pop up à destination du moteur de regle
        f_InitMessageForm("FORM_MULTIUSE", "DOM01", "devis", document.FORM_MULTIUSE.URL_MSG.value); 
        // puis on poste comme avant
        //document.FORM_MULTIUSE.action="/KA/Particulier/Asp/V3_Particulier.asp";
      }
      else{
        alert("Le champ " + v_ChampErreur + " est mal renseigné");
        document.location=v_Bookmark;
        return;
      }
    break;
    case 3 :
      document.FORM_MULTIUSE.target="_self";
      document.FORM_MULTIUSE.action="/DM/Particulier/Asp/V3_BureauParticulier.asp";
      document.FORM_MULTIUSE.submit();
    break;
    }
}

/*****************************************************************************
'*** Validation des niveau de dépence */
function f_determine_niveau_depense(){
  var v_Soin_De_Ville = 0 ; var v_Hospit = 1 ; var v_Optique = 2 ; var v_Dentaire = 3 ; var v_Douce = 4;
  var v_force_Soin   = document.getElementById('NIV_FORCE_1').value ;
  var v_force_Hospit = document.getElementById('NIV_FORCE_2').value ;
  var v_force_Optic  = document.getElementById('NIV_FORCE_3').value ;
  var v_force_Dent   = document.getElementById('NIV_FORCE_4').value ;
  var v_force_Douce   = document.getElementById('NIV_FORCE_5').value ;
  
  
  document.getElementById('besoin-val-1').value = v_force_Soin ;   
  document.getElementById('besoin-val-2').value = v_force_Hospit
  document.getElementById('besoin-val-3').value = v_force_Optic;    
  document.getElementById('besoin-val-4').value = v_force_Dent;    
  document.getElementById('besoin-val-5').value = v_force_Douce;
  
  v_force_Soin = Number(v_force_Soin)-1;
  v_force_Soin = g_tbl_depense[v_Soin_De_Ville][v_force_Soin];
  
  v_force_Hospit = Number(v_force_Hospit)-1;
  v_force_Hospit = g_tbl_depense[v_Hospit][v_force_Hospit];
  
  v_force_Optic = Number(v_force_Optic)-1;
  v_force_Optic = g_tbl_depense[v_Optique][v_force_Optic];
  
  v_force_Dent = Number(v_force_Dent)-1;
  v_force_Dent = g_tbl_depense[v_Dentaire][v_force_Dent];

  v_force_Douce = Number(v_force_Douce)-1;
  v_force_Douce = g_tbl_depense[v_Douce][v_force_Douce];
  
  document.getElementById('NIVEAU_VAL_1').value = v_force_Soin;
  document.getElementById('NIVEAU_VAL_2').value = v_force_Hospit;
  document.getElementById('NIVEAU_VAL_3').value = v_force_Optic;
  document.getElementById('NIVEAU_VAL_4').value = v_force_Dent;
  document.getElementById('NIVEAU_VAL_5').value = v_force_Douce;
}
//***************************************************************************************************************
//*** Fonction initialisant le tableau déterminant le rapport entre les niveaux de dépense et les niveaux de force
function f_init_table_depense_force(){
  var v_tbl_depense = new Array(5);
  var v_Soin_De_Ville = 0 ; var v_Hospit = 1 ; var v_Optique = 2 ; var v_Dentaire = 3 ; var v_Douce = 4;
  for(var i=0; i < v_tbl_depense.length; i++)
  v_tbl_depense [i]= new Array(5);
  //*** v_Soin_De_Ville ***/
  v_tbl_depense[v_Soin_De_Ville][0] = 20//10 //Niveau de Force 1
  v_tbl_depense[v_Soin_De_Ville][1] = 20//10 //Niveau de Force 2
  v_tbl_depense[v_Soin_De_Ville][2] = 20//20 //Niveau de Force 3
  v_tbl_depense[v_Soin_De_Ville][3] = 20//30 //Niveau de Force 4
  v_tbl_depense[v_Soin_De_Ville][4] = 20//30 //Niveau de Force 5
  //*** v_Hospit ***/
  v_tbl_depense[v_Hospit][0] = 20//10 //Niveau de Force 1
  v_tbl_depense[v_Hospit][1] = 20//10 //Niveau de Force 2
  v_tbl_depense[v_Hospit][2] = 20//20 //Niveau de Force 3
  v_tbl_depense[v_Hospit][3] = 20//30 //Niveau de Force 4
  v_tbl_depense[v_Hospit][4] = 20//30 //Niveau de Force 5
  //*** v_Optique ***/
  v_tbl_depense[v_Optique][0] = 10//10 //Niveau de Force 1
  v_tbl_depense[v_Optique][1] = 10//20 //Niveau de Force 2
  v_tbl_depense[v_Optique][2] = 10//20 //Niveau de Force 3
  v_tbl_depense[v_Optique][3] = 10//30 //Niveau de Force 4
  v_tbl_depense[v_Optique][4] = 10//30 //Niveau de Force 5
  //*** v_Dentaire ***/
  v_tbl_depense[v_Dentaire][0] = 10//10 //Niveau de Force 1
  v_tbl_depense[v_Dentaire][1] = 10//10 //Niveau de Force 2
  v_tbl_depense[v_Dentaire][2] = 10//20 //Niveau de Force 3
  v_tbl_depense[v_Dentaire][3] = 10//30 //Niveau de Force 4
  v_tbl_depense[v_Dentaire][4] = 10//30 //Niveau de Force 5
  //*** v_Douce ***/
  v_tbl_depense[v_Douce][0] = 10//10 //Niveau de Force 1
  v_tbl_depense[v_Douce][1] = 10//10 //Niveau de Force 2
  v_tbl_depense[v_Douce][2] = 10//20 //Niveau de Force 3
  v_tbl_depense[v_Douce][3] = 10//30 //Niveau de Force 4
  v_tbl_depense[v_Douce][4] = 10//30 //Niveau de Force 5
  return v_tbl_depense;
}

/*******************************************************************************
/*** Gestion du conjoint **/
  var v_desact = false;
  function f_selectionConjoint(){  
      document.FORM_MULTIUSE.SAN_SEXE_2[0].checked=false; 
      document.FORM_MULTIUSE.SAN_SEXE_2[1].checked=false; 
      /*document.FORM_MULTIUSE.SAN_DATE_NAISSANCE_JOUR_2.selectedIndex=0;
      document.FORM_MULTIUSE.SAN_DATE_NAISSANCE_MOIS_2.selectedIndex=0;*/
      document.FORM_MULTIUSE.SAN_DATE_NAISSANCE_AN_2.selectedIndex=0;
      document.FORM_MULTIUSE.SIT_CODE_2.selectedIndex=0;
      document.FORM_MULTIUSE.RGM_CODE_2.selectedIndex=0;        
      f_desactivConjoint(true);
  }
  function f_desactivConjoint(f_bool){
      document.FORM_MULTIUSE.SAN_SEXE_2[0].disabled=f_bool;
      document.FORM_MULTIUSE.SAN_SEXE_2[1].disabled=f_bool;
      /*document.FORM_MULTIUSE.SAN_DATE_NAISSANCE_JOUR_2.disabled=f_bool;
      document.FORM_MULTIUSE.SAN_DATE_NAISSANCE_JOUR_2.disabled=f_bool;
      document.FORM_MULTIUSE.SAN_DATE_NAISSANCE_MOIS_2.disabled=f_bool;
      document.FORM_MULTIUSE.SAN_DATE_NAISSANCE_AN_2.disabled=f_bool;*/
      document.FORM_MULTIUSE.jour2.disabled=f_bool;
      document.FORM_MULTIUSE.mois2.disabled=f_bool;
      document.FORM_MULTIUSE.annee2.disabled=f_bool;
      document.FORM_MULTIUSE.SIT_CODE_2.disabled=f_bool;
      document.FORM_MULTIUSE.RGM_CODE_2.disabled=f_bool;
  }
  
/*******************************************************************************
/*** Controle des saisies de l'internaute */
function f_ControleSaisie(p_Form){
  var v_Date_An_i;
  var v_Date_Mois_i;
  var v_Date_Jour_i;
  var v_Date_i;
  var v_Return = true
  v_Bookmark=""
  
  /*Demandeur*/
  if ((p_Form.SAN_SEXE_1[0].checked==false)&&(p_Form.SAN_SEXE_1[1].checked==false)){  
    v_ChampErreur="Sexe du demandeur"
    v_Bookmark=v_Location + "#SAN_SEXE"
    return(v_Return)
  }
  
  var v_Date_Naissance_An_1=p_Form.SAN_DATE_NAISSANCE_AN_1.value
  var v_Date_Naissance_Mois_1=p_Form.SAN_DATE_NAISSANCE_MOIS_1.value
  var v_Date_Naissance_Jour_1=p_Form.SAN_DATE_NAISSANCE_JOUR_1.value
  var v_Date_Naissance_1=v_Date_Naissance_An_1.concat(v_Date_Naissance_Mois_1).concat(v_Date_Naissance_Jour_1)
  v_Return=f_CheckAll(v_Date_Naissance_1, "date")
  if (v_Return==false){
    v_Bookmark=v_Location + "#SAN_DATE_NAISSANCE"
    v_ChampErreur="Date de naissance demandeur"
    return(v_Return)
  }

  v_Return=f_CheckAll(p_Form.SIT_CODE_1.value, "varchar")
  if (v_Return==false){
    v_Bookmark=v_Location + "#SIT_CODE"
    v_ChampErreur="Activité demandeur"
    return(v_Return)
  }

  if(p_Form.RGM_CODE_1.value=="" || p_Form.RGM_CODE_1.value=="RGM00"){
    v_Return=false
    if (v_Return==false){
      v_Bookmark=v_Location + "#RGM_CODE"
      v_ChampErreur="Régime demandeur"
      return(v_Return)
    }
  }

  //Régime CFE (Expatriés)
  if((p_Form.RGM_CODE_1.value=="RGM05") && (p_Form.DPT_CODE_1.value!="995" && p_Form.DPT_CODE_1.value!="996" && p_Form.DPT_CODE_1.value!="997" && p_Form.DPT_CODE_1.value!="998") ){
    v_Return=false
    if (v_Return==false){
      v_Bookmark=v_Location + "#RGM_CODE"
      v_ChampErreur="Régime demandeur (Avec le régime CFE, vous devez choisir le département expatriés)"
      return(v_Return)
    }
  }
  
  //Régime Hors sécu (Expatriés ou Etrangers en France)
  if((p_Form.RGM_CODE_1.value=="RGM06") && (p_Form.DPT_CODE_1.value!="995" && p_Form.DPT_CODE_1.value!="996" && p_Form.DPT_CODE_1.value!="997" && p_Form.DPT_CODE_1.value!="998" && p_Form.DPT_CODE_1.value!="999") ){
    v_Return=false
    if (v_Return==false){
      v_Bookmark=v_Location + "#RGM_CODE"
      v_ChampErreur="Régime demandeur (Avec le régime Hors sécu, vous devez choisir le département expatriés ou étranger en France)"
      return(v_Return)
    }
  }
  /*FIN Demandeur*/
  
  /*Conjoint*/
  var is_conjoint = false;
  //*** ON DETERMINE SI UNE INFORMATION SUR LE CONJOINT A ETE SAISIE ***//
    if  ( (p_Form.SAN_SEXE_2[1].checked==true)||
          (p_Form.SAN_SEXE_2[0].checked==true)||
          (p_Form.SAN_DATE_NAISSANCE_JOUR_2.selectedIndex!=0)||
          (p_Form.SAN_DATE_NAISSANCE_MOIS_2.selectedIndex!=0)||
          (p_Form.SAN_DATE_NAISSANCE_AN_2.selectedIndex!=0)||
          (p_Form.SIT_CODE_2.selectedIndex!=0)||
          (p_Form.RGM_CODE_2.selectedIndex!=0)
         ){
         //*** on détermine qu'un conjoint à été définit ***'
         is_conjoint = true;
    }
   
   //*** SI LA CASE "DEFINIR LE CONJOINT" EST COCHÉ, ON ÉFFECTUE LES CONTROLES ADÉQUATS ***//
   if(is_conjoint){ 

        if ((p_Form.SAN_SEXE_2[0].checked==false)&&(p_Form.SAN_SEXE_2[1].checked==false)){  
          v_ChampErreur="Sexe du conjoint"
          v_Bookmark=v_Location + "#SAN_SEXE"
          return  false;
        }
        var v_Date_Naissance_An_2=p_Form.SAN_DATE_NAISSANCE_AN_2.value
        var v_Date_Naissance_Mois_2=p_Form.SAN_DATE_NAISSANCE_MOIS_2.value
        var v_Date_Naissance_Jour_2=p_Form.SAN_DATE_NAISSANCE_JOUR_2.value
        var v_Date_Naissance_2=v_Date_Naissance_An_2.concat(v_Date_Naissance_Mois_2).concat(v_Date_Naissance_Jour_2)

        v_Return=f_CheckAll(v_Date_Naissance_2, "date")
        if (v_Return==false){
          v_Bookmark=v_Location + "#SAN_DATE_NAISSANCE"
          v_ChampErreur="Date de naissance conjoint"
          return(v_Return)
        }

        v_Return=f_CheckAll(p_Form.SIT_CODE_2.value, "varchar")
        if (v_Return==false){
          v_Bookmark=v_Location + "#SIT_CODE"
          v_ChampErreur="Activité du conjoint"
          return (v_Return)
        }
      
        if(p_Form.RGM_CODE_2.value=="" || p_Form.RGM_CODE_2.value=="RGM00"){
          v_Return=false
          if (v_Return==false){
            v_Bookmark=v_Location + "#RGM_CODE"
            v_ChampErreur="Régime conjoint"
            return(v_Return)
          }
        }
        
        if(p_Form.RGM_CODE_1.value=="RGM05" || p_Form.RGM_CODE_1.value=="RGM06"){
          if(p_Form.RGM_CODE_1.value!=p_Form.RGM_CODE_2.value){
            v_Return=false
            if (v_Return==false){
              v_Bookmark=v_Location + "#RGM_CODE"
              v_ChampErreur="Régime conjoint (Pour les régimes CFE et Hors sécu, les régimes demandeur principal et conjoint doivent être identiques)"
              return(v_Return)
            }
          }
        }
  }
  else{
    p_Form.assur_conjoint[0].checked=false;
    p_Form.assur_conjoint[1].checked=true;
  }
  /*FIN Conjoint*/
  
  /*Caractéristiques du contrat*/
  v_Return=f_CheckAll(p_Form.DPT_CODE_1.value, "varchar")
  if (v_Return==false){
    v_Bookmark=v_Location + "#DPT_CODE"
    v_ChampErreur="Département"
    return(v_Return)
  }
  
  v_Return=f_CheckAll(p_Form.SAN_NOMBRE_ENFANTS.value, "integer")
  if (v_Return==false){
    p_Form.SAN_NOMBRE_ENFANTS.value=0
    v_ChampErreur="Nombre d'enfants"
    v_Return=true
  }

  /* Date de naissance des enfants obligatoires */
  var p_Enfants = parseInt(document.FORM_MULTIUSE.SAN_NOMBRE_ENFANTS.value);
  for (var i = 1; i <= p_Enfants; i++) {
      v_Date_An_i = p_Form["ENFANT_DATENAISS_AN_" + i].value;
      v_Date_Mois_i = p_Form["ENFANT_DATENAISS_MOIS_" + i].value;
      v_Date_Jour_i = p_Form["ENFANT_DATENAISS_JOUR_" + i].value;
      v_Date_i = v_Date_An_i.concat(v_Date_Mois_i).concat(v_Date_Jour_i);
      v_Return = f_CheckAll(v_Date_i, "date");
      if (v_Return == false) {
          v_Bookmark = v_Location + "#DPT_CODE";
          v_ChampErreur = "Le champ Date de naissance enfant " + i;
          return (v_Return);
      }
  }
  /* FIN Enfants */
	
  var v_Date_Contrat_An_1 = p_Form.SAN_DATE_CONTRAT_SOUHAITE_AN_1.value
  var v_Date_Contrat_Mois_1=p_Form.SAN_DATE_CONTRAT_SOUHAITE_MOIS_1.value
  var v_Date_Contrat_Jour_1=p_Form.SAN_DATE_CONTRAT_SOUHAITE_JOUR_1.value
  var v_Date_Contrat=v_Date_Contrat_An_1.concat(v_Date_Contrat_Mois_1).concat(v_Date_Contrat_Jour_1)
  v_Return=f_CheckAll(v_Date_Contrat, "date")
  if (v_Return==false){
    v_Bookmark=v_Location + "#SAN_DATE_CONTRAT_SOUHAITE"
    v_ChampErreur="Date de début de contrat souhaitée"
    return(v_Return)
  }
  if(Number(v_datedujour) > Number(v_Date_Contrat)){
    v_Bookmark=v_Location + "#SAN_DATE_CONTRAT_SOUHAITE"
    v_ChampErreur="Date de début de contrat qui doit être supérieure à la date du jour"
    return false;
  }
  /*FIN Caractéristiques du contrat*/

  return(v_Return)
}


/**********************************************************************************************/
/**********************************************************************************************/
/*Classe contenant le montant par grand risque et par niveau*/
  function c_CotisationGrandRisque(p_Gri_Id, p_Gri_Niveau, p_Montant){
    this.Gri_Id=p_Gri_Id
    this.Gri_Niveau=p_Gri_Niveau
    this.Montant=p_Montant
  }
  
/*Tableau des montants par grand risque et par niveau*/
  var t_CotisationGrandRisque=new Array()

/*Recherche du montant du grand risque et du niveau*/
  function f_CotisationGrandRisque(p_Gri_Id, p_Gri_Niveau, p_t_CotisationGrandRisque){
    for (i=0;i<p_t_CotisationGrandRisque.length;i++){
      if (p_t_CotisationGrandRisque[i].Gri_Id==p_Gri_Id && p_t_CotisationGrandRisque[i].Gri_Niveau==p_Gri_Niveau){
        return(p_t_CotisationGrandRisque[i].Montant);
      }
    }
    return(0);
  }
    
/**********************************************************************************************/
/**********************************************************************************************/
/*Classe contenant le coefficient par département*/
  function c_CoefficientDepartement(p_Dpt_Code, p_Coefficient){
    this.Dpt_Code=p_Dpt_Code
    this.Coefficient=p_Coefficient
  }

/*Tableau des coefficients par département*/
  var t_CoefficientDepartement=new Array()

/*Recherche du coefficient du département*/
  function f_CoefficientDepartement(p_Dpt_Code, p_t_CoefficientDepartement){
    for (i=0;i<p_t_CoefficientDepartement.length;i++){
      if (p_t_CoefficientDepartement[i].Dpt_Code==p_Dpt_Code){
        return(p_t_CoefficientDepartement[i].Coefficient);
      }
    }
    return(0);
  }


/**********************************************************************************************/
/**********************************************************************************************/
/*Classe contenant les coefficients par âge*/
  function c_CoefficientAge(p_Age_Mini, p_Age_Maxi, p_Type_Age, p_Coefficient){
    this.Age_Mini=p_Age_Mini
    this.Age_Maxi=p_Age_Maxi
    this.Type_Age=p_Type_Age
    this.Coefficient=p_Coefficient
  }

/*Tableau des coefficients par âge*/
  var t_CoefficientAge=new Array()

/*Recherche du coefficient de la tranche d'âge*/
  function f_CoefficientAge(p_Age, p_t_CoefficientAge){
    for (i=0;i<p_t_CoefficientAge.length-1;i++){
      if (p_t_CoefficientAge[i].Type_Age==1 && p_t_CoefficientAge[i].Age_Mini<=p_Age && p_t_CoefficientAge[i].Age_Maxi>=p_Age){
        //alert("pas dernière " + p_t_CoefficientAge[i].Coefficient);
        return(p_t_CoefficientAge[i].Coefficient);
      }
    }
    
    //Dernière tranche d'âge
    if (p_t_CoefficientAge[p_t_CoefficientAge.length-1].Age_Mini<=p_Age){
        //alert("dernière " + p_t_CoefficientAge[p_t_CoefficientAge.length-1].Coefficient);
      return(p_t_CoefficientAge[p_t_CoefficientAge.length-1].Coefficient)
    }
    return(0);
  }

/*Recherche du coefficient enfant*/
  function f_CoefficientEnfant(p_Nombre_Enfants, p_t_CoefficientAge){
    if (p_Nombre_Enfants!=0){
      for (i=0;i<p_t_CoefficientAge.length-1;i++){
        if (p_t_CoefficientAge[i].Type_Age==0){
          return(p_Nombre_Enfants*p_t_CoefficientAge[i].Coefficient);
        }
      }
    }
    return(0);
  }

/**********************************************************************************************/
/**********************************************************************************************/
/*Calcul du coefficient total*/
  function f_CoefficientTotal(p_Age_Demandeur, p_Age_Conjoint, p_Nombre_Enfants, p_Dpt_Code){
    var v_CoefficientTotal=0
    v_CoefficientTotal=v_CoefficientTotal+f_CoefficientAge(p_Age_Demandeur,t_CoefficientAge)
    v_CoefficientTotal=v_CoefficientTotal+f_CoefficientAge(p_Age_Conjoint,t_CoefficientAge)
    v_CoefficientTotal=v_CoefficientTotal+f_CoefficientEnfant(p_Nombre_Enfants,t_CoefficientAge)
    v_CoefficientTotal=v_CoefficientTotal*f_CoefficientDepartement(p_Dpt_Code,t_CoefficientDepartement)
    //Chaque coefficient est multiplié par 100
    return(v_CoefficientTotal/10000);
  }


/*Total des cotisations grand risque*/
  var v_Total_Cotisation_Grand_Risque=0


/*Mise à jour des variables contenant les niveaux*/
  function f_RefreshEstimationCotisation(p_Gri_Id, p_Gri_Niveau){
    var v_Chaine=""

    //Soustraction de l'ancienne cotisation grand risque du montant total des cotisations grand risque
    v_Total_Cotisation_Grand_Risque=v_Total_Cotisation_Grand_Risque-eval("v_COEFFICIENT_"+p_Gri_Id)
    
    v_Chaine="v_COEFFICIENT_"+p_Gri_Id+"=f_CotisationGrandRisque("+p_Gri_Id+","+p_Gri_Niveau+",t_CotisationGrandRisque)"
    eval(v_Chaine)
    
    //Ajout de la nouvelle cotisation au montant total des cotisations grand risque
    v_Total_Cotisation_Grand_Risque=v_Total_Cotisation_Grand_Risque+eval("v_COEFFICIENT_"+p_Gri_Id)

    f_EstimationCotisation(v_Total_Cotisation_Grand_Risque)
  }

/*Calcul de la cotisation estimée*/
  function f_EstimationCotisation(p_Total_Cotisation_Grand_Risque){
    var v_Age_Demandeur=0
    var v_Age_Conjoint=0
    var v_Nombre_Enfants=0
    var v_Dpt_Code=''
    
    var v_CoefficientTotal=0

    //Age du demandeur
    if(isNaN(document.FORM_MULTIUSE.SAN_DATE_NAISSANCE_AN_1.value)==false){
      v_Age_Demandeur=parseInt(v_Annee_En_Cours)-parseInt(document.FORM_MULTIUSE.SAN_DATE_NAISSANCE_AN_1.value)
    }

    //Age du conjoint
    if(isNaN(document.FORM_MULTIUSE.SAN_DATE_NAISSANCE_AN_2.value)==false){
      v_Age_Conjoint=parseInt(v_Annee_En_Cours)-parseInt(document.FORM_MULTIUSE.SAN_DATE_NAISSANCE_AN_2.value)
    }

    //Nombre d'enfants
    if(isNaN(document.FORM_MULTIUSE.SAN_NOMBRE_ENFANTS.value)==false){
      v_Nombre_Enfants=parseInt(document.FORM_MULTIUSE.SAN_NOMBRE_ENFANTS.value)
    }

    //Département de la demande
    v_Dpt_Code=document.FORM_MULTIUSE.DPT_CODE_1.value

    //Coefficient total
    v_CoefficientTotal=f_CoefficientTotal(v_Age_Demandeur,v_Age_Conjoint,v_Nombre_Enfants,v_Dpt_Code)
    
    /*Mise à jour du total des cotisations grand risque*/
    var v_EstimationCotisation=p_Total_Cotisation_Grand_Risque/100*v_CoefficientTotal
    
    if(document.FORM_MULTIUSE.COTISATION_ESTIMEE){
      document.FORM_MULTIUSE.COTISATION_ESTIMEE.value="" + parseInt(v_EstimationCotisation) + ""
    }
//alert("Estimation Cotisation = "+parseInt(v_EstimationCotisation));
    return(parseInt(v_EstimationCotisation));
  }
  

// Mise en évidence des garanties sélectionnées
function f_sliderSurvol(slider, niveau){
   var valueSlide = slider+niveau;

   f_sliderEnvol(slider);
   document.getElementById(valueSlide).style.fontSize = '10pt';
   document.getElementById(valueSlide).style.fontWeight = 'bold';
   document.getElementById(valueSlide).style.color = '#2363AA'; // bleu
   /*document.getElementById(valueSlide).style.color = '#FB7F01'; // orange */
}

// Affichage standart des garanties (police)
function f_sliderEnvol(slider){
   
   for (i=1; i<=6; i++) {
     document.getElementById(slider+i).style.fontSize = '8pt';
     document.getElementById(slider+i).style.fontWeight = 'normal';
     document.getElementById(slider+i).style.color = '#666666';
   }

}

