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

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

	addChil(fontt,"audio.php"," Audio" );
	addChil(fontt,"video.php","Video");
	
	}
	
if(das == "main")
	{
	var tdr = document.getElementById("main");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"etiquetas-html.php","Etiquetas Html");
	addChil(fontt,"etiquetas-de-cabecera.php","Etiquetas de Cabecera");
	addChil(fontt,"etiquetas-del-cuerpo.php","Etiquetas del Cuerpo");
	addChil(fontt,"color-de-fondo.php","Color de fondo");
	addChil(fontt,"fondo.php","Fondo");
	}
	else if(das == "textp")
	{
	var tdr = document.getElementById("textp");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"propiedades-de-texto.php","b,u,i,center,br");
	addChil(fontt,"manipulacion-de-texto.php","hr,ur,li,ol");
	addChil(fontt,"texto-manipulacion.php","h1,espacio,div");
	addChil(fontt,"fuentes-pre-cpdigo.php","pre,fuente");
	addChil(fontt,"golpe-poder-strike.php","golpe,poder strike,power");
	}
	else if(das == "links")
	{
	var tdr = document.getElementById("links");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"hipervinculos-basicos.php","Hipervínculos Basicos");
	addChil(fontt,"usando-hipervinculos.php","Usando Hipervinculos");
	addChil(fontt,"hipervinculo-de-correo-electronico.php","Hipervinculo de correo electronico");
	}

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

	addChil(fontt,"marquesina1.php","Marquesina 1");
	addChil(fontt,"marquesina2.php","Marquesina 2");
	addChil(fontt,"destellado.php","Destellado");
	}
	else if(das == "tables")
	{
	var tdr = document.getElementById("tables");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"tablas1.php","Tablas");
	addChil(fontt,"bordes-de-tablas.php","Bordes de Tablas");
	addChil(fontt,"colr-de-tabla-color.php","Colr de Tabla Color");
	addChil(fontt,"medida-de-tabla.php","Medida de Tabla");
	addChil(fontt,"alineamiento-de-tabla.php","Alineamiento de Tabla");
	addChil(fontt,"tabla-interna.php","Tabla interna");
	addChil(fontt,"abarcar-columna.php","Abarcar Columna");
	addChil(fontt,"abarcar-fila.php","Abarcar Fila");
	}
	else if(das == "forms")
	{
	var tdr = document.getElementById("forms");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"tipos-de-forma.php","Tipos de Forma");
	addChil(fontt,"campos-de-texto.php","Campos de Texto");
	addChil(fontt,"botones.php","Botones");
	addChil(fontt,"radio-botones.php","Radio Botones");
	addChil(fontt,"cajilla-de-verificacion.php","Cajilla de verificación");
	addChil(fontt,"area-de-texto.php","Area de Texto");
	addChil(fontt,"cajilla-de-seleccion.php","Cajilla de Selección");
	addChil(fontt,"Contrasena.php","Contraseña");
	addChil(fontt,"label.php","Label");
	}
	else if(das == "others")
	{
	var tdr = document.getElementById("others");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"caracteres-especiales.php","Caracteres Especiales");
	addChil(fontt,"redireccionamiento.php","Redireccionamiento");
	addChil(fontt,"auto-actualizacion.php","Auto Actualizacion");
	addChil(fontt,"marco-incorporado.php","Marco Incorporado");
	addChil(fontt,"barra-de-direcciones.php","Barra de Direcciones");
	addChil(fontt,"css.php","Simple CSS");
	}


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

	addChil(fontt,"frameset.php","Frameset");
	addChil(fontt,"inline-frame.php","Inline frames");
	}
	else if(das == "images")
	{
	var tdr = document.getElementById("images");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"image-map.php","Image maps");
	addChil(fontt,"img-button.php","Image button");
	}

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

	addChil(fontt,"phrase.php","Phrase tag");
	addChil(fontt,"acron.php","Acronynm tag");
	addChil(fontt,"anchor.php","Anchor tag");
	}

}

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

