function FolderInit()
{
    var ie= (document.all) ? true:false;
    if (ie) 
	{
		ColWidth = document.body.scrollWidth;
    	tempColl = document.all.tags("div");
    	for (i=0; i<tempColl.length; i++) 
		{
	    	if (tempColl(i).className == "child") 
			{
			tempColl(i).style.display = "none";
			}
	    	if (tempColl(i).className == "node") 
			{		
			tempColl(i).style.width = ColWidth + 15;
			}
   		}
   	}
	else
	{
		ColWidth = document.body.scrollWidth;
		tempColl = document.getElementsByTagName("div");
		for (i=0; i<tempColl.length; i++) 
		{
	    	if (tempColl[i].className == "child") 
			{
			tempColl[i].style.display = "none";
			}
	    	if (tempColl[i].className == "node") 
			{		
			tempColl[i].style.width = ColWidth + 15;
			}
   		}
	}
}

function FolderExpand($ident)
{
	Expanda = document.getElementById($ident + "a");
	Expanda.blur();
	ExpandChild = document.getElementById($ident + "Fils");
	if (ExpandChild==null){return false;}
	if (ExpandChild.style.display == "none")
	{
		ExpandChild.style.display = "block";
		changeImages("node_"+$ident, 'images/sign_o.gif');
  }
  else 
	{
		ExpandChild.style.display = "none";
		changeImages("node_"+$ident, 'images/sign_f.gif');
	}
}

function changeImages() {
	if (document.images ) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

function FolderExpandAll() {
	var ie= (document.all) ? true:false;
    if (ie) 
	{
	    tempColl = document.all.tags("div");
	    for (i=0; i<tempColl.length; i++) {
		if (tempColl(i).className == "child") {
	            tempColl(i).style.display = "block";
	        }
	    }
	}
    else
	{
		tempColl = document.getElementsByTagName("div");
	    for (i=0; i<tempColl.length; i++) {
		if (tempColl[i].className == "child") {		
	            tempColl[i].style.display = "block";  
	        }
	    }
	}

}

function FolderCloseAll() {
    var ie= (document.all) ? true:false;
    if (ie) 
	{
	    tempColl = document.all.tags("div");
	    for (i=0; i<tempColl.length; i++) {
		if (tempColl(i).className == "child") {
	            tempColl(i).style.display = "none";
	        }
	    }
	}
	else
	{
		tempColl = document.getElementsByTagName("div");
	    for (i=0; i<tempColl.length; i++) {
		if (tempColl[i].className == "child") {
	            tempColl[i].style.display = "none";  
	        }
	    }
	}
}

function CloseAndOpenNode($ident)
{
	FolderCloseAll();
	FolderExpand($ident);
	return true;
}
