function GraphicTree(p_type ,p_rootValue, style, uuid) {


		this.TYPE_CATEGORY = "category";
		this.TYPE_VALUE = "value";
		this.TYPE_LABEL = "label";
		this.TYPE_LABELVALUE = "labelValue";
		this.uuid=uuid;

		//Root type (TYPE_XXX)
		this.rootType=p_type;

		//Root value (String, int, Layer, ect... depending of rootType)
		this.rootValue=p_rootValue;

		//Children
		this.children=new Array(); //array containing GraphicTree
		
		this.isOpened=false;//Pour ouvrir ce noeud par défaut.
		
		if (style)
			this.fontStyle=style;
		else
			this.fontStyle="font-size:10pt; font:times;"; 
			//Pas en style (class), car on veut être autonomes sans .css
			//(pour que les images collent bien)

/** getter ... setter  */
		this.changeFontStyle=function(val){
			this.fontStyle=val;
		}
		this.isLabel= function(){
			return this.rootType==this.TYPE_LABEL;
		};
		this.isValue= function(){
			return this.rootType==this.TYPE_VALUE;
		};
		this.isCategory= function(){
			return this.rootType==this.TYPE_CATEGORY;
		};
		/** @param : GraphicTree */
		this.addChild= function (p_treeChild){
			this.children[this.children.length]=p_treeChild;
		};
		
		this.isLabelValue= function(){
			return this.rootType==this.TYPE_LABELVALUE;
		}
		
		this.isLevelOpened=function(){
			return this.isOpened;
		}
		

/** Draw ... */
		/** 
		@param o_div : div à remplir (objet)
		*/
		this.draw= function(o_div, rootPathImages, prefixe, avecCocheCategorie){		
			o_div.innerHTML="<form name='FORM_LAYER_LIST'>"+this.private_recursifDraw(this.children, prefixe, new Array(), rootPathImages, this.fontStyle, avecCocheCategorie)+"</form>";
		};

		/**
		@param idNoeud : un label pour différencier les DIVs.
		@param tab_cheminVerticaux_estDernier : tableau de boolean indiquant si il y a encore des fils après, ou pas, et ce pour chaque niveau déjà traversé 
			(pour dessiner les barres verticales...)

		Les font-zize:10pt sont nécessaires, car c'est coordonné avec la taille des images (20px de haut). Times Roman.
		*/
		this.private_recursifDraw= function(tab_children, idNoeud,tab_cheminVerticaux_estDernier, rootPathImages, p_fontStyle, avecCocheCategorie){	
			var strHTML="";
			var strDebutLigne=this.private_debutLigne(tab_cheminVerticaux_estDernier, rootPathImages, p_fontStyle);

			for(var i=0;i<tab_children.length;i++){
				var noeud=tab_children[i];
				if(noeud.isLabel()){
				//***Séparateur			
					if(i>0 && tab_children[i-1].isValue()){
						//Ajouter un retour chariot si on a avant un layer non catégorisé
						strHTML+="<br>";
					}
					strHTML+=strDebutLigne+"<span class=label style=\""+p_fontStyle+"\">"+noeud.rootValue+"</span><br>";

				}else if(noeud.isCategory()){
				//***catégorie à déplier
					if(noeud.children!=null){ //Ayant des fils
						if(i>0 && tab_children[i-1].isValue()){
							//Ajouter un retour chariot si on a avant un layer non catégorisé
							var tmp;
							tmp=strHTML+"<br>";
							strHTML=tmp;
							//strHTML+="<br>"; //Cette ligne ne fonctionne plus sous IE6 Oo
						}
						strHTML+=strDebutLigne;
						
						var imgOpen="plus";
						var displayOpen="none";
						if(noeud.isLevelOpened()){
							imgOpen="moins";
							displayOpen="block";
						}
						if(tab_cheminVerticaux_estDernier.length==0 && i==0){
							//Mettre une image de type "début de croisement"
							strHTML+="<img class=ouvreFermeLL style=\"margin:0px; width: 18px; height: 20px; vertical-align: middle; margin-left:2; margin-right:2;background-image:url('"+rootPathImages+"outil_tree_croisement_debut.gif')\" id=\"img_ouvreferme_LL_"+idNoeud+"_"+i+"\" src=\""+rootPathImages+"outil_tree_"+imgOpen+".gif\" onClick=\"GraphicTree.private_ouvreFermeTree('LL_"+idNoeud+"_"+i+"','"+ rootPathImages+"')\"/>";
						
						}else if(i==tab_children.length-1 || tab_children[i+1].isLabel()){
							//Mettre une image de type "fin de croisement"
							strHTML+="<img class=ouvreFermeLL style=\"margin:0px; width: 18px; height: 20px; vertical-align: middle; margin-left:2; margin-right:2;background-image:url('"+rootPathImages+"outil_tree_croisement_fin.gif')\" id=\"img_ouvreferme_LL_"+idNoeud+"_"+i+"\" src=\""+rootPathImages+"outil_tree_"+imgOpen+".gif\" onClick=\"GraphicTree.private_ouvreFermeTree('LL_"+idNoeud+"_"+i+"','"+ rootPathImages+"')\"/>";
						
						}else{
							//Mettre une image de type "croisement"
							strHTML+="<img class=ouvreFermeLL style=\"margin:0px; width: 18px; height: 20px; vertical-align: middle; margin-left:2; margin-right:2;background-image:url('"+rootPathImages+"outil_tree_croisement.gif')\" id=\"img_ouvreferme_LL_"+idNoeud+"_"+i+"\" src=\""+rootPathImages+"outil_tree_"+imgOpen+".gif\" onClick=\"GraphicTree.private_ouvreFermeTree('LL_"+idNoeud+"_"+i+"','"+ rootPathImages+"')\"/>";
						}
						
						if(avecCocheCategorie){
							strHTML+=this.displayCheckBoxCategory(idNoeud+"_"+i,noeud.children.length);
						}
						strHTML+="<span class=category style=\""+noeud.fontStyle+" \">"+noeud.rootValue+"</span>";			
						
						var NVtab_cheminVerticaux_estDernier=new Array();
						for(var it=0;it<tab_cheminVerticaux_estDernier.length;it++){
							NVtab_cheminVerticaux_estDernier[it]=tab_cheminVerticaux_estDernier[it];
						}
						NVtab_cheminVerticaux_estDernier[tab_cheminVerticaux_estDernier.length]=(i==tab_children.length-1 || tab_children[i+1].isLabel());
						strHTML+="<div id='LL_"+idNoeud+"_"+i+"' style=\"display:"+displayOpen+"; padding:0px\">"
								+this.private_recursifDraw(noeud.children, idNoeud+"_"+i, NVtab_cheminVerticaux_estDernier , rootPathImages, p_fontStyle, avecCocheCategorie)+"</div>"
								+"<div id='sautLigne_LL_"+idNoeud+"_"+i+"' style=\"display:block;"+p_fontStyle+"\"></div>";
					}

				}else if(noeud.isValue() || noeud.isLabelValue()){
					//valeur (a priori, un indice de layer dans le tableau principal des layers)
					//ou valeur qui n'est pas checkable
					if(i>0 && tab_children[i-1].isValue()){
						//Retour à la ligne si le précédent est un layer (sinon, ça a déjà été fait)
						strHTML+="<br>";
					}

					strHTML+=strDebutLigne;
					var estLeDernierDeSaSousListe=(i==tab_children.length-1 || tab_children[i+1].isLabel());
					if(estLeDernierDeSaSousListe){
						//Image de fin de croisement
						strHTML+="<img class=ouvreFermeLL style=\"margin:0px; width: 18px; height: 20px; vertical-align: middle; margin-left:2; margin-right:2;\" src='"+rootPathImages+"outil_tree_croisement_fin.gif')'/>";
					}else{
						//Image de croisement
						strHTML+="<img class=ouvreFermeLL style=\"margin:0px; width: 18px; height: 20px; vertical-align: middle; margin-left:2; margin-right:2;\" src='"+rootPathImages+"outil_tree_croisement.gif')'/>";
					}
					if(noeud.isValue())
						strHTML+=this.displayValue(noeud.rootValue, noeud.fontStyle, idNoeud+"_"+i, noeud.uuid);
					else{					
						strHTML+="<span class=label style=\""+p_fontStyle+"\">"+noeud.rootValue+"</span><br>";				
					}
				}
			}
			return strHTML;
		};



	/** Affichage début de ligne, avec images si nécessaire */
		this.private_debutLigne= function(tab_cheminVerticaux_estDernier, rootPathImages, p_fontStyle){
			var strDebutLigne="";
			for(var i=0;i<tab_cheminVerticaux_estDernier.length;i++){
				if(tab_cheminVerticaux_estDernier[i]){
					//est dernier, pas d'image verticale
					strDebutLigne+="<span class=profondeur style=\"padding:0px;margin-left:20px; margin-right:2;"+p_fontStyle+"\" ></span>";
				}else{
					strDebutLigne+="<img class=ouvreFermeLL style=\"margin:0px; width: 18px; height: 20px; vertical-align: middle; margin-left:2; margin-right:2;\" src='"+rootPathImages+"outil_tree_vertical.gif')'/>";
				}
			}
			return strDebutLigne;
		};


	/** Dessin d'une feuille 
	 * p_idNoeud ne sert que s'il y a une case à cocher (ce n'est pas le cas par défaut, voir classes filles)
	
	this.displayValue= function(value, p_fontStyle, p_idNoeud, uuid){
		var strHTML="<input type=checkbox onClick='addCatalogLayer(\""+uuid+"\")' style=\"font-size:8pt; margin:0px; margin-right:3px; vertical-align: middle; \" value='"+value+"'";
		strHTML+=" id='"+p_idNoeud+"' >";	
		strHTML+="<span style=\""+p_fontStyle+"\">"+value+"</span>";
		return strHTML;
	};
*/
	this.displayValue= function(value, p_fontStyle, p_idNoeud, uuid){
		var strHTML="<input type=checkbox onClick='getTreeFromCatalogOrWMC_addCatalogueOrWMCLayer(this)' style=\"font-size:8pt; margin:0px; margin-right:3px; vertical-align: middle; \" value='"+value+"'";
		strHTML+=" id='"+uuid+"' >";	
		strHTML+="<span style=\""+p_fontStyle+"\">"+value+"</span>";
		return strHTML;
	 }
		

/**
	 * Ajout de la checkBox devant la catégorie, pour cliquer sur tout le sous-arbre.
	 * Ecrase la function mère	 
	 */
	this.displayCheckBoxCategory=function(idNoeudPere,nbFils){
		var strHTML="<input type=checkbox "
		+" onClick='GraphicTree.checkAddCategory(\""+idNoeudPere+"\",this)'"
		+" style=\"font-size:8pt; margin:0px; margin-right:3px; vertical-align: middle; \" "
		+" id='"+idNoeudPere+"'>"
		+"<input type=hidden id='nbFils_"+idNoeudPere+"' value='"+nbFils+"'>";		

		return strHTML;
	}


	
}//END

/**
	 * onClick de la case à cocher d'une catégorie (doit cocher tout le sous-arbre)
	 */
	GraphicTree.checkAddCategory = function(iNoeudPere, checkboxPere){
		var nbFils=document.getElementById('nbFils_'+iNoeudPere).value;
		for(var i=0;i<nbFils;i++){
			var checkbox=document.getElementById(iNoeudPere+"_"+i);
			if(checkbox){
				checkbox.checked=checkboxPere.checked;//Cocher ou décocher la case
				checkbox.onclick();
			}
			//Donc descendra aussi les catégories, en cliquant les checkbox de catégories
		}
	}


	GraphicTree.private_ouvreFermeTree= function(quoi,rootPathImages){
		var div=document.getElementById(quoi);
		if(div.style.display=='block'){
			//Fermer
			div.style.display='none';
			document.getElementById("sautLigne_"+quoi).style.display='block';
			document.getElementById("img_ouvreferme_"+quoi).src=rootPathImages+'outil_tree_plus.gif';
		}else{
			//Ouvrir
			div.style.display='block';
			document.getElementById("sautLigne_"+quoi).style.display='none';
			document.getElementById("img_ouvreferme_"+quoi).src=rootPathImages+'outil_tree_moins.gif';
		}
	}

	