var _objTimer = null;
var _strActiveDropDownMenuID = "";

function initPage()
{

}

function showMenu(objElement)
{
	var divDropDownMenu = null;
	var intX = calculateX(objElement);
	var intY = 132;
		
	_strActiveDropDownMenuID = objElement.id.substring(objElement.id.indexOf('_') + 1);
	divDropDownMenu = document.getElementById('div_' + _strActiveDropDownMenuID);
	
	if (divDropDownMenu)
	{		
		divDropDownMenu.style.top = intY + 'px';
		divDropDownMenu.style.left = intX + 'px';
		divDropDownMenu.style.width = objElement.offsetWidth;
		divDropDownMenu.style.display = '';	
	}
	
	if (objElement && objElement.className.indexOf('_') == -1)
		objElement.className = objElement.className + '_Hover';
}

function hideMenu()
{
	var divDropDownMenu = document.getElementById('div_' + _strActiveDropDownMenuID);
	var objElement = document.getElementById('td_' + _strActiveDropDownMenuID);
	
	if (divDropDownMenu)
		divDropDownMenu.style.display = 'none';
		
	if (objElement && objElement.className.indexOf('_') > -1)
		objElement.className = objElement.className.substring(0, objElement.className.indexOf('_'));
	
	_strActiveDropDownMenuID = "";
}

function hideMenuStart()
{
	_objTimer = setTimeout("hideMenu();", 1000);
}

function hideMenuStop()
{
	clearTimeout(_objTimer);
	_objTimer = null;
}

function calculateX(objElement)
{
	var objBody = document.body;
	var intOffsetX = 0;
	var intBorderX = objBody.offsetLeft;
	
	while (objElement.offsetParent != objBody)
	{
		intOffsetX += objElement.offsetLeft;
		objElement = objElement.offsetParent;
	}
	
	intOffsetX += objElement.offsetLeft;
	
	return intOffsetX + intBorderX;
}

function resizeFrame()
{
	if (window.frames['frmContent'].positionInfoSearch)
		window.frames['frmContent'].positionInfoSearch();
}
