// pour les pages detail-xxx , changes Villes & dates




var TABDATES = new Array();

function Change_DIV_Codes_tarifs( Type ) 
{
  if(Type == true)
    document.getElementById('DIV_CODES_T').innerHTML = document.getElementById('DIV_DATE').innerHTML;
  else
    document.getElementById('DIV_CODES_T').innerHTML = document.getElementById('DIV_VILLE').innerHTML;
}

function verif_formulaire_Stages_Sportifs() 
{
  return true;
}


function COMMANDE_SELECT_CHOIX_ONCLICK( Sel , Sel_Id )
{
  var i,Opt,Opt_New,Class;
  for( i=0 ; i<Sel.options.length ; i++ )
  {
    if(Sel.options[i].selected == true)
    {
      Opt = Sel.options[i];
      i = Sel.options.length;
    }
  }
  
  if(Opt)
  {
    Sel_Id = 'Label_SELECT_ENFANT_EXISTANTS';
    if(Sel.title == '1')
      Sel_Id = 'Label_SELECT_ENFANT_EXISTANTS__OK';
    
    document.getElementById(Sel_Id).appendChild(Opt);
    Opt.selected = false;
    
  }
}

// Catalogues 


function verif(page)
  {
    switch (page)
    {
    case 1:
    //verification du nom et prenom
    if(document.coordonees.nom.value =='')
            {
              alert('Le champ nom est vide !');
              document.coordonees.nom.focus();
                    document.coordonees.nom.style.background = "white url(images/FondCalendar.gif) repeat scroll center top;";
             return false ;
            }
            
    if(document.coordonees.prenom.value =='')
            {
              alert('Le champ prenom est vide ! ');
              document.coordonees.prenom.focus();
              document.coordonees.prenom.style.background = "white url(images/FondCalendar.gif) repeat scroll center top;";
             return false ;
            }        
            
    if(document.coordonees.email.value =='')
            {
              alert('Le champ email est vide ! ');
              document.coordonees.email.focus();
              document.coordonees.email.style.background = "white url(images/FondCalendar.gif) repeat scroll center top;";
             return false ;
            }         
    if(document.coordonees.email2.value =='')
            {
              alert('Le champ de confirmation de l email est vide ! ');
              document.coordonees.email2.focus();
              document.coordonees.email2.style.background = "white url(images/FondCalendar.gif) repeat scroll center top;";
             return false ;
            }   
            
            
  if(!VerifMail(document.coordonees.email) )
                    {
              alert('L\"email est incorrect  !');
              document.coordonees.email.focus();
              document.coordonees.email.style.background = "white url(images/FondCalendar.gif) repeat scroll center top;";
             return false ;
                       
                       
                    }
                    
    
        
              //verification des champs email   
                if(document.coordonees.email.value == document.coordonees.email2.value)
                    {
                       document.coordonees.submit();
                       
                    }
                    else
                    {
                    
                    
                    
                    alert ("Le champ de confirmation de l'Email est different du champ Email !");
                    document.coordonees.email2.focus();
                     document.coordonees.email2.style.background = "white url(images/FondCalendar.gif) repeat scroll center top;";
            
              
                return false;
                    }
                       
            
    
  
    break;
    
    
//page pour le choix de la ville     
    case 2:   
    
    if(document.ville.choixville.value=='')
      {
      alert('Vous devez selectionner une ville de depart !');
      return false;
      
      }
    document.ville.submit();
    break;
    
//page pour le choix de la periode de depart    
    case 3:
 //control=true;
    tab=new Array();
    tab2=new Array();

      var date_sejour_debut=document.getElementById('Label_Date_mini');
      var  date_sejour_fin=document.getElementById('Label_Date_maxi');
       
      tab=date_valide_cata(date_sejour_debut.value);
     
              if(!tab)
              {
              alert('La date minimum est inferieur a la date du jour ou le format est incorrect .Reessayer avec le format suivant jj/mm/aaaa !');
              return false;
              
              }   
      
      tab2=date_valide_cata(date_sejour_fin.value);            
             if(!tab2)
              {
              alert('La date maximum est inferieur a la date du jour ou le format est incorrect .Reessayer avec le format suivant jj/mm/aaaa !');
              return false;
              
              } 
              
              
              
    
 tab= date_sejour_debut.value.split("/"); 
 tab2=date_sejour_fin.value.split("/"); 
//verification que la date max et superieur a la date minimum
       
if(tab.length==3 && tab2.length==3)
{
  if((tab[0]>tab2[0] && tab[1]==tab2[1] && tab[2]==tab2[2]) || (tab[2]==tab2[2] && tab[1]>tab2[1]) || (tab[2]>tab2[2]))
    {
      alert('La date maximum ne doit pas etre inferieur a la date minimum !');
        date_sejour_fin.value='';
    }
    else
    {
    
     document.date.submit();
     
    }
} 
  
    
   
    
    break;
    case 4:

    document.acti.submit();
    break;
    case 5:
      window.location.href='catalogue_perso_enregistrement.php?etape=5'
    
    break ;
    
    }
  
  
 }

    
  
 //fonction de verification de mail avec une expresssion reguliere 
  function VerifMail(mail) {     
    exp = new RegExp("^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]{2,}[.][a-zA-Z]{2,4}$","gi");
	
    if (mail.value.match(exp)) {
		return true;
    } else {
		return false;
    }
  }
    
    
    
    
 //fonction de verification des champs dates
 
 

 
 function Verif_recommander()
  {
      var valid=true;
      
      if(document.form_recommander.nom.value == '')
      {
        document.form_recommander.nom.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;"; 
        document.form_recommander.nom.focus();       
        alert("Le champ 'nom' doit etre rempli !");
        valid=false;
        return false;
      }
      
      
      if(document.form_recommander.prenom.value == '')
      {
        document.form_recommander.prenom.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;"; 
        document.form_recommander.prenom.focus();      
        alert("Le champ 'prenom' doit etre rempli !");
        valid=false;
        return false;
      }
      
      
      
      if(!VerifMail(document.form_recommander.email))
      {
        document.form_recommander.email.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
        document.form_recommander.email.focus();       
        alert("Votre email est invalide");
        valid=false;
        return false;
      }
       
      if(document.form_recommander.email.value != document.form_recommander.email2.value)
      {
        document.form_recommander.email.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
        document.form_recommander.email2.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";  
        alert("Le champ qui comporte votre email et sa confirmation sont differents");
        valid=false;
        return false;
      }
      
      
            
      if(document.form_recommander.nom_participant.value == '')
      {
        document.form_recommander.nom_participant.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;"; 
        document.form_recommander.nom_participant.focus();      
        alert("Le champ 'nom ami(e)' doit etre rempli !");
        valid=false;
        return false;
      }
      
      
      if(document.form_recommander.prenom_participant.value == '')
      {
        document.form_recommander.prenom_participant.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;"; 
        document.form_recommander.prenom_participant.focus();      
        alert("Le champ 'prenom ami(e)' doit etre rempli !");
        valid=false;
        return false;
      }
      
            
      
      if(!VerifMail(document.form_recommander.email_participant))
      {
        document.form_recommander.email_participant.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
        document.form_recommander.email_participant.focus();       
        alert("L'email de votre ami(e) est invalide");
        valid=false;
        return false;
      }
       
      if(document.form_recommander.email_participant.value != document.form_recommander.email2_participant.value)
      {
        document.form_recommander.email_participant.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
        document.form_recommander.email2_participant.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";  
        alert("Le champ qui comporte l'email de votre ami(e) et sa confirmation sont differents");
        valid=false;
        return false;
      }
      
      
      
      
      
      if(document.form_recommander.email_participant.value == document.form_recommander.email.value)
      {
        document.form_recommander.email.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
        document.form_recommander.email_participant.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
        document.form_recommander.email2.value = "";
        document.form_recommander.email2_participant.value = "";
        
        document.form_recommander.email.focus();       
        alert("L'email de votre ami(e) et votre email sont identiques !");
        valid=false;
        return false;
      }
      
      
      
      if(document.form_recommander.cap.value == '')
      {
        document.form_recommander.cap.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";  
        document.form_recommander.cap.focus();   
        alert("Le champ de verification est vide ! Entrez les 3 chiffres figurant de l'image");
        valid=false;
        return false;
      }
      
      if(document.form_recommander.cap.value.length != 3)
      {
        document.form_recommander.cap.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";  
        document.form_recommander.cap.focus();   
        alert("Le champ de verification doit comporter 3 chiffres !");
        valid=false;
        return false;
      }
      
      if( !IsNumeric(document.form_recommander.cap.value) ) 
      {
        document.form_recommander.cap.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";  
        document.form_recommander.cap.focus();   
        alert("Le champ de verification doit comporter 3 chiffres !");
        valid=false;
        return false;
      }
      
      if(valid == true && confirm("Confirmez-vous l'envoi du mail vers " + document.form_recommander.email_participant.value + " ?"))
      {
        document.form_recommander.submit();
      }
      
  }





  


function verif_Date(datett)
    {
       
     tableau=datett.value.split("/"); 
     if (tableau.length==3)
      {
     annee=tableau[2].length;
//// test de la longueur des caracteres et si se sont bien des chiffres
        
                if(/*(VerifIntMinMax(tableau[0],0,2)) 
                     &&*/ (VerifIntMinMax(tableau[1],2,2)) 
                     && (VerifIntMinMax(tableau[2],4,4) )
                   )
                      {
                      
// verificaton de la date valide
// test du mois

                  type=tableau[1]/2;
                      if(parseInt(type)==parseFloat(type))
                    {
                    var Njour=30;                    
                    }
                    else
                    {
                    Njour=31;
                    }
                    
//mois de fevrier
                    if (tableau[2]==2)
                      {
                      Njour=28;
                      }
                      
                      
                    if (tableau[0]<=Njour && tableau[1]<=12)
                        {
                      
                        return tableau;
                        }
                        else 
                        {
                        alert('nb jour>30 ou mois >12') ;
                         
                          date.focus();
                          //date.style.background = "white url(images/FondCalendar.gif) repeat scroll center top;";
            
                        return false;
                        }
                      }        
                  else 
                      {
                    alert('pas le bon nombre de caractere'+tableau[0].length);
                      
                       date.focus();
                       //date.style.background = "white url(images/FondCalendar.gif) repeat scroll center top;";
            
                      return false;
                      }
             } 
             else 
             {
            
           alert('pas assez d espace');
             date.focus();
            //date.style.background = "white url(images/FondCalendar.gif) repeat scroll center top;";
            
              return false;
              
             } 
}



 function VerifIntMinMax(chaine,min,max)
      {
         if((!isNaN(chaine)) )
             { 
             return(chaine.length>=min && chaine.length<=max);
             }  
             else 
             {
             return false; 
             }
      } 
   


































//Changement de criteres pour affinez la recherche.
function Suppr_Critere_Result( LABEL , PAGE , FORM )
{
	if(LABEL == "Label_Date")
	{
		document.getElementById("Label_Date").value = "";
		document.getElementById("Label_Date2").value = "";
	}
	else
	{
    document.getElementById(LABEL).value = "";
	}
	
	Change_Recherche( PAGE , FORM );
}





//Changement de criteres pour affinez la recherche.
function Change_Recherche( PAGE , FORM )
{
  document.getElementById(FORM).action = PAGE; 
  document.getElementById(FORM).submit(); 
}



// Verification champs date jj/mm/aaaa
function date_valide(sText , i ){
    var date = sText;
    var modele = /^(\d{1,2}\/){2}\d{4}$/;
    
    
    if (modele.test(date))
    {
      var chaine=sText;
      var reg=new RegExp("[/]+", "g");
      var tableau=chaine.split(reg);
      
      var DateEnCours = new Date( tableau[2] , (tableau[1] - 1) ,  tableau[0] )
      var DateNow = new Date()
     
      if(  DateNow < DateEnCours  ||  ( tableau[2] < 1970 )  ||  ( tableau[1]-1 > 11 )  ||  ( tableau[0] > 31 ) )
        {
        return false;}
      else
        return true;
    }
    else
      return false;
      
}
function date_valide_cata(sText , i ){
    var date = sText;
    var modele = /^(\d{1,2}\/){2}\d{4}$/;
    
    
    if (modele.test(date))
    {
      var chaine=sText;
      var reg=new RegExp("[/]+", "g");
      var tableau=chaine.split(reg);
      
      var DateEnCours = new Date( tableau[2] , (tableau[1] - 1) ,  tableau[0] )
      var DateNow = new Date()
     
      if(  DateNow > DateEnCours  ||  ( tableau[2] < 1970 )  ||  ( tableau[1]-1 > 11 )  ||  ( tableau[0] > 31 ) )
        return false;
      else
        return true;
    }
    else
      return false;
      
}


// Verification champs email
function Montant_valide(sText)
{
    var montant = sText;
    var modele = /^[-+]?\d+(\.\d{0,2})?$/;
    
    
    if (modele.test(montant))
      return true;
    else
      return false;
}


// Verification champs email
function email_valide(sText)
{
    var email = sText;
    var modele = /^[a-zA-Z0-9\.\-_]+@[a-zA-Z0-9\.\-_]+\.[a-zA-Z]{2,5}$/i;
    if (modele.test(email))
      return true;
    else
      return false;
}


 
// Verification champs numerique
function IsNumeric(sText)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
}
  
 
 
  
 // ///////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////
//   ENVOI DU FORM DE PATEMENT
// ///////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////

function Envoi_Paiement( PX_TOT , PX_MIN )
{
  var ObjModePaiement;
  var ObjCGU;
  var PX_CLIENT;
  var PX_CLIENT_30POURCENT;
  
  ObjModePaiement = document.form_Etape_6.mode_paiement;
  ObjCGU = document.form_Etape_6.cgu;
  PX_CLIENT = document.form_Etape_6.PX_CLIENT.value;
  PX_CLIENT_30POURCENT = document.form_Etape_6.PX_CLIENT_30POURCENT.value;
  
  
  if( !ObjModePaiement[0].checked && !ObjModePaiement[1].checked)
  {
    alert("ATTENTION : Vous devez choisir un mode de paiement pour votre commande !");
    return false;
  }
  else if( !ObjCGU.checked )
  {
    alert("ATTENTION : Vous devez accepter les conditions generales de ventes pour valider votre commande !");
    return false;
  }
  else
  {
    if(ObjModePaiement[0].checked && PX_CLIENT_30POURCENT == "0")
    {
      if(PX_CLIENT == "") 
      {
        alert("Attention: Vous n'avez entrÃ© aucun montant. Merci de prÃ©ciser le montant que vous souhaitez rÃ©gler.\n\t Le champs 'Montant' est obligatoire ! ");
        document.form_Etape_6.PX_CLIENT.focus();
        document.form_Etape_6.PX_CLIENT.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
        return false;
      }
      
      Montant = PX_CLIENT;
      Montant = Montant.replace(/,/g,'.');
      Montant = parseFloat(Montant);
      document.form_Etape_6.PX_CLIENT.value = Montant;
      PX_CLIENT = document.form_Etape_6.PX_CLIENT.value;
      
      if(isNaN(PX_CLIENT))
      {
        document.form_Etape_6.PX_CLIENT.value ="";
        alert("Le champs 'Montant' n'est pas au bon format !");
        document.form_Etape_6.PX_CLIENT.focus();
        document.form_Etape_6.PX_CLIENT.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
        return false;
      }
      
      if(Montant_valide(PX_CLIENT) == false)
      {
        document.form_Etape_6.PX_CLIENT.value ="";
        alert("Le champs 'Montant' n'est pas au bon format !");
        document.form_Etape_6.PX_CLIENT.focus();
        document.form_Etape_6.PX_CLIENT.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
        return false;
      }
      
      PX_CLIENT = parseFloat(PX_CLIENT);
      PX_MIN = parseFloat(PX_MIN);
      PX_TOT = parseFloat(PX_TOT);
      
      if( PX_MIN <= PX_CLIENT && PX_CLIENT <= PX_TOT)
      {
        if(PX_CLIENT != PX_TOT)
        {
          if(!confirm('Vous allez rÃ©gler PARTIELLEMENT le sÃ©jour. La somme rÃ©glÃ© sera de '+PX_CLIENT+' euros. \n\t Souhaitez vous continuer?'))
          {
            return false;
          }
          document.form_Etape_6.PX_CLIENT_30POURCENT.value = 1;
        }
        else
        {
          if(!confirm('Vous allez rÃ©gler la TOTALITE du sÃ©jour d\'un montant de '+PX_CLIENT+' euros. \n\t Souhaitez vous continuer?'))
          {
            return false;
          }
        }
      }
      else
      {
        alert('Attention: le montant indiquÃ© ne doit pas Ãªtre infÃ©rieur au montant minimum de l\'acompte. Il doit Ãªtre compris entre '+PX_MIN+' et '+PX_TOT+' euros !');
        return false;
      }
      
    }
    else if(ObjModePaiement[0].checked && PX_CLIENT_30POURCENT == "PAIEMENT4FOIS")
    {
      if(!confirm('Attention: Vous avez choisi le paiement en 4 fois.\n\tVoulez-vous continuer ?'))
        return false;
      
      document.form_Etape_6.PX_CLIENT_30POURCENT.value = "PAIEMENT4FOIS";
    }
    
    document.form_Etape_6.action = "/FonctionsPHP/TraiteCde.php";
    document.form_Etape_6.submit();
  }
  
}
  
  
  
  

  
 

//Changement de criteres pour affinez la recherche.
function Change_Recherche( PAGE , FORM )
{
document.getElementById(FORM).action = PAGE; 
document.getElementById(FORM).submit(); 

}

 
 // ///////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////
//   ENVOI DU FORM DE RECHERCHE QUAND CLIC SUR PAGINATION
// ///////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////

function Envoi_Form_Rech_Avec_Pagination( PAGE , FORM , PAGENOM , NB_RES)
{
  var url = PAGENOM + "?ppPag=" + PAGE;
  if(NB_RES)
    url = url + "&nb_Res="+NB_RES;
  document.getElementById(FORM).action = url;
  document.getElementById(FORM).submit();
}
  
  
  

// -------------------------------
// FONCTION Is_Url_Http
//    Descrition____: verifie si le param passé est de type url http://...
//    Params________: chaine 
//    Renvoi________: True si ok, false si pas type email
// -------------------------------
function Is_Url_Http(Url)
{
  alert(Url);
  if (Url.search("^(http://|https://)[A-Za-z0-9][A-Za-z0-9\-\.]+[A-Za-z0-9]\.[A-Za-z]{2,}[\43-\176]*$") == -1)
    return false;
  else
    return true;
}

  
  
// ///////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////
//   AJAX
// ///////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////
function ajax(url, method, start, end) {
	var xmlHttpReq = false;
    var self = this;
	var method = method || 'GET';
	
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
	
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    } else {
		return false;
	}
	
    self.xmlHttpReq.open(method, url, true);

    self.xmlHttpReq.onreadystatechange = function() {
		if (self.xmlHttpReq.readyState == 1) {
			start.call(this);
        } else if (self.xmlHttpReq.readyState == 4) {
			end.call(this, self.xmlHttpReq.responseText);
        }
    }
	
    self.xmlHttpReq.send();
	
	return true;
}

  
  
// ///////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////
//   CALENDRIER CODES TARIFS AFFICHER VILLES SELON DATES
// ///////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////
function Calendrier_CT_Voir_Dates( URL , JOUR, TYPE_PAGE, ID_SEJOUR, DEPARTURE )
{
  var typelien;
  if(TYPE_PAGE == 'PHP')
    typelien = '&VL=';
  else if(TYPE_PAGE == 'HTMLPOST')
    typelien = '&VL=';
  else if(TYPE_PAGE == 'HTML')
    typelien = '?VL=';
  else
    typelien = '&VL=';
	
	var r = ajax('ajax/calendar/get-departure-cities.php?departure=' + DEPARTURE + '&id=' + ID_SEJOUR + '&VL=' + JOUR, 
	'GET', function() {
		document.getElementById('calendar-cities').style.display = "none";
		document.getElementById('calendar-cities-loader').style.display = "block";
	}, function(html){
		document.getElementById('calendar-cities-loader').style.display = "none";
		document.getElementById('calendar-cities').style.display = "block";
		document.getElementById('calendar-cities').innerHTML = html;
	});
	
	if (!r) {
		window.location.replace(URL + typelien + JOUR);
	} 
}
  

 

 
// ///////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////
//   CALENDRIER CODES TARIFS AFFICHER DATES SELON VILLES
// ///////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////
function Calendrier_CT_Voir_Villes( IDVILLE , INDEXVILLE)
{
  var i = 0;
  var CodeHTML = '';
  var NMVILLE ;
  NMVILLE = document.getElementById('Label_ParVilles').options[INDEXVILLE].text;

  
	CodeHTML =  CodeHTML +  '<table width="100%" border="0" cellpadding="0" cellspacing="0">';
	
  CodeHTML =  CodeHTML +  ' <tr>';
  CodeHTML =  CodeHTML +  '  <td width="15%" valign="top" align="center" style="vertical-align:top;text-align:center;">';
  CodeHTML =  CodeHTML +  '    <img src="images/ville.jpg" border="0">';
  CodeHTML =  CodeHTML +  '  </td>';
  CodeHTML =  CodeHTML +  '  <td width="85%" valign="top" align="left" style="vertical-align:top;text-align:left;">';
  CodeHTML =  CodeHTML +  '   <strong class="Titres">Dates de d&eacute;part pour ' + NMVILLE + '<BR />';
  CodeHTML =  CodeHTML +  '  </td>';
  CodeHTML =  CodeHTML +  ' </tr>';
  
  while(TABDATES[IDVILLE+i])
  {
    CodeHTML =  CodeHTML +  ' <tr>';
    CodeHTML =  CodeHTML +  '  <td valign="top" align="right" style="vertical-align:top;text-align:right;">';
    CodeHTML =  CodeHTML +  '    <img src="images/Fleche_ville.jpg" border="0">';
    CodeHTML =  CodeHTML +  '  </td>';
    CodeHTML =  CodeHTML +  '  <td width="85%" valign="top" align="left" style="vertical-align:top;text-align:left;">';
    CodeHTML =  CodeHTML + TABDATES[IDVILLE+i];
    CodeHTML =  CodeHTML +  '  </td>';
    CodeHTML =  CodeHTML +  ' </tr>';
    i++;
  }

  CodeHTML =  CodeHTML +  ' </table>';
  
  
  
  
  document.getElementById('DIV_CODES_T_V').innerHTML = CodeHTML;
}
  

 
 
// ///////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////
//       VERIF FORM COMMANDE ETAPE 3
// ///////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////

function valid_Form_Etape3( AGEDB ,  AGEFN , DTDB , DTFN )
{
  var i=0;
  var VALID;
  var NB_ENF=0;
  var NOM_TEMP ;
  
  
  
  if(document.form_Etape_3.Label_CDE_NOM)
    if(document.form_Etape_3.Label_CDE_NOM.value == "") {
     alert("Le champs 'NOM' du REPRESENTANT LEGAL est obligatoire!");
     document.form_Etape_3.Label_CDE_NOM.focus();
     document.form_Etape_3.Label_CDE_NOM.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
     return false;
    }
    
  if(document.form_Etape_3.Label_CDE_PRENOM)
    if(document.form_Etape_3.Label_CDE_PRENOM.value == "") {
     alert("Le champs 'PRENOM' du REPRESENTANT LEGAL est obligatoire!");
     document.form_Etape_3.Label_CDE_PRENOM.focus();
     document.form_Etape_3.Label_CDE_PRENOM.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
     return false;
    } 
  
  if(document.form_Etape_3.Label_CDE_ADRESSE.value == "") {
   alert("Le champs 'ADRESSE' du REPRESENTANT LEGAL est obligatoire!");
   document.form_Etape_3.Label_CDE_ADRESSE.focus();
   document.form_Etape_3.Label_CDE_ADRESSE.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";return false;
  } 
  else if(document.form_Etape_3.Label_CDE_CP.value == "") {
   alert("Le champs 'CODE POSTAL' du REPRESENTANT LEGAL est obligatoire!");
   document.form_Etape_3.Label_CDE_CP.focus();
   document.form_Etape_3.Label_CDE_CP.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";return false;
  } 
  else if(document.form_Etape_3.Label_CDE_VILLE.value == "") {
   alert("Le champs 'VILLE' du REPRESENTANT LEGAL est obligatoire!");
   document.form_Etape_3.Label_CDE_VILLE.focus();
   document.form_Etape_3.Label_CDE_VILLE.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";return false;
  } 
  else if(document.form_Etape_3.Label_CDE_Email.value == "") {
     alert("Le champs 'EMAIL' du REPRESENTANT LEGAL est obligatoire!");
     document.form_Etape_3.Label_CDE_Email.focus();
     document.form_Etape_3.Label_CDE_Email.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";return false;
  }
  else if(!VerifMail(document.form_Etape_3.Label_CDE_Email)) {
   alert("Le champs 'EMAIL' du REPRESENTANT LEGAL n'est pas un email !");
   document.form_Etape_3.Label_CDE_Email.focus();
   document.form_Etape_3.Label_CDE_Email.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";return false;
    } 
  else if(document.form_Etape_3.Label_CDE_Email_Valid.value == "0") {
   alert("Le champs 'EMAIL' du REPRESENTANT LEGAL est deja pris! Veuillez en choisir un autre ! ");
   document.form_Etape_3.Label_CDE_Email.focus();
   document.form_Etape_3.Label_CDE_Email.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";return false;
  }
  else if(document.form_Etape_3.Label_CDE_Password && document.form_Etape_3.Label_CDE_Password.value == "") {
     alert("Le champs 'MOT DE PASSE' du compte est obligatoire!");
     document.form_Etape_3.Label_CDE_Password.focus();
     document.form_Etape_3.Label_CDE_Password.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
     return false;
  }
  else if(document.form_Etape_3.Label_CDE_Passwordverif && document.form_Etape_3.Label_CDE_Passwordverif.value == "") {
     alert("Le champs 'CONFIRMATION MOT DE PASSE' du compte est obligatoire!");
     document.form_Etape_3.Label_CDE_Passwordverif.focus();
     document.form_Etape_3.Label_CDE_Passwordverif.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";return false;
  }
  else if(document.form_Etape_3.Label_CDE_Password && document.form_Etape_3.Label_CDE_Passwordverif && document.form_Etape_3.Label_CDE_Password.value != document.form_Etape_3.Label_CDE_Passwordverif.value) {
     alert("Le champs  'MOT DE PASSE' et sa confirmation ne sont pas pareils !");
     document.form_Etape_3.Label_CDE_Password.focus();
     document.form_Etape_3.Label_CDE_Password.value = '';
     document.form_Etape_3.Label_CDE_Passwordverif.value = '';
     document.form_Etape_3.Label_CDE_Password.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
     document.form_Etape_3.Label_CDE_Passwordverif.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
     return false;
  }
  else if(document.form_Etape_3.Label_CDE_TELfixe.value == "") {
   alert("Le champs 'TELEPHONE fixe' du REPRESENTANT LEGAL est obligatoire!");
   document.form_Etape_3.Label_CDE_TELfixe.focus();
   document.form_Etape_3.Label_CDE_TELfixe.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";return false;
  }
  else if(document.form_Etape_3.Label_CDE_TELmobile.value == "") {
   alert("Le champs 'TELEPHONE mobile' du REPRESENTANT LEGAL est obligatoire!");
   document.form_Etape_3.Label_CDE_TELmobile.focus();
   document.form_Etape_3.Label_CDE_TELmobile.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";return false;
  }
  /*else if(document.form_Etape_3.Label_CDE_TELVacances.value == "") {
   alert("Le champs 'TELEPHONE Vacances' du REPRESENTANT LEGAL est obligatoire!");
   document.form_Etape_3.Label_CDE_TELVacances.focus();
   document.form_Etape_3.Label_CDE_TELVacances.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";return false;
  }
  else if(document.form_Etape_3.Label_CDE_PROFpere.value == "") {
   alert("Le champs 'PROFESSION PERE' du REPRESENTANT LEGAL est obligatoire!");
   document.form_Etape_3.Label_CDE_PROFpere.focus();
   document.form_Etape_3.Label_CDE_PROFpere.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";return false;
  }
  else if(document.form_Etape_3.Label_CDE_PROFmere.value == "") {
   alert("Le champs 'PROFESSION MERE' du REPRESENTANT LEGAL est obligatoire!");
   document.form_Etape_3.Label_CDE_PROFmere.focus();
   document.form_Etape_3.Label_CDE_PROFmere.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";return false;
  }
  else if(document.form_Etape_3.Label_CDE_SOCIETEpere.value == "") {
   alert("Le champs 'SOCIETE DU PERE' du REPRESENTANT LEGAL est obligatoire!");
   document.form_Etape_3.Label_CDE_SOCIETEpere.focus();
   document.form_Etape_3.Label_CDE_SOCIETEpere.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";return false;
  }
  else if(document.form_Etape_3.Label_CDE_SOCIETEmere.value == "") {
   alert("Le champs 'SOCIETE DE LA MERE' du REPRESENTANT LEGAL est obligatoire!");
   document.form_Etape_3.Label_CDE_SOCIETEmere.focus();
   document.form_Etape_3.Label_CDE_SOCIETEmere.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";return false;
  }
  else if(document.form_Etape_3.Label_CDE_TELTRAVAILpere.value == "") {
   alert("Le champs 'TEL TRAVAIL PERE' du REPRESENTANT LEGAL est obligatoire!");
   document.form_Etape_3.Label_CDE_TELTRAVAILpere.focus();
   document.form_Etape_3.Label_CDE_TELTRAVAILpere.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";return false;
  }
  else if(document.form_Etape_3.Label_CDE_TELTRAVAILmere.value == "") {
   alert("Le champs 'PROFESSION MERE' du REPRESENTANT LEGAL est obligatoire!");
   document.form_Etape_3.Label_CDE_TELTRAVAILmere.focus();
   document.form_Etape_3.Label_CDE_TELTRAVAILmere.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";return false;
  }*/
  
  
  
  
  else if(document.form_Etape_3.Label_SITUATION.value == "0") {
   alert("Le champs 'SITUATION FAMILIALE' du REPRESENTANT LEGAL est obligatoire!");
   return false;
  }
  
  else if( document.getElementById('Label_SELECT_ENFANT_EXISTANTS__OK') )
  {
    if((!document.getElementById('Label_NB_ENF') || document.getElementById('Label_NB_ENF').value == 0) && document.getElementById('Label_SELECT_ENFANT_EXISTANTS__OK').options.length == 0 ) {
      alert("Vous devez choisir un participant !");
      return false;
    }
  }



    VALID = true;

  if(document.getElementById('Label_NB_ENF').value > 0) 
  {
    NB_ENF = document.getElementById('Label_NB_ENF').value;
    NB_ENF++;

    
    for (i=1; i<NB_ENF; i++) 
    {
      if(document.getElementById('Label_ENF'+i+'_NOM').value == "") {
        VALID = false;
        alert("Le champs 'NOM' du PARTICIPANT "+i+" est obligatoire!");
        document.getElementById('Label_ENF'+i+'_NOM').focus();
        document.getElementById('Label_ENF'+i+'_NOM').style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
        break;
      }
      if(document.getElementById('Label_ENF'+i+'_PRENOM').value == "") {
        VALID = false;
        alert("Le champs 'PRENOM' du PARTICIPANT "+i+" est obligatoire!");
        document.getElementById('Label_ENF'+i+'_PRENOM').focus();
        document.getElementById('Label_ENF'+i+'_PRENOM').style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
        break;
      }
      if(document.getElementById('Label_ENF'+i+'_SEXE').value == "0") {
        VALID = false;
        alert("Le champs 'SEXE' du PARTICIPANT "+i+" est obligatoire!");
        break;
      }
      if(document.getElementById('Label_ENF'+i+'_ANNIV').value == "") {
        VALID = false;
        alert("Le champs 'DATE DE NAISSANCE' du PARTICIPANT "+i+" est obligatoire!");
        document.getElementById('Label_ENF'+i+'_ANNIV').focus();
        document.getElementById('Label_ENF'+i+'_ANNIV').style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
        break;
      }
      if( date_valide(document.getElementById('Label_ENF'+i+'_ANNIV').value , i ) == false ) {
        VALID = false;
        alert("Le champs 'DATE DE NAISSANCE' du PARTICIPANT "+i+" n'est pas au bon format ou n'est pas valide !\n Le format requis est JJ/MM/AAAA.");
        document.getElementById('Label_ENF'+i+'_ANNIV').focus();
        document.getElementById('Label_ENF'+i+'_ANNIV').style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
        break;
      }
      
      
      
//fonction de test de l'age 
  
       
  
      var date_naissance=(document.getElementById('Label_ENF'+i+'_ANNIV').value).split('/');
      var date_db=DTDB.split("-");
      var date_fn=DTFN.split("-");
     
      var DateNais = new Date( date_naissance[2] ,date_naissance[1]-1 , date_naissance[0] ) ;    
      var Datedb=new Date(date_db[2] ,date_db[1]-1 , date_db[0]) ;
       var Datefn=new Date(date_fn[2] ,date_fn[1]-1 , date_fn[0]) ;
     
     if(!((tjs_age(DateNais,Datedb)>=AGEDB) && (tjs_age(DateNais,Datefn)<=AGEFN)))
     { 
       VALID = false;
      
       alert ("Le participant n'a pas l'age requis pour ce sejour .N'hesitez pas a nous contacter pour envisager ensemble d'autres solutions possibles. ")
       document.getElementById('Label_ENF'+i+'_ANNIV').focus();
       document.getElementById('Label_ENF'+i+'_ANNIV').style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
       break;
     }
     
    
    
    }
    
  }
  else if( !document.getElementById('Label_SELECT_ENFANT_EXISTANTS__OK') || ( document.getElementById('Label_SELECT_ENFANT_EXISTANTS__OK') && document.getElementById('Label_SELECT_ENFANT_EXISTANTS__OK').options.length == 0)  )
  {
   alert("Vous devez selectionner au moins un enfant !");return false;
  }
  
  if( document.getElementById('Label_SELECT_ENFANT_EXISTANTS__OK') )
    if(document.getElementById('Label_SELECT_ENFANT_EXISTANTS__OK').options.length > 0)
    {
      var Sel = document.getElementById('Label_SELECT_ENFANT_EXISTANTS__OK');
      var Inp = document.getElementById('Label_SELECT_ENFANT_EXISTANTS__OK_INPUT');
      for( i=0 ; i<Sel.options.length ; i++ )
      {
        Inp.value = Inp.value + Sel.options[i].value + ',';
      }
    }
   
  if(VALID == true)
  {
    document.form_Etape_3.submit();
  }
}
  




function valid_Form_Etape5_CP()
{
  var PROMO = document.form_Etape_5_CP.Label_CODE_PROMO.value;
  
  if(PROMO == "")
  {
    alert("Le champ 'Code promo' doit etre rempli obligatoiremeent ou n'est pas valide!");
    document.form_Etape_5_CP.Label_CODE_PROMO.value = "";
  }
  else
  {
    exp=new RegExp("^promo[-][a-zA-Z0-9]{4}[-][a-zA-Z0-9]{4}$","gi");
    if (PROMO.match(exp))
    {
      document.form_Etape_5_CP.action = "/FonctionsPHP/TraitePromo.php";
      document.form_Etape_5_CP.submit();
    }
    else
    {
      alert("Le champ 'Code promo' doit etre rempli obligatoiremeent ou n'est pas valide!");
      document.form_Etape_5_CP.Label_CODE_PROMO.value = "";
    }
  } 
}












 function tjs_age(dtnaissance,date) {
	
	var age=""; var age_a=0;var age_m=0;
		age_a = date.getFullYear()-dtnaissance.getFullYear();
		
    if( (dtnaissance.getMonth()> date.getMonth()) ||  ((dtnaissance.getMonth()== date.getMonth()) && (dtnaissance.getDate()>date.getDate()))  )
            {
             age_a--;
            }   
            
                 
   

	return age_a;
}








function NB_Participants_Solder_Sejour( NB_ENFANT)
{
  var NB_ENFANT_BOUCLE , cpt , i , H = "";
  
  NB_ENFANT = parseInt(NB_ENFANT);
  
  NB_ENFANT_BOUCLE = NB_ENFANT + 1;
  
  
  for (i=1;i<NB_ENFANT_BOUCLE;i++)
  {
    H =H+'<table width="100%" border="0" cellspacing="0" cellpadding="0">';
    H =H+'<tr>';
    H =H+'<td colspan="5">';
    H =H+'  <BR /><BR />';
    H =H+'</td>';
    H =H+'</tr>';
        
    H =H+'<tr>';
    H =H+'  <td colspan="5"style="text-align:left;vertical-align:top;border-top:2px solid #FF6500">';
    H =H+'    <span class="CMDE_Titre_2">';
    H =H+'     &nbsp;PARTICIPANT '+i+'&nbsp;';
    H =H+'    </span>';
    H =H+'      <BR /><BR />';
    H =H+'  </td>';
    H =H+' </tr>';
        
    H =H+'  <tr>';
    H =H+'    <td width="20%" height="21px" align="right" valign="middle" style="text-align:right;vertical-align:middle;">';
    H =H+'      <span class="CMDE_Explication_Gras2">';
    H =H+'        NOM&nbsp;';
    H =H+'      </span>';
    H =H+'    </td>';
    H =H+'    <td width="25%" height="21px" align="left" valign="top" style="text-align:left;vertical-align:top;">';
    H =H+'      <input name="Label_ENF'+i+'_NOM" id="Label_ENF'+i+'_NOM" type="text" size="15" value="" class="ChampFormRechHaut" onKeyUp="javascript:this.style.background=\'\'" tabindex="'+((5*i)+19)+'">';
    H =H+'    </td>';
    H =H+'    <td width="20%" height="21px" align="right" valign="middle" style="text-align:right;vertical-align:middle;">';
    H =H+'      <span class="CMDE_Explication_Gras2">';
    H =H+'        PRENOM&nbsp;';
    H =H+'      </span>';
    H =H+'    </td>';
    H =H+'    <td >';
    H =H+'      <div align="left">';
    H =H+'         <input name="Label_ENF'+i+'_PRENOM" id="Label_ENF'+i+'_PRENOM" type="text" size="15" value="" class="ChampFormRechHaut" onKeyUp="javascript:this.style.background=\'\'" tabindex="'+((5*i)+20)+'">';
    H =H+'      </div>';
    H =H+'    </td>';
    H =H+'    <td></td>';
    H =H+'  </tr>';
    H =H+'</table>';
  }
  
  document.getElementById('DivEnfants').innerHTML = H ;
  
  
}









function Verif_Form_Solder_Sejour()
{
  var Montant;

  if(document.FORM_Solder_sejour.NOM_TUTEUR.value == "") 
  {
    alert("Le champs 'Nom du tuteur legal' est obligatoire!");
    document.FORM_Solder_sejour.NOM_TUTEUR.focus();
    document.FORM_Solder_sejour.NOM_TUTEUR.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
    return false;
  }
  else if(document.FORM_Solder_sejour.PRENOM_TUTEUR.value == "") 
  {
    alert("Le champs 'Prenom du tuteur legal' est obligatoire!");
    document.FORM_Solder_sejour.PRENOM_TUTEUR.focus();
    document.FORM_Solder_sejour.PRENOM_TUTEUR.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
    return false;
  }
  else if(document.FORM_Solder_sejour.EMAIL_TUTEUR.value == "") 
  {
    alert("Le champs 'Mail du tuteur' est obligatoire!");
    document.FORM_Solder_sejour.EMAIL_TUTEUR.focus();
    document.FORM_Solder_sejour.EMAIL_TUTEUR.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
    return false;
  }
  else if(document.FORM_Solder_sejour.EMAIL_TUTEUR2.value == "") 
  {
    alert("Le champs 'Confirmation du mail du tuteur' est obligatoire!");
    document.FORM_Solder_sejour.EMAIL_TUTEUR2.focus();
    document.FORM_Solder_sejour.EMAIL_TUTEUR2.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
    return false;
  }
  
  if(VerifMail(document.FORM_Solder_sejour.EMAIL_TUTEUR) == false) 
  {
    alert("Le champs Mail n'est pas au bon format !");
    document.FORM_Solder_sejour.EMAIL_TUTEUR.focus();
    document.FORM_Solder_sejour.EMAIL_TUTEUR.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
    return false;
  }
  else if(VerifMail(document.FORM_Solder_sejour.EMAIL_TUTEUR2) == false) 
  {
    alert("Le champs Confirmation du mail n'est pas au bon format !");
    document.FORM_Solder_sejour.EMAIL_TUTEUR2.focus();
    document.FORM_Solder_sejour.EMAIL_TUTEUR2.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
    return false;
  }
  else if(document.FORM_Solder_sejour.EMAIL_TUTEUR.value != document.FORM_Solder_sejour.EMAIL_TUTEUR2.value) 
  {
    alert("Le champs mail et sa confirmation sont differents !");
    document.FORM_Solder_sejour.EMAIL_TUTEUR.focus();
    document.FORM_Solder_sejour.EMAIL_TUTEUR.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
    return false;
  }
  
  else if(document.FORM_Solder_sejour.NOM_SEJOUR.value == "") 
  {
    alert("Le champs 'Nom du sejour' est obligatoire!");
    document.FORM_Solder_sejour.NOM_SEJOUR.focus();
    document.FORM_Solder_sejour.NOM_SEJOUR.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
    return false;
  }

  else if(document.FORM_Solder_sejour.REF_COMMANDE.value == "") 
  {
    alert("Le champs 'Reference commande' est obligatoire!");
    document.FORM_Solder_sejour.REF_COMMANDE.focus();
    document.FORM_Solder_sejour.REF_COMMANDE.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
    return false;
  }
  
  else if(document.getElementById('Label_NB_ENF').value == 0) 
  {
    alert("Vous devez selectionner le nombre de participants !");
    document.getElementById('Label_NB_ENF').style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
    return false;
  }
  else if(document.getElementById('Label_NB_ENF').value > 0) 
  {
    NB_ENF = document.getElementById('Label_NB_ENF').value;
    VALID = true;
    NB_ENF++;
    
    for (i=1; i<NB_ENF; i++) 
    {
      if(document.getElementById('Label_ENF'+i+'_NOM').value == "") 
      {
        VALID = false;
        alert("Le champs 'NOM' du PARTICIPANT "+i+" est obligatoire!");
        document.getElementById('Label_ENF'+i+'_NOM').focus();
        document.getElementById('Label_ENF'+i+'_NOM').style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
        return false;
        break;
      }
      
      if(document.getElementById('Label_ENF'+i+'_PRENOM').value == "") 
      {
        VALID = false;
        alert("Le champs 'PRENOM' du PARTICIPANT "+i+" est obligatoire!");
        document.getElementById('Label_ENF'+i+'_PRENOM').focus();
        document.getElementById('Label_ENF'+i+'_PRENOM').style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
        return false;
        break;
      }
      
    }
  }
  
  
  
  if(document.FORM_Solder_sejour.SOLDE.value == "") 
  {
    document.FORM_Solder_sejour.SOLDE.value ="";
    alert("Le champs 'SOLDE' est obligatoire !");
    document.FORM_Solder_sejour.SOLDE.focus();
    document.FORM_Solder_sejour.SOLDE.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
    VALID = false;
    return false;
  }

  Montant = document.FORM_Solder_sejour.SOLDE.value;
  Montant = Montant.replace(/,/g,'.');
  Montant = parseFloat(Montant);
  document.FORM_Solder_sejour.SOLDE.value = Montant;
  
  if(isNaN(document.FORM_Solder_sejour.SOLDE.value))
  {
    document.FORM_Solder_sejour.SOLDE.value ="";
    alert("Le champs 'SOLDE' n'est pas au bon format !\n\tVous devez entrer un prix en euros !");
    document.FORM_Solder_sejour.SOLDE.focus();
    document.FORM_Solder_sejour.SOLDE.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
    VALID = false;
    return false;
  }


  if(Montant_valide(document.FORM_Solder_sejour.SOLDE.value) == false)
  {
    document.FORM_Solder_sejour.SOLDE.value ="";
    alert("Le champs 'SOLDE' n'est pas au bon format !\n\tVous devez entrer un prix en euros !\n\t\tExemple : 90,25");
    document.FORM_Solder_sejour.SOLDE.focus();
    document.FORM_Solder_sejour.SOLDE.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
    VALID = false;
    return false;
  }




  if(document.FORM_Solder_sejour.NOM_CB.value == "") 
  {
    alert("Le nom du propriétaire de la carte bancaire est obligatoire !");
    document.FORM_Solder_sejour.NOM_CB.focus();
    document.FORM_Solder_sejour.NOM_CB.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
    return false;
  }



  if(document.FORM_Solder_sejour.PRENOM_CB.value == "") 
  {
    alert("Le nom du propriétaire de la carte bancaire est obligatoire !");
    document.FORM_Solder_sejour.PRENOM_CB.focus();
    document.FORM_Solder_sejour.PRENOM_CB.style.background = "white url(../images/FondCalendar.gif) repeat scroll center top;";
    return false;
  }



  if(VALID == true)
  {
    if(confirm('******************** SOLDER  UN  SEJOUR *************************\n\n\tVOUS ALLEZ EFFECTUER UN PAIEMENT CB DE ' + document.FORM_Solder_sejour.SOLDE.value + ' Euros.\n\n\t\t\t\t Voulez-vous continuer ?\n\n**************************************************************'))
    {
      document.FORM_Solder_sejour.action = '/FonctionsPHP/TraiteCde.php';
      document.FORM_Solder_sejour.submit();
    }
  }
  
  
  
  
}


function checkAllInput(action)
{
   var i = document.getElementsByTagName("input");
   
    for ( var cpt = 0; cpt < i.length; cpt++)
                              i[cpt].checked = (action)? true : false ;
}














