leftree.js 3.14 KB
/*left-js*/
function showsubmenu(sid)
{
	var whichEl = document.getElementById("submenu" + sid);
	var subm=document.getElementById("showmenu"+sid);
	if (whichEl.style.display !== "block")
	{
		whichEl.style.display = "block";
		
		subm.style.backgroundImage='url(images/left_tt.gif)';
	}
	else
	{
		whichEl.style.display = "none";
		subm.style.backgroundImage='url(images/left_t.gif)';
	}
}
function showtwomenu(num)
{
	if(num !== null)
	{
		var whichE = document.getElementById("twomenu" + num).style.display;
		var contents = document.getElementById("twomenu" + num).id;
		var subm=document.getElementById("shtmu"+num);
		if (whichE !== "block")
		{
			document.getElementById("twomenu" + num).style.display="block";
			document.getElementById('shtmu' + num).className = "twomenu";
			subm.className="showmu1";
		}
		else
		{
			document.getElementById("twomenu" + num).style.display="none";
			document.getElementById('shtmu' + num).className = "twomenu_on";
			subm.className="showmu2";
		}	
	}else
	{
		return;
	}
	
}
/*չ���˵�*/
function openmenu()
{
	var act=document.getElementsByTagName("active");
	var divFF = document.getElementsByTagName("li");
	for (i=0; i<divFF.length; i++) 
	{
		if(divFF[i].className == "active" || divFF[i].className == " active")
		{ 
			divFF[i].parentNode.parentNode.parentNode.style.display="block";
			
			divFF[i].parentNode.parentNode.style.display="block";
			
			divFF[i].parentNode.style.display="block";
			
			divFF[i].style.backgroundColor = "#3ba4f5";
			
			divFF[i].firstChild.style.color='#ffffff';
			
		}
		
		if(divFF[i].className == "showmu1 active")
		{ 
			divFF[i].parentNode.style.display="block";
			
			divFF[i].style.background = "none";
			
			divFF[i].style.backgroundColor = "#3ba4f5";
			
			divFF[i].firstChild.style.color='#ffffff';
			
		} 
		
	}
}

/*main*/
var  highlightcolor='#c1ebff';
//�˴�clickcolorֻ����winϵͳ��ɫ������ܳɹ�,�����#xxxxxx�Ĵ���Ͳ���,��û�����Ϊʲô:(
var  clickcolor='#51b2f6';
function  changeto(){
source=event.srcElement;
if  (source.tagName=="TR"||source.tagName=="TABLE")
return;
while(source.tagName!="TD")
source=source.parentElement;
source=source.parentElement;
cs  =  source.children;
//alert(cs.length);
if  (cs[1].style.backgroundColor!=highlightcolor&&source.id!="nc"&&cs[1].style.backgroundColor!=clickcolor)
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor=highlightcolor;
}
}

function  changeback(){
if  (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="nc")
return
if  (event.toElement!=source&&cs[1].style.backgroundColor!=clickcolor)
//source.style.backgroundColor=originalcolor
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor="";
}
}

function  clickto(){
source=event.srcElement;
if  (source.tagName=="TR"||source.tagName=="TABLE")
return;
while(source.tagName!="TD")
source=source.parentElement;
source=source.parentElement;
cs  =  source.children;
//alert(cs.length);
if  (cs[1].style.backgroundColor!=clickcolor&&source.id!="nc")
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor=clickcolor;
}
else
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor="";
}
}