	// JavaScript Document
	var obsidianNormal, obsidianHover;
	var porcelainLeft, porcelainMiddle, porcelainRight;
	var porcelain2Left, porcelain2Middle, porcelain2Right;
	var selectedObsidianID = '';
	var firstObsidianID = '';
	var navTimer, navTimerRunning = false;
	var oTimer, oTimerRunning = false;
	var p2Timer, p2timerRunning = false;
	var porcelainOnID = '';
	var pageloaded = false;

	function $_getID(id)
	{
		return document.getElementById(id);
	}

	function obsidianMouseOver(obsidianID)
	{
		if (pageloaded)
		{
			if (porcelainOnID != '')
				turnOff();
			oTimer = setTimeout('obsidianOn(\'' + obsidianID + '\')',150);
			oTimerRunning = true;
		}
	}
	function obsidianOn(obsidianID)
	{
		var oldIndex = parseInt(selectedObsidianID.replace('obsidian',''))-1;
		var newIndex = parseInt(obsidianID.replace('obsidian',''))-1;
	  
		// unselect currently selected
		if (selectedObsidianID != null && selectedObsidianID != '')
		{
			var selectedObsidian = $_getID(selectedObsidianID);
			var selectedPorcelain = $_getID(selectedObsidianID.replace('obsidian','porcelainContent'));
			selectedObsidian.src = obsidianNormal[oldIndex].src;
			selectedPorcelain.className = 'menuhide';
		}
		// select new
		if (selectedObsidianID != null && selectedObsidianID != '')
		{
			var obsidianImage = $_getID(obsidianID);
			var porcelainContentID = obsidianID.replace('obsidian','porcelainContent');
			var porcelainContent = $_getID(porcelainContentID);
			
			obsidianImage.src = obsidianHover[newIndex].src;
			porcelainContent.className = 'menushow';
			alignPorcelainContent(obsidianID,porcelainContentID);
			selectedObsidianID = obsidianID;
		}
	}

	function obsidianMouseOut(obsidianID)
	{
		if (oTimerRunning)
			clearTimeout(oTimer);
		oTimerRunning = false;
	}
	function porcelainMouseOver(porcelainID, contentID)
	{
		if (porcelainOnID != '')
			turnOff();
		// hover button
		var selectedPorcelain = $_getID(porcelainID);
		//alert(selectedPorcelain.className);
		if (selectedPorcelain.className != 'hover')
		{
			selectedPorcelain.className = 'hover';
			handleDividerImages(porcelainID,true);
		}
			// display flyout if neccessary
			var flyout = $_getID(porcelainID + '_FlyOut');
			if (flyout != null)
			{
				flyout.className = 'porcelain2show';
				// orientation flyout location
				var offsetTop = selectedPorcelain.offsetTop; 
				var offsetLeft = selectedPorcelain.offsetLeft; 
				var offsetWidth = selectedPorcelain.offsetWidth; 
				var offsetHeight = selectedPorcelain.offsetHeight; 
				while(selectedPorcelain = selectedPorcelain.offsetParent) 
				{ 
					offsetTop += selectedPorcelain.offsetTop; 
					offsetLeft += selectedPorcelain.offsetLeft; 
				}
				
				flyout.style.left = offsetLeft + "px";
				flyout.style.top = (offsetTop + offsetHeight -3) + "px";

				porcelainOnID = porcelainID;
			}
	}

	function porcelainMouseOut(porcelainID)
	{
		var flyout = $_getID(porcelainID + '_FlyOut');
		//alert(flyout);
		if (flyout == null)
		{
			// unhover button
			var selectedPorcelain = $_getID(porcelainID);
			//alert(selectedPorcelain.className);
			if (selectedPorcelain.className == 'hover')
			{
				selectedPorcelain.className = '';
				handleDividerImages(porcelainID,false);
			}
		}
		else
		{
			p2Timer = setTimeout("turnOff()",500);
			p2timerRunning = true;
		}
	}
	function porcelain2MouseOver(porcelain2ID, parentID)
	{
		if (p2timerRunning)
			clearTimeout(p2Timer);
		porcelainOnID = parentID;
		var item = $_getID(porcelain2ID);
		item.className = 'porcelain2itemselected';
	}
	function porcelain2MouseOut(porcelain2ID)
	{
		p2Timer = setTimeout("turnOff()",500);
		p2timerRunning = true;
		var item = $_getID(porcelain2ID);
		item.className = 'porcelain2item';
	}
	function turnOff()
	{
		if (p2timerRunning)
			clearTimeout(p2Timer);
		// unhover button
		var selectedPorcelain = $_getID(porcelainOnID);
		if (selectedPorcelain != null)
		{
			if (selectedPorcelain.className != 'porcelainitemcurrent')
			{
				selectedPorcelain.className = 'porcelainitem';
				handleDividerImages(porcelainOnID,false);
			}
		}
		// hide flyout
		var flyout = $_getID(porcelainOnID + '_FlyOut');
		if (flyout != null)
			flyout.className = 'porcelain2hide';
		porcelainOnID = '';
		p2timerRunning = false;
	}

	function handleDividerImages(porcelainID,turnOff,expireState)
	{
		var porcelainItem = $_getID(porcelainID);
		var dividerAfterID = porcelainID.replace('_porcelain','_divider');
		var pIndex = parseInt(dividerAfterID.substring(dividerAfterID.length - 1, dividerAfterID.length));
		var from = '_divider' + pIndex;
		var to = pIndex - 1;
		to = '_divider' + to;
		var dividerBeforeID = dividerAfterID.replace(from,to);
		
		var firstDivider, secondDivider;
		var visValue = 'visible';
		var disValue = 'inline';
		if (turnOff)
		{
			visValue = 'hidden';
			disValue = 'none';
		}
		if (firstDivider = $_getID(dividerBeforeID))
		{
			if (firstDivider.className != 'expired')
			{
				firstDivider.style.visibility = visValue;
			}
			if (expireState) { firstDivider.className = 'expired'; }
			else { firstDivider.style.display = disValue; }
		}
		if (secondDivider = $_getID(dividerAfterID))
		{
			if (secondDivider.className != 'expired')
			{
				secondDivider.style.visibility = visValue;
			}
			if (expireState) { secondDivider.className = 'expired'; }
			else { secondDivider.style.display = disValue; }
		}
	}

		
		function SelectMenu(menuItem, subMenuId)
        {
            // 如果是点击的已经选中的菜单，则不做任何事
            //
            if (document.getElementById("txtSelectedMenuId").value == menuItem.id)
                return;

            menuItem.className = "Current";
            for(i = 0;i<document.getElementById("SubMenu").childNodes.length;i++)
            {
                document.getElementById("SubMenu").childNodes[i].className = "submenuLayerHide";
            }
            document.getElementById(subMenuId).className = "submenuLayerShow";
            
            if (document.getElementById("txtSelectedMenuId").value.length > 0)
                document.getElementById(document.getElementById("txtSelectedMenuId").value).className = "";
                
            document.getElementById("txtSelectedMenuId").value = menuItem.id;
        }
        
        function MouseOver(menuItem)
        {
            if (document.getElementById("txtSelectedMenuId").value == menuItem.id)
                return;
                
            menuItem.className = "hover";
           // menuItem.childNodes[0].className = "hoverspan";
        }
        
        function MouseOut(menuItem)
        {
            if (document.getElementById("txtSelectedMenuId").value == menuItem.id)
                return;
                
            menuItem.className = "";
            //menuItem.childNodes[0].className = "";
        }
        
        function SubmenuMouseOver(menuItem, subMenuId)
        {
            menuItem.className = "hover";
            
            if (subMenuId == '')
                return;
            
            var subMenu = document.getElementById(subMenuId);
            if (subMenu == null)
                return;
            
            var offsetTop = menuItem.offsetTop; 
            var offsetLeft = menuItem.offsetLeft; 
            var offsetWidth = menuItem.offsetWidth; 
            var offsetHeight = menuItem.offsetHeight; 
            while( menuItem = menuItem.offsetParent ) 
            { 
                offsetTop += menuItem.offsetTop; 
                offsetLeft += menuItem.offsetLeft; 
            }
            
            subMenu.style.left = offsetLeft + "px";
            subMenu.style.top = (offsetTop + offsetHeight - 3) + "px";
            subMenu.className = "porcelain2show"; 
            
        }
        
        function SubmenuMouseOut(menuItem)
        {
            menuItem.className = "";
        }

		function leftList(thisID,thisImgID)
		{
			thisID = document.getElementById(thisID);
			// thisImgID = document.getElementById(thisImgID);
			if (thisID.style.display == 'none')
			{
				thisID.style.display = '';
				//thisImgID.src = "../images/splitbar_collapse_h.gif";
				//document.getElementById("top_001").style.display = '';
				//document.getElementById("top_002").style.display = '';
			}
			else
			{
				thisID.style.display = 'none';s
				//document.getElementById("top_001").style.display = 'none';
				//document.getElementById("top_002").style.display = 'none';
				//thisImgID.src = "../images/splitbar_expand_h.gif";
			}
		}
		
		function callLeftTree(obj,submenuSum)
		{
			var submenuSumLayer = document.getElementById(submenuSum);
			if (submenuSumLayer.className != 'BasicinfoShow')
			{
				submenuSumList =7;//document.getElementById('tree').getElementsByTagName('div').length + 1;
				submenuSumLayer.className = 'BasicinfoShow';
				for (i=1;i<submenuSumList ;i++ )
				{	
					var submenuSumthis = 'MenuList_' + i;
					if (submenuSum != submenuSumthis)
					{
						var submenuSumthis = document.getElementById(submenuSumthis);
						submenuSumthis.className = 'BasicinfoHide';
					}
				}
			}
			else
			{
			    submenuSumLayer.className = 'BasicinfoHide';
			}
			//Sub menu background change;
			if ($(".treeview_focus").size()>0) {
		        //$(".treeview_focus").addClass("treeview_unfocus");
		        $(".treeview_focus").attr("class","treeview_unfocus");
		        
		    }
			var subMenuTD = document.getElementById(obj);
			subMenuTD.className = 'treeview_focus';
			
		}
		
		function callDivList(submenuSum)
		{		    		    
		    var arr=submenuSum.split(','); 
		    for(i=0;i<arr.length;i++)
		    {
		        var submenuSumLayer = document.getElementById(arr[i]);
			    if (submenuSumLayer.className != 'BasicinfoShow')
			    {
				    submenuSumLayer.className = 'BasicinfoShow';
			    }
			    else
			    {
			        submenuSumLayer.className = 'BasicinfoHide';
			    }
		    }
		    
		}

		function thisMenuStyleChange(menuID,thisID)
		{		    		    
			var menuID = $_getID(menuID);
			//alert(menuID);
			
			var menuList = menuID.getElementsByTagName('li').length;
			var testList = menuID.getElementsByTagName('li');
			for (i=0;i<menuList ;i++ )
			{	
				testList[i].className = '';
			}
			thisID.className = 'selectThisItemsStyle';
		}
		
		function FrameRedirect(frameId, url)
		{
		    if ((document.getElementById(frameId) != null) && (url != "#") && (url.length > 0))
		    {
		        window.frames[frameId].location.href = url;
		    }
		}