// JavaScript Document


//----------------------------------------------------------------------------------
//方 法 名：LeftMenuChangHeadBGColor()
//方法说明：窗体中左边栏目加载时如果有选中的项,修改此项的背景颜色
//----------------------------------------------------------------------------------
function LeftMenuChangHeadBGColor(strLMHeadItemNo)
{
	/*
		参  数：strLMHeadItemNo -- 当前选中项的号码
		返回值：
	*/
	
	window.document.all("tdLMHead_" + strLMHeadItemNo).bgColor = "#FFFFFF";
}

//----------------------------------------------------------------------------------
//方 法 名：SetLinkStyle()
//方法说明：设置选中的超链接的样式
//----------------------------------------------------------------------------------
function SetLinkStyle(strPCID)
{
	/*
		参  数：strPCID -- 当前超链接的ID，使用此ID修改字体及背景
		返回值：
	*/

	//window.document.all("tdPCID_" + strPCID).bgColor = "#FFFFFF";
	window.document.all("tdPCID_" + strPCID).style.color      = "#FF6F29";
}


//----------------------------------------------------------------------------------
//方 法 名：LeftMenuLoad()
//方法说明：产品部分窗体中左边栏目加载
//----------------------------------------------------------------------------------
function LeftMenuLoad(strTdID,strPCID)
{
	/*
		参  数：strTdID -- 当前展开的Td的ID
			  ：strPCID -- 当前超链接的ID，使用此ID修改字体及背景
		返回值：
	*/

	var strTmp = "";
	
	strProductLeftMenuPCID = strPCID;
	
	//window.document.all(strTdID,"0").style.display = "";
	window.document.all(strTdID).style.display = "";

	strTmp = strTdID.substr(strTdID.length - 1,strTdID.length);
	//设置选中的二级菜单的字体颜色
	//window.document.all(strTdID,"0").style.color = "da4d00";
	//window.document.all(strTdID,"0").style.color = "red";

	LeftMenuChangHeadBGColor(strTmp);
	
	//if(window.document.all("tdPCID_" + strPCID,"0") != null)
	if(window.document.all("tdPCID_" + strPCID) != null)
	{
		SetLinkStyle(strPCID);
	}
}

//----------------------------------------------------------------------------------
//方 法 名：OnClickControlLeftMenu()
//方法说明：控制页面中左边栏目的显示和隐藏效果，并且设置选中项的背景色
//----------------------------------------------------------------------------------
function OnClickControlLeftMenu(strTdID,strNum,strLMHeadID)
{
	/*
		参  数：strTdID -- 当前选中的ID
		      ：strNum  -- 当前选中为某个td的号码
		      ：strLMHeadID -- 每个菜单头的ID（例如：DVB系列产品,安防系列产品）,此ID控制每个选中菜单的背景颜色
		返回值：
	*/

	var intCount = strNum;
	
	for(var i = 0; i < intCount; i++)
	{
		if(("tdLeftMenu_" + i) != strTdID)
		{
			//window.document.all("tdLeftMenu_" + i,"0").style.display = "none";
			window.document.all("tdLeftMenu_" + i).style.display = "none";
		}
		//设置非选中项的每个背景为空
		if(("tdLMHead_" + i) != strLMHeadID)
		{
			//window.document.all("tdLMHead_" + i,"0").bgColor = "#ffffff";
			window.document.all("tdLMHead_" + i).bgColor = "#f6f6f6";
		}
	}
	
	//此处控制菜单可以全部隐藏
	//if(window.document.all(strTdID,"0").style.display == "")
	if(window.document.all(strTdID).style.display == "")
	{
		//window.document.all(strTdID,"0").style.display = "none";
		//window.document.all(strLMHeadID,"0").bgColor   = "#ffffff";
		window.document.all(strTdID).style.display = "none";
		window.document.all(strLMHeadID).bgColor   = "#f6f6f6";
	}
	else
	{
		//window.document.all(strTdID,"0").style.display = "";
		//window.document.all(strLMHeadID,"0").bgColor   = "#f6f6f6";
		window.document.all(strTdID).style.display = "";
		window.document.all(strLMHeadID).bgColor   = "#ffffff";
	}
}
