
<!--Keeping layer is motionless-->
	xSite=0;
	ySite=0;
	mVisible=false;
	myInterval=0;
	mLock=false
	function start()
	{
		if (navigator.appName == "Netscape")
		{
			style_logo = "document.ProductIndex";
			xOffset = "self.innerWidth - xSite-550 ";
			yOffset = "self.innerHeight + self.pageYOffset - ySite "; 
			myInterval=setInterval('AdjustLayerPosition()',10);
		}
		else
		{
			style_logo = "document.all.ProductIndex.style";
			xOffset = "document.body.offsetWidth - xSite-550";
			yOffset = "document.body.scrollTop - ySite";
			window.onscroll = function(){ScrollWindow()};
			window.onresize = function(){ScrollWindow()};
			//display the layer
			ShowProdIndex();
			//Launch the branch of the last time
			var mLastTreeNode=document.getElementById(parent.frames.fraToolbar.LastTreeNode);
			var mLastTreeNodePic=document.getElementById(parent.frames.fraToolbar.LastTreeNodePic);
			if (mLastTreeNode!=null && mLastTreeNodePic!=null)
			{			
				if (mLastTreeNode.style.display=='none')
				{
					ExpandTreeNode(mLastTreeNode,mLastTreeNodePic);
				}
			}
		}
		mVisible=true;
	}

	function ScrollWindow()
	{
		if (mLock==true)
		{
			if (mVisible==true)
			{
				ShowProdIndex();
			}
		}
		else
		{
			HideProdIndex();
		}
	}
	
	//display the layer
	function ShowProdIndex()
	{
		eval(style_logo + ".display = " + "''");				
		eval(style_logo + ".left = " + xOffset);
		eval(style_logo + ".top = " + yOffset); 
	}
	
	//hidden the layer
	function HideProdIndex()
	{
		var t2=document.getElementById('ProductIndex');
		t2.style.display='none';
		clearInterval(myInterval);
		mVisible=false;
	}
	
	function LockButton(mStyle,mButton)
	{
		switch (mStyle)
		{
			case "Click":
				mLock=!mLock
				if (mLock==true)
				{
					mButton.title="In locked state";
					mButton.src="/china/ToolBar/Images/Lock_Leave.gif";
				}
				else
				{
					mButton.title="In hidden state";
					mButton.src="/china/ToolBar/Images/UnLock_Leave.gif";
				}
			case "onMouseMove":
				mButton.style.border="1px solid #5c5c5c";
				break;
			case "onMouseLeave":
				mButton.style.border="1px solid #FFFFFF";
				break;
			default:
				break;
		}
	}
	
	function CloseButton(mStyle,mButton)
	{
		switch (mStyle)
		{
			case "onMouseMove":
				mButton.style.border="1px solid #5c5c5c";
				break;
			case "onMouseLeave":
				mButton.style.border="1px solid #FFFFFF";
				break;
			default:
				break;
		}
	}
	
	//Open or close the node
	function ExpandTreeNode(ThisTreeNode,ThisTreeNodePic)
	{
		if (ThisTreeNode!=null)
		{
			if (ThisTreeNode.style.display=='none')
			{//open the node
				//The node of the close last time
				var mLastTreeNode=document.getElementById(parent.frames.fraToolbar.LastTreeNode);
				var mLastTreeNodePic=document.getElementById(parent.frames.fraToolbar.LastTreeNodePic);
				if(mLastTreeNode!=null) 
					mLastTreeNode.style.display="none";					
				if(mLastTreeNodePic!=null) 
					mLastTreeNodePic.src="/china/toolbar/images/StatClose.gif";
					
				//Keep the node of this time
				parent.frames.fraToolbar.LastTreeNode=ThisTreeNode.id;
				parent.frames.fraToolbar.LastTreeNodePic=ThisTreeNodePic.id;
				
				//Launch the node of this time
				ThisTreeNode.style.display='';
				ThisTreeNodePic.src="/china/toolbar/images/StatOpen.gif";
			}
			else
			{//close node
				ThisTreeNode.style.display='none';
				ThisTreeNodePic.src="/china/toolbar/images/StatClose.gif";			
				//Keep the node of this time
				parent.frames.fraToolbar.LastTreeNode="";
				parent.frames.fraToolbar.LastTreeNodePic="";
			}
		}
		//Adjust the size of the layer
		var t1=document.getElementById('ProductIndex_Tree1').clientHeight;
		var t2=document.getElementById('ProductIndex_Tree2').clientHeight;
		var t3=document.getElementById('ProductIndex_Tree3').clientHeight;
		var t4=document.getElementById('ProductIndex').clientHeight;
		var w1=document.body.clientHeight-80
		if ((t1<w1 && t2<w1 && t3<w1)|| t4<(w1+80))
		{
			document.getElementById('ProductIndex_Tree1').style.height="100%";
			document.getElementById('ProductIndex_Tree2').style.height="100%";
			document.getElementById('ProductIndex_Tree3').style.height="100%";
		}
		else
		{
			document.getElementById('ProductIndex_Tree1').style.height=w1;
			document.getElementById('ProductIndex_Tree2').style.height=w1;
			document.getElementById('ProductIndex_Tree3').style.height=w1;
		}
		
	}
