

      function afficherTh()
          {
            
            var img = document.getElementById('th');
            if ( img.style.display = "none") 
              {
                img.style.display = "block" 
              }             

          }
      
      var compteur = 0;
      function ajouter()
          {
             
            var conteneur      = document.getElementById('fichiers');
            var undiv          = document.createElement('div');
            var check          = document.createElement('input');
            var champ1         = document.createElement('input');
            var champ2         = document.createElement('input');
            var champ3         = document.createElement('input');
            var champ4         = document.createElement('input');
            var champ5         = document.createElement('input');
            var champ6         = document.createElement('input');
            var select         = document.createElement('select');
            var select2        = document.createElement('select');            
            var newOption      = document.createElement('option');
            var newOption1     = document.createElement('option');
            var newOption2     = document.createElement('option');
            var newOption3     = document.createElement('option');
            var newOption4     = document.createElement('option');
            var newOption5     = document.createElement('option');
            var newOption6     = document.createElement('option');
            var newOption7     = document.createElement('option');
            var secondOption1  = document.createElement('option');
            var secondOption2  = document.createElement('option');
            
            
            select.name = 'typepret[]';
            select.style.marginRight = '5px';
            select.style.marginLeft = '25px';
            select.style.marginBottom = '5px';
            select.style.backgroundColor = '#eee';
            select.style.borderColor = '#697D7C';
            select.style.borderWidth = '1px';
            select.style.borderStyle = 'solid';
 
            select2.name = 'asolder[]';
            select2.style.marginRight = '5px';
            select2.style.backgroundColor = '#eee';
            select2.style.borderColor = '#697D7C';
            select2.style.borderWidth = '1px';
            select2.style.borderStyle = 'solid';
            
            check.type  = 'checkbox';
            check.style.marginRight = '5px';
            
            champ1.name = 'organisme[]';
            champ1.type  = 'text';
            champ1.style.marginRight = '5px';
            champ1.size= '7';
            champ1.style.borderColor = '#697D7C';
            champ1.style.borderWidth = '1px';
            champ1.style.borderStyle = 'solid';
            champ1.style.backgroundColor = '#eee';
            
            champ2.name = 'capital[]';
            champ2.type  = 'text';
            champ2.style.marginRight = '5px';
            champ2.size= '7';
            champ2.style.borderColor = '#697D7C';
            champ2.style.borderWidth = '1px';
            champ2.style.borderStyle = 'solid';
            champ2.style.backgroundColor = '#eee';
            
            champ3.name = 'depuiseng[]';
            champ3.type  = 'text';
            champ3.style.marginRight = '5px';
            champ3.size= '7';
            champ3.style.borderColor = '#697D7C';
            champ3.style.borderWidth = '1px';
            champ3.style.borderStyle = 'solid';
            champ3.style.backgroundColor = '#eee';
            
            champ4.name = 'duree[]';
            champ4.type  = 'text';
            champ4.style.marginRight = '5px';
            champ4.size= '7';
            champ4.style.borderColor = '#697D7C';
            champ4.style.borderWidth = '1px';
            champ4.style.borderStyle = 'solid';
            champ4.style.backgroundColor = '#eee';
            
            champ5.name = 'mensualite[]';
            champ5.type  = 'text';
            champ5.style.marginRight = '5px';
            champ5.size= '7';
            champ5.style.borderColor = '#555';
            champ5.style.borderWidth = '1px';
            champ5.style.borderStyle = 'solid';
            champ5.style.backgroundColor = '#eee';
            
            champ6.name = 'solde[]';
            champ6.type  = 'text';
            champ6.style.marginRight = '5px';
            champ6.size= '7';
            champ6.style.borderColor = '#555';
            champ6.style.borderWidth = '1px';
            champ6.style.borderStyle = 'solid';
            champ6.style.backgroundColor = '#eee';


                

                
 
            // --- Option select Type de Prêt
            
                newOption.value="";
                newOption.innerHTML="Sélectionnez";  
                
                newOption1.value="Financement Auto";
                newOption1.innerHTML="Financement Auto";
                
                newOption2.value="Pret Personnel";
                newOption2.innerHTML="Prêt Personnel";
                
                newOption3.value="Ouverture de Credits";
                newOption3.innerHTML="Ouverture de Crédits";
                
                newOption4.value="ONSS";
                newOption4.innerHTML="ONSS";
                
                newOption5.value="TVA";
                newOption5.innerHTML="TVA";
                
                newOption6.value="Pret hypothecaire";
                newOption6.innerHTML="Prêt hypothécaire";
                
                newOption7.value="Autre";
                newOption7.innerHTML="Autre";
                

                
 
            // --- Option select À solder?
                
                secondOption1.value="Oui";
                secondOption1.innerHTML="Oui";
                
                secondOption2.value="Non";
                secondOption2.innerHTML="Non";
                
           
             
check.onclick = function enlever()
              {             
                compteur--;
                lediv      = this.parentNode;             
                lefieldset  = lediv.parentNode;             
                lefieldset.removeChild(lediv);
                document.getElementById('cache').value=compteur;
            }

            undiv.appendChild(select);
            select.appendChild(newOption);
            select.appendChild(newOption1);
            select.appendChild(newOption2);
            select.appendChild(newOption3);
            select.appendChild(newOption4);
            select.appendChild(newOption5);
            select.appendChild(newOption6);
            select.appendChild(newOption7);
            undiv.appendChild(champ1);
            undiv.appendChild(champ2);
            undiv.appendChild(champ3);
            undiv.appendChild(champ4);
            undiv.appendChild(champ5);
            undiv.appendChild(champ6);
            undiv.appendChild(select2);


            select2.appendChild(secondOption1);
            select2.appendChild(secondOption2);
            undiv.appendChild(check);
            undiv.appendChild(document.createTextNode("Enlever"));

            conteneur.appendChild(undiv);
            compteur++;
            document.getElementById('cache').value=compteur;
            
        }

