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


function FrameRedirect(frameId, url)
{
	if (($_getID(frameId) != null) && (url != "#") && (url.length > 0))
	{
		window.frames[frameId].location.href = url;
	}
}	

//构建子菜单项及填充类;
function SelectMenu(menuItem, lefturl)
{
			FrameRedirect('MSCMS_Leftifr', lefturl);
			//break;
	
	//alert(subMenuId);
	if ($_getID("txtSelectedMenuId").value == menuItem.id)
		return;
	menuItem.className = "Current";
	if ($_getID("txtSelectedMenuId").value.length > 0)
		$_getID($_getID("txtSelectedMenuId").value).className = "";
	$_getID("txtSelectedMenuId").value = menuItem.id;
}

function MouseOver(menuItem)
{
	if ($_getID("txtSelectedMenuId").value == menuItem.id)
		return;
	menuItem.className = "hover";
}

function MouseOut(menuItem)
{
	if ($_getID("txtSelectedMenuId").value == menuItem.id)
		return;
	menuItem.className = "";
}

function SubmenuMouseOver(menuItem, subMenuId)
{
	menuItem.className = "hover";
	if (subMenuId == '')
		return;
	var subMenu = $_getID(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 = $_getID(thisID);
	if (thisID.style.display == 'none')
	{
		thisID.style.display = '';
	}
	else
	{
		thisID.style.display = 'none';
	}
}
