// JavaScript Document
//show and position accessory div
function showWhat(obj,sId){

  var oDiv = document.getElementById(sId);
  aPos = findPosition(obj);
  leftVal =  aPos[0] +70;
  topVal = aPos[1] -40;
  aPos = null;
  oDiv.style.left = leftVal + "px";
  oDiv.style.top = topVal + "px";
  oDiv.style.display = "block";

  return false;
}

//hide accessory div
function hideWhat(sId){
  var oDiv = document.getElementById(sId);
  oDiv.style.display = "none";
 
  return false;
}

//get the position of parent LI within the browser to position the accessory divs
function findPosition( oElement ) {
  if( typeof( oElement.offsetParent ) != 'undefined' ) {
    for( var posX = 0, posY = 0; oElement; oElement = oElement.offsetParent ) {
      posX += oElement.offsetLeft;
      posY += oElement.offsetTop;
    }
  return [ posX, posY ];
  } else {
    return [ oElement.x, oElement.y ];
  }
}
