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,"estableciendo-estilos.php","Tipos de estilo");
	addChil(fontt,"universal.php","Universal");
	addChil(fontt,"identificadores.php","Identificadores");
	addChil(fontt,"definidos-por-el-usuario.php","Definidos por el Usuario");
	addChil(fontt,"hojas-de-estilo-exterior.php","CSS externos");
	}
	else if(das == "backp")
	{
	var tdr = document.getElementById("backp");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"texto-color.php","Color");
	addChil(fontt,"fondo-color.php","Color de fondo");
	addChil(fontt,"imagen-fondo.php","Imagen de Fondo");
	addChil(fontt,"fondo-repeticion.php","Repetición del Fondo");
	addChil(fontt,"fondo-posicion.php","Posición del Fondo");
	addChil(fontt,"fondo-adjuncion.php","BG Adjunción");
	}
	else if(das == "textp")
	{
	var tdr = document.getElementById("textp");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"palabra-espaciamiento.php","Espaciado palabra");
	addChil(fontt,"espacio-entre-caracteres.php","Espacio entre Caracteres");
	addChil(fontt,"decoracion-del-texto.php","Decoración del Texto");
	addChil(fontt,"alineacion-vertical.php","Alineación Vertical");
	addChil(fontt,"transformacion-de-texto.php","Transformación de Texto");
	addChil(fontt,"alineacion-de-texto.php","Alineación de Texto");
	addChil(fontt,"texto-tabulado.php","Texto Tabulado");
	addChil(fontt,"altura-de-linea.php","Altura de Línea");
	}
	else if(das == "fontp")
	{
	var tdr = document.getElementById("fontp");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"fuente-estilo.php","Estilo de Fuente");
	addChil(fontt,"fuente-peso.php","Fuente Peso");
	addChil(fontt,"tamano-fuente.php","Tamaño de Fuente");
	addChil(fontt,"familia-fuente.php","Familia de fuentes");
	}
	else if(das == "borderp")
	{
	var tdr = document.getElementById("borderp");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"color-del-borde.php","Color del borde");
	addChil(fontt,"ancho-del-borde.php","Ancho del Borde");
	addChil(fontt,"estilo-del-borde.php","Estilo del Borde");
	addChil(fontt,"borde-lateral.php","Borde Lateral");
	addChil(fontt,"borde.php","Bordes");
	}
	else if(das == "marginp")
	{
	var tdr = document.getElementById("marginp");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"margen-superior.php","Margen superior");
	addChil(fontt,"margen-izquierda.php","Margen izquierda");
	addChil(fontt,"margen-inferior.php","Margen inferior");
	addChil(fontt,"margen-derecho.php","Margen derecha");
	addChil(fontt,"margen.php","Margen");
	}
	else if(das == "paddingp")
	{
	var tdr = document.getElementById("paddingp");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"relleno-superior.php","Relleno Superior");
	addChil(fontt,"relleno-izquierda.php","Relleno izquierda");
	addChil(fontt,"relleno-inferior.php","Relleno Inferior");
	addChil(fontt,"relleno-derecha.php","Relleno Derecha");
	addChil(fontt,"relleno.php","Relleno");
	}
	else if(das == "others")
	{
	var tdr = document.getElementById("others");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"enlace-estilos.php","Enlace Estilos");
	addChil(fontt,"efecto-mouseover.php","Efectos onMouseover");
	addChil(fontt,"desplazable-table.php","Desplazable Table");
	addChil(fontt,"cursor-tipos.php","Tipos de cursor");
	addChil(fontt,"css-comentario.php","CSS comentario");
	}

}

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);
}