var champPropositionThemeDejaCree = false;

function ajouteAnnee(input) {

     var nd = document.createElement("div");
	   var prop = document.getElementById("prop");
	   prop.appendChild(nd);
	   /*puis on ajoute un champ de saisie*/

	  var input = document.createElement ("input");
	   input.type = "text";
	   input.name ="annee[]";
	   input.value=<?php echo '{$this->annee}';?>;
	   nd.appendChild (input);  
}/*fin function ajoute()*/

var champTelUnDejaCree = false;
function ajouterTel2(){

   if(!champTelUnDejaCree)

    {
     var nd = document.createElement("div");
	   var tel = document.getElementById("tel2");
	   tel.appendChild(nd);
	   /*puis on ajoute un champ de saisie*/

     var input = document.createElement ("input");
	   input.type = "text";
	   input.name ="telephone2";
	  // input.id ="author";
	  // input.setAttribute("onFocus","trouverAuteur()");  

	   input.value=<?php echo '{$this->telephone2}';?>;
	   nd.appendChild (input); 
     champTelUnDejaCree = true;
      }
	}    
	var champTelDeuxDejaCree = false;
	function ajouterTel3(){
//var champPropositionThemeDejaCree = false;
 if(!champTelDeuxDejaCree)

    {
	   var nd = document.createElement("div");
	   var tel = document.getElementById("tel3");
	   tel.appendChild(nd);
	   /*puis on ajoute un champ de saisie*/

     var input = document.createElement ("input");
	   input.type = "text";
	   input.name ="telephone3";
	  // input.id ="author";
	  // input.setAttribute("onFocus","trouverAuteur()");  

	   input.value=<?php echo '{$this->telephone3}';?>;
	   nd.appendChild (input); 
     champTelDeuxDejaCree = true;
      }     
	}    
	function ajouterEmail(){
//var champPropositionThemeDejaCree = false;

	   var nd = document.createElement("div");
	   var mail = document.getElementById("mail");
	   mail.appendChild(nd);
	   /*puis on ajoute un champ de saisie*/

     var input = document.createElement ("input");
	   input.type = "text";
	   input.name ="email[]";
	  // input.id ="author";
	  // input.setAttribute("onFocus","trouverAuteur()");  

	   input.value=<?php echo '{$this->email}';?>;
	   nd.appendChild (input); 
          
	}    
	function ajouterAdresse(){
    var nd = document.createElement("div");
    var adresse = document.getElementById("adresse");
    adresse.appendChild(nd);
    /*puis on ajoute un champ de saisie*/
    var input = document.createElement ("textarea");
    input.name ="adressePostale[]";
    input.value=<?php echo '{$this->adressePostale}';?>;
	  nd.appendChild (input); 
    }    
    
	function ajouterPeriode(){
    var nd = document.createElement("div");
    var adresse = document.getElementById("periode");
    adresse.appendChild(nd);
    /*puis on ajoute un champ de saisie*/
    var input = document.createElement ("textarea");
    input.name ="periode[]";
    input.value=<?php echo '{$this->periode}';?>;
	  nd.appendChild (input); 
    }    
	
	
		function ajouterAvenant(){
	   var nd = document.createElement("div");
	   var avenant = document.getElementById("avenant");
	   avenant.appendChild(nd);
	   /*puis on ajoute un champ de saisie*/
     //var input = document.createElement ("input");
     var input = document.createElement ("input");
     var text = document.createElement("input");
	   input.type = "text";
	   text.type="text";
	   input.name ="avenant[]";
	   for (i=0; i<3; i++){
	     text.value="numéro " + (i);
	   }
	   input.value=<?php echo '{$this->avenant}';?>;
	   text.appendChild(input);
	   nd.appendChild (text); 
	   nd.appendChild (input); 
	   
    }    


 

/*
 <TEXTAREA NAME="zone2Text" COLS="40" ROWS="10"
 onKeyUp="limite(this,60);" onKeyDown="limite(this,60);"
 >
*/
