<!--

/* Show a submenu Item */
function showItem(id)
{
	hideAllitems(id);
	/* we first need to know where to put the element */
	var parentObj	= document.getElementById("Item"+id); 
	/* X coordinate subMenuItem can be calculated by adding left position plus width of parent*/
	var childX		= findPosX(parentObj);
	var childY		= findPosY(parentObj);
	/* Y coordinate subMenuItem can be calculated by finding Y of parent*/
	
	
	/* get subMenuItem */
	var subMenuItem = document.getElementById("subItem"+id);

	if(subMenuItem == null)
		return;
		
	var subMenuCount 		= subMenuItem.getElementsByTagName("li").length;

	subMenuItem.style.top 	= ''+ (childY+27)+'px';
	
	
	childX = childX + parentObj.offsetWidth/2 - subMenuItem.offsetWidth/2;
	subMenuItem.style.left 	=''+ (childX)+'px';
	
	
	subMenuItem.style.visibility  = "visible";
}

function hideItem(obj)
{
	obj.style.visibility  = 'hidden';

}


function hideAllitems(id)
{

	for(var i=0;i < 8;i++)
	{
		var obj = document.getElementById("subItem"+i);
		
		if(obj!=null && id!=i)
			obj.style.visibility  = "hidden";		
	}

}
/* find the X coordinate of given object*/
function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}
/* find the Y coordinate of given object*/
function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}
//-->
