// JavaScript Documentfunction 
var h3addul=document.getElementById("colnums_nav").childNodes;
var arrh3=new Array();
var arrul=new Array();


for(var i=0; i<h3addul.length; i++)
{
	if(h3addul[i].tagName=="H3")
	{
		arrh3.push(h3addul[i]);
	}
	else if(h3addul[i].tagName=="UL")
	{
		arrul.push(h3addul[i]);		
	}
}

for(i=0;i<arrh3.length;i++)
{
	arrh3[i].son=arrul[i];
	chah3(arrh3[i]);
	arrh3[i].onclick=function()
	{
		chah3(this);
	}
}


for(j=0;j<arrul.length;j++)//新加代码，获取没给ul中的li标签。
{
	allli=arrul[j].childNodes;
	var arrli=new Array();
	for(k=0;k<allli.length;k++)
	{
		if(allli[k].tagName=="LI")
		{arrli.push(allli[k]);}
	}
	//alert(arrli.length);
	for(n=0;n<arrli.length;n++)
	{
		arrli[n].onclick=function()
		{checkli(this);}
	}
}

function checkli(ckli)//新加函数，点击li时所有的li的背景清空，被点击的li加背景！
{
	for(j=0;j<arrul.length;j++)
	{
		allli=arrul[j].childNodes;
		//alert(allli.length);
		var arrli=new Array();
		for(k=0;k<allli.length;k++)
		{
			if(allli[k].tagName=="LI")
			{arrli.push(allli[k]);}
		}
		//alert(arrli.length);
		for(n=0;n<arrli.length;n++)
		{arrli[n].className="";}
	}
	ckli.className="selected";
}


function chah3(h3obj,i)
{
	sfh3 = document.getElementById("colnums_nav").getElementsByTagName("h3");	
	if(h3obj=="fir")
	{
        if(i.length!==0)
		{chah3(sfh3[i]);}
		else
		{chah3(sfh3[0]);}
	}
	else
	{
		if(vho(h3obj.son))
		{h3obj.className="h3z";}
		else
		{h3obj.className="h3s";}
	}
}


function vnow(str){
	var sful = document.getElementById("colnums_nav").getElementsByTagName("h2");
	for (var i=0; i<sful.length; i++) {
		//if(sful[i].innerHTML.indexOf(">"+str+"<")!=-1){
		if(str!=null && str.indexOf(sful[i].id)!=-1){
			sful[i].className="h2now";
		}
	}
	
	var sfh3 = document.getElementById("colnums_nav").getElementsByTagName("h3");
	for (var i=0; i<sfh3.length; i++) {
		//if(sfli[i].son.innerHTML.indexOf(">"+str+"<")!=-1){
		if(str!=null && str.indexOf(sfh3[i].id)!=-1){
			sfh3[i].son.style.display="block";
			/**将一级栏目的加号变成打开状态*/
			sfh3[i].className="h3z";
			
			var sfli = document.getElementById("colnums_nav").getElementsByTagName("li");
			for (var i=0; i<sfli.length; i++) {
				var isson = sfli[i].getElementsByTagName("ul");
				//if(isson.length!=0&&isson[0].innerHTML.indexOf(">"+str+"<")!=-1){
				if(isson.length!=0&&isson[0].innerHTML.indexOf(str)!=-1){
					var issnow = isson[0].getElementsByTagName("li");
					for(var j=0;j<issnow.length;j++){
						if(issnow[j].innerHTML.indexOf(">"+str+"<")!=-1){
							issnow[j].className="this_now";
						}
					}
					isson[0].style.display='block'
					sfli[i].getElementsByTagName("h4")[0].className="h4now";
				//}else if(isson.length==0&&sfli[i].innerHTML.indexOf(">"+str+"<")!=-1){
				}else if(isson.length==0&&sfli[i].id==str){
					sfli[i].className="this_now";
				}
			}
			
		}
	}
	

}
//展开所有二级页
//chah3("all");
