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,"html-tag.php","HTML标记");
	addChil(fontt,"head.php","HEAD Tag");
	addChil(fontt,"body.php","BODY Tag");
	addChil(fontt,"bgcolor.php","bgcolor");
	addChil(fontt,"background.php","background");
	}
	else if(das == "textp")
	{
	var tdr = document.getElementById("textp");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"text-properties.php","b,u,i,center,br");
	addChil(fontt,"format-html.php","hr,ur,li,ol");
   	addChil(fontt,"number.php","子弹及编号");
	addChil(fontt,"div-tag.php","h1,space,div");
	addChil(fontt,"font-pre.php","pre,font");
	addChil(fontt,"strike-power.php","罢工,力量");
	}
	else if(das == "links")
	{
	var tdr = document.getElementById("links");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"links.php","链接基础");
	addChil(fontt,"anchor-link.php","使用链接");
	addChil(fontt,"email-link.php","电子邮件链接");
	}

	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","眨眼");
	}
	else if(das == "tables")
	{
	var tdr = document.getElementById("tables");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"html-table.php","表");
	addChil(fontt,"table-border.php","表格边框");
	addChil(fontt,"table-color.php","表色");
	addChil(fontt,"table-size.php","工作台尺寸");
	addChil(fontt,"table-align.php","表对齐");
	addChil(fontt,"inner-table.php","内蒙古表");
	addChil(fontt,"colspan.php","ColSpan");
	addChil(fontt,"rowspan.php","RowSpan");
	}
	else if(das == "forms")
	{
	var tdr = document.getElementById("forms");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"form-input.php","基本类型");
	addChil(fontt,"text-field.php","文本字段");
	addChil(fontt,"form-button.php","按钮");
	addChil(fontt,"form-radiobutton.php","单选按钮 ");
	addChil(fontt,"form-checkbox.php","复选框");
	addChil(fontt,"form-textarea.php","文本 ");
	addChil(fontt,"form-combobox.php","选择框 ");
	addChil(fontt,"form-password.php","密码字段 ");
	addChil(fontt,"form-label.php","标签 ");
	}
	else if(das == "others")
	{
	var tdr = document.getElementById("others");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"specialCharacter.php","特殊字符 ");
	addChil(fontt,"redirect.php","网页重定向 ");
	addChil(fontt,"autorefresh.php","自动刷新 ");
   	addChil(fontt,"meta.php","Meta");
	addChil(fontt,"iframe.php","IFrame");
	addChil(fontt,"favicon.php","Addressbar图标 ");
	addChil(fontt,"css.php","简单的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);
}

