function getWidth() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  return myWidth;
}

function getHeight() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  return myHeight;
}

function showMenuDA()
{
	if (document.getElementById("menuDA").style.visibility == "visible") {
		document.getElementById("menuDA").style.visibility = "hidden";
	} else {
		document.getElementById("menuDA").style.left = ((getWidth() - 650) / 2);
		document.getElementById("menuDA").style.visibility = "visible";
	}

}

function activateItem(i)
{
	document.getElementById(i).style.backgroundColor="#075897";
}
function deactivateItem(i)
{
	document.getElementById(i).style.backgroundColor="#064D85";
}
function showMenuONas1()
{
	document.getElementById("onas1").style.visibility="visible";
	var newY = findPosY(document.getElementById("menu2")) - 70;
	if (navigator.appName == "Netscape") {
		newY = newY - 15;
	}
	document.getElementById("onas1").style.top = newY + 'px';
	var newX = findPosX(document.getElementById("menu2"));
	document.getElementById("onas1").style.left = newX;
}
function hideMenuONas1()
{
	document.getElementById("onas1").style.visibility="hidden";
}
function showMenuONas2()
{
	document.getElementById("onas2").style.visibility="visible";
	var newY = findPosY(document.getElementById("menu3")) - 70;
	if (navigator.appName == "Netscape") {
		newY = newY - 15;
	}
	document.getElementById("onas2").style.top = newY + 'px';
	var newX = findPosX(document.getElementById("menu3"));
	document.getElementById("onas2").style.left = newX;
}
function hideMenuONas2()
{
	document.getElementById("onas2").style.visibility="hidden";
}
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;
}
