var as = 1;
var fontt;
function addChilds(das)
{
	var nam =das;

	if(das == "format")
	{
	var tdr = document.getElementById("format");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"style-types.php","Style Types");
	addChil(fontt,"universel.php","Universel");
	addChil(fontt,"identifiers.php","Identifiers");
	addChil(fontt,"userdefined.php","UserDefined");
	addChil(fontt,"externe.php","Externe CSS");
	}
	else if(das == "backp")
	{
	var tdr = document.getElementById("backp");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"color.php","Color");
	addChil(fontt,"couleur-de-fond.php","Couleur de Fond");
	addChil(fontt,"image-de-fond.php","Image de Fond");
	addChil(fontt,"background-repeat.php","Background Repeat");
	addChil(fontt,"position-de-fond.php","Position de Fond");
	addChil(fontt,"bg-attachment.php","BG Attachment");
	}
	else if(das == "textp")
	{
	var tdr = document.getElementById("textp");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"espacement-de-mot.php","Espacement de Mot");
	addChil(fontt,"espacement-de-la-lettre.php","Espacement de la Lettre");
	addChil(fontt,"texte-decoration.php","Texte Decoration");
	addChil(fontt,"vertical-align.php","Vertical Align");
	addChil(fontt,"texte-transform.php","Texte Transform");
	addChil(fontt,"texte-align.php","Texte Align");
	addChil(fontt,"retrait-de-texte.php","Retrait de Texte");
	addChil(fontt,"hauteur-de-ligne.php","Hauteur de Ligne");
	}
	else if(das == "fontp")
	{
	var tdr = document.getElementById("fontp");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"style-de-police.php","Style de Police");
	addChil(fontt,"font-poids.php","Font Poids");
	addChil(fontt,"taille-de-police.php","Taille de Police");
	addChil(fontt,"famille-de-polices.php","Famille de Polices");
	}
	else if(das == "borderp")
	{
	var tdr = document.getElementById("borderp");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"couleur-de-la-bordure.php","Couleur de la Bordure");
	addChil(fontt,"largeur-de-la-bordure.php","Largeur de la Bordure");
	addChil(fontt,"style-de-bordure.php","Style de Bordure");
	addChil(fontt,"bordure-de-cote.php","Bordure de Côté");
	addChil(fontt,"bordure.php","Bordure");
	}
	else if(das == "marginp")
	{
	var tdr = document.getElementById("marginp");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"haut-de-marge.php","Haut de Marge");
	addChil(fontt,"marge-de-gauche.php","Marge de Gauche");
	addChil(fontt,"marge-inferieure.php","Marge Inferieure");
	addChil(fontt,"marge-de-droite.php","Marge de Droite");
	addChil(fontt,"marge.php","Marge");
	}
	else if(das == "paddingp")
	{
	var tdr = document.getElementById("paddingp");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"rembourrage-superieur.php","Rembourrage Supérieur ");
	addChil(fontt,"rembourrage-gauche.php","Rembourrage Gauche");
	addChil(fontt,"rembourrage-inferieur.php","Rembourrage Inférieur");
	addChil(fontt,"rembourrage-droit.php","Rembourrage Droit");
	addChil(fontt,"rembourrage.php","Rembourrage");
	}
	else if(das == "others")
	{
	var tdr = document.getElementById("others");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"lien-styles.php","Lien Styles");
	addChil(fontt,"mouse-over-effect.php","onMouseOver Effect");
	addChil(fontt,"tableau-defilable.php","Tableau Défilable");
	addChil(fontt,"curseur-types.php","Curseur Types");
	addChil(fontt,"commentaire-css.php","CSS Commentaire");
	}

}

function removeChilds(fontt)
{
	if(fontt != null)
	{
		while(fontt.hasChildNodes() && fontt.childNodes.length> 1)
		{	
		if(as > 1)
		{
		fontt.removeChild(fontt.lastChild);
		}
		as = as+1;
		}
	}
}

var love = "yes";
function addChil(parent,linkname,textname)
{

var breaka = document.createElement("br");
var divs= document.createElement("div");
var link = document.createElement("a");
link.setAttribute("href",linkname);
link.style.color="#aa300a";
divs.style.marginLeft="8px";
divs.style.marginRight="4px";
divs.style.paddingLeft="3px";
divs.style.fontSize="11px";
divs.style.lineHeight="16px";
divs.style.border="0px green solid";

if(love == "yes")
{
divs.style.backgroundColor="#beefec";
love = "no";
}
else
{
divs.style.backgroundColor="#dfffdf";
love = "yes";
}
link.style.textDecoration="none";
//link.setAttribute("style","background-color: white;");

var name = document.createTextNode(textname);
//parent.appendChild(breaka);
parent.appendChild(divs);
divs.appendChild(link);
link.appendChild(name);
}

