function showSubmenu(id){
	document.getElementById(id).style.display = '';
	//alert(id);
}
function hideSubmenu(id){
	document.getElementById(id).style.display = 'none';
	//alert(id);
}
function elementHeight(eSrc)
{	
	if (eSrc.offsetHeight == null || eSrc.offsetHeight == 0)
	{
		if (eSrc.offsetParent == null)
			return 0;
		if (eSrc.offsetParent.offsetHeight == null || eSrc.offsetParent.offsetHeight == 0)
		{
			if (eSrc.offsetParent.offsetParent != null)
				return eSrc.offsetParent.offsetParent.offsetHeight; //needed for Konqueror
			else
				return 0;
		}
		else
			return eSrc.offsetParent.offsetHeight;
	}
	else
		return eSrc.offsetHeight;
}
function elementLeft(eSrc)
{	
	var iLeft = 0;
	var eParent;
	eParent = eSrc;
	
	if (eParent.style.position == 'absolute')
		return eParent.offsetLeft;

	while (eParent.tagName.toUpperCase() != "BODY")
	{
		if (eParent.id == eSrc.id || eParent.style.position != 'relative')
			iLeft += eParent.offsetLeft;
			
		eParent = eParent.offsetParent;
		if (eParent == null)
			break;
	}
	if (eParent != null) 
		iLeft += eParent.offsetLeft;
	
	return iLeft;
}
function elementTop(eSrc)
{
	var iTop = 0;
	var eParent;
	eParent = eSrc;
	
	if (eParent.style.position == 'absolute')
		return eParent.offsetTop;
		
	while (eParent.tagName.toUpperCase() != "BODY")
	{
		if (eParent.id == eSrc.id || eParent.style.position != 'relative')
			iTop += eParent.offsetTop;
		
		eParent = eParent.offsetParent;
		if (eParent == null)
			break;
	}
	if (eParent != null) 
		iTop += eParent.offsetTop;
	
	return iTop;
}

function elementWidth(eSrc)
{
	if (eSrc.offsetWidth == null || eSrc.offsetWidth == 0)
	{
		if (eSrc.offsetParent == null)
			return 0;
		if (eSrc.offsetParent.offsetWidth == null || eSrc.offsetParent.offsetWidth == 0)
		{
			if (eSrc.offsetParent.offsetParent != null)
				return eSrc.offsetParent.offsetParent.offsetWidth; //needed for Konqueror
			else
				return 0;
		}
		else
			return eSrc.offsetParent.offsetWidth

	}
	else
		return eSrc.offsetWidth;
}

function Show(id){
	var layer = document.getElementById("menusub_" + id);
	if(layer){
		var left = elementLeft(layer);
		var top = elementTop(layer);
		var height = elementHeight(layer);
		var width = elementWidth(layer);
		var iframe = document.getElementById("iframe_" + id);
		layer.style.visibility = 'visible';
		layer.className = 'layerbg';
		iframe.style.position = 'absolute';
		iframe.style.top = top;
		iframe.style.left = left;
		iframe.style.width = width;
		//iframe.style.zIndex = 100;
		iframe.style.height = height;
		iframe.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';
		iframe.style.display = '';
	}
}
function Hide(id){
	var layer = document.getElementById("menusub_" + id);
	if(layer){
		layer.style.visibility = 'hidden';
		var iframe = document.getElementById("iframe_" + id);
		iframe.style.display = 'none';
	}
}
function setCSS(obj, css){
	obj.style.cursor = 'hand';
	obj.className = css;
}