var as = 1;
var fontt;
function addChilds(das)
{
	var nam =das;
        if(das == "main")
	{
	var tdr = document.getElementById("main");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"main.php","HTML Tag");
	addChil(fontt,"head.php","HEAD Tag");
	addChil(fontt,"body.php","BODY Tag");
	addChil(fontt,"bgcolor.php","Bgcolor");
	addChil(fontt,"hintergrund-bild.php","Hintergrund Bild");
	}
	else if(das == "textp")
	{
	var tdr = document.getElementById("textp");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"text-bold.php","b,u,i,center,br");
	addChil(fontt,"text-hr.php","hr,ur,li,ol");
	addChil(fontt,"text-space.php","h1,space,div");
	addChil(fontt,"text-font.php","pre,font");
	addChil(fontt,"text-strike.php","strike,power");
	}
	else if(das == "links")
	{
	var tdr = document.getElementById("links");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"links.php","Link Grundlagen");
	addChil(fontt,"links-verwenden.php","Links Verwenden");
	addChil(fontt,"email-link.php","Email Link");
	}

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

	addChil(fontt,"marquee1.php","Marquee 1");
	addChil(fontt,"marquee2.php","Marquee 2");
	addChil(fontt,"blink.php","Blink");
	}
	else if(das == "tables")
	{
	var tdr = document.getElementById("tables");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"tabellen.php","Tabellen");
	addChil(fontt,"tabellen-rahmen.php","Tabelle-Rahmen");
	addChil(fontt,"tabellen-farbe.php","Tabellen Farbe");
	addChil(fontt,"tabellen-grosse.php","Tabellen Grösse");
	addChil(fontt,"tabellen-anpassen.php","Tabellen Anpassen");
	addChil(fontt,"innere-tabelle.php","Innere Tabelle");
	addChil(fontt,"colspan.php","Col Span");
	addChil(fontt,"rowspan.php","Row Span");
	}
	else if(das == "forms")
	{
	var tdr = document.getElementById("forms");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"form-typen.php","Basic Typen");
	addChil(fontt,"text-felder.php","Text Felder");
	addChil(fontt,"form-knopfe.php","Knöpfe");
	addChil(fontt,"form-radiobutton.php","Radio Button");
	addChil(fontt,"form-checkbox.php","CheckBox");
	addChil(fontt,"form-textbereich.php","Text Bereich");
	addChil(fontt,"form-combobox.php","Select Box");
	addChil(fontt,"passwort.php","Passwort Field");
	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,"sonderzeichen.php","Sonderzeichen");
	addChil(fontt,"umleiten.php","Umleiten");
	addChil(fontt,"autorefresh.php","Auto Refresh");
	addChil(fontt,"iframe.php","IFrame");
	addChil(fontt,"favicon.php","AddressBar Icon");
	addChil(fontt,"einfach-css.php","Einfach CSS");
	}
	
}

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