





		
var currentItem = "";
var currentSubItem="";
var startAction = false;
var coordinates = new Object();
var onMenu = false;
var onButton = false;

function hideMenu(menuName) {

  document.getElementById('backdrop').style.visibility = "hidden";
  document.getElementById(menuName).style.visibility="hidden";

}

function hideSubMenu(menuName) {
  document.getElementById(menuName).style.visibility="hidden";
  document.getElementById(menuName).style.display="none";

}

function showMenu(menuName) {
    if(startAction)
  {
    document.getElementById('backdrop').style.visibility = "visible";
    document.getElementById(menuName).style.visibility="visible";
    //document.getElementById(menuName).style.display="block";
      currentItem = menuName;
  }
}

function showSubMenu(menuName) {

    document.getElementById('backdrop').style.visibility = "visible";
    document.getElementById(menuName).style.visibility="visible";
    document.getElementById(menuName).style.display="block";
    currentSubItem = menuName;
}

function rolloverFirstLevelMenu(menuName,arrowName){
    document.getElementById(menuName).style.backgroundColor="white";
    document.getElementById(arrowName).src = nav[100].over.src;
}

function rollbackFirstLevelMenu(menuName,arrowName){
    document.getElementById(menuName).style.backgroundColor="#eeeeee";
    document.getElementById(arrowName).src = nav[100].out.src;
}

/* set positions for all browsers */
function thisDetails() {
    get_element('backdrop').style.left = parseInt(coordinates.x)+0+"px";
      get_element('backdrop').style.top = parseInt(coordinates.y)+0+"px";

    get_element('dropdown_aboutMPW').style.left = parseInt(coordinates.x)+134+"px";
      get_element('dropdown_aboutMPW').style.top = parseInt(coordinates.y)+111+"px";

    get_element('dropdown_services').style.left = parseInt(coordinates.x)+202+"px";
      get_element('dropdown_services').style.top = parseInt(coordinates.y)+111+"px";

    get_element('dropdown_investment').style.left = parseInt(coordinates.x)+264+"px";
      get_element('dropdown_investment').style.top = parseInt(coordinates.y)+111+"px";

    get_element('dropdown_lifeStages').style.left = parseInt(coordinates.x)+409+"px";
      get_element('dropdown_lifeStages').style.top = parseInt(coordinates.y)+111+"px";
}

function getAnchorPosition(anchorname) {
  // This function will return an Object with x and y properties
  var useWindow=false;
  var x=0,y=0;
  // Browser capability sniffing
  var use_gebi=false, use_css=false, use_layers=false;
  if (document.getElementById) { use_gebi=true; }
  else if (document.all) { use_css=true; }
  else if (document.layers) { use_layers=true; }
  // Logic to find position
   if (use_gebi && document.all) {
    x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
    y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
    }
  else if (use_gebi) {
    var o=document.getElementById(anchorname);
    x=AnchorPosition_getPageOffsetLeft(o);
    y=AnchorPosition_getPageOffsetTop(o);
    }
   else if (use_css) {
    x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
    y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
    }
  else if (use_layers) {
    var found=0;
    for (var i=0; i<document.anchors.length; i++) {
      if (document.anchors[i].name==anchorname) { found=1; break; }
      }
    if (found==0) {
      coordinates.x=0; coordinates.y=0; return coordinates;
      }
    x=document.anchors[i].x;
    y=document.anchors[i].y;
    }
  else {
    coordinates.x=0; coordinates.y=0; return coordinates;
    }
  coordinates.x=x;
  coordinates.y=y;
    thisDetails();
    startAction = true;
  return coordinates;
}

// Functions for IE to get position of an object
function AnchorPosition_getPageOffsetLeft (el) {
  var ol=el.offsetLeft;
  while ((el=el.offsetParent) != null) { ol += el.offsetLeft; }
  return ol;
}
function AnchorPosition_getWindowOffsetLeft (el) {
  return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;
}
function AnchorPosition_getPageOffsetTop (el) {
  var ot=el.offsetTop;
  while((el=el.offsetParent) != null) { ot += el.offsetTop; }
  return ot;
}
function AnchorPosition_getWindowOffsetTop (el) {
  return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;
}

get_element = document.all ?
  function (s_id) { return document.all[s_id] } :
  function (s_id) { return document.getElementById(s_id) };

window.onresize = function(){getAnchorPosition("setPoint");}

function getHeight(name) {
    var tmpElem = get_element(name);
    if(tmpElem.currentStyle) return tmpElem.offsetHeight;
    else return parseInt(document.defaultView.getComputedStyle(tmpElem, "").getPropertyValue("height"));

}

