// SimpleMenu 1.2 - (c) 2003-2004 Robert Bares

var offsetT;
var offsetL;
if (document.all)    {n=0;ie=1;ns6=0;}
if (document.getElementById && !document.all)    {n=0;ie=0;ns6=1;}
function ShowMenu(menuid) {
	if (ie) {
		offsetT = findPosY(document.all(menuid+"img"));
		offsetT = offsetT + 16;
		offsetL = findPosX(document.all(menuid+"img"));
		offsetL = AddMenuSpecificOffset(offsetL,menuid);
		document.all(menuid).style.top = offsetT;
		document.all(menuid).style.left = offsetL;
		document.all(menuid).style.visibility = 'visible';
		document.all(menuid+"img").style.backgroundColor = '#414C9C';			 
		}
	if (ns6) {
		offsetT = findPosY(document.getElementById(menuid+"img"));
		offsetT = offsetT + 16;
		offsetL = findPosX(document.getElementById(menuid+"img"));
		offsetL = AddMenuSpecificOffset(offsetL,menuid);
		document.getElementById(menuid).style.top = offsetT;
		document.getElementById(menuid).style.left = offsetL;
		document.getElementById(menuid).style.visibility = 'visible';
		document.getElementById(menuid+"img").style.backgroundColor = '#414C9C';
		}
	}
function HideMenu(menuid) {
	if (ie) {
		document.all(menuid).style.visibility = 'hidden';
		document.all(menuid+"img").style.backgroundColor = 'transparent';
		}
	if (ns6) {
		document.getElementById(menuid).style.visibility = 'hidden';
		document.getElementById(menuid+"img").style.backgroundColor = 'transparent';
		}
	}

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;
	}

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;
	}
function AddMenuSpecificOffset(offset,menuid) {
	if (menuid == "menu1") {offset = offset + 0;return offset}
	else return offset;
	}
