/******************************************************************************/
/* Function    * getElementPosition(elementID)                                */
/* Description * Gets the absolute position of an element on a page           */
/* Code info   * Code by Danny Goodman, found here: http://www.thescripts.co  */
/*             * m/forum/thread148568.html                                    */
/******************************************************************************/
function getElementPosition(elementID)
{
  var offsetTrail = document.getElementById(elementID);
  var offsetLeft = 0;
  var offsetTop = 0;
  while (offsetTrail)
  {
    offsetLeft += offsetTrail.offsetLeft;
    offsetTop += offsetTrail.offsetTop;
    offsetTrail = offsetTrail.offsetParent;
  }
  if (navigator.userAgent.indexOf('Mac') != -1 && typeof document.body.leftMargin != 'undefined')
  {
    offsetLeft += document.body.leftMargin;
    offsetTop += document.body.topMargin;
  }
  return {left:offsetLeft,top:offsetTop};
}

function showPopup()
{
  var menuPopupDiv = document.getElementById('menuPopupDiv');
  positionLeft = getElementPosition('menuLinkDiv').left;
	positionTop = getElementPosition('menuLinkDiv').top;
  
  menuPopupDiv.style.display = "block";
  menuPopupDiv.style.left = positionLeft+40 + "px";
  menuPopupDiv.style.top = positionTop+2 + "px";
}

function hidePopup()
{
	var menuPopupDiv = document.getElementById('menuPopupDiv');
	menuPopupDiv.style.display = "none";
}