var MAX_EMP_PER_ROW = 3;

/**
 * Returns the (x,y) coordinates to which the pop-up to be moved
 */
function getRollOverPopupPosition(empNum)
{
   // Get row and column
  var row = parseInt(empNum / MAX_EMP_PER_ROW);
  var column = (empNum % MAX_EMP_PER_ROW);

  var employeeCoordinates = findDiagonalCoordinates('empName'+ empNum);
  // for column 0 and column 1, the position should be 45px from the left of the emp data
  // for column 2, the position should be aligned to the left of the emp data
  var popupX = (column == 0 || column == 1) ? (employeeCoordinates.x1 + 45) : (employeeCoordinates.x1 - getRollOverPopupWidth());

  if(row == 0)
  {  
    var sectionTitleCoordinates = findDiagonalCoordinates('sectionTitle');
    var popupY = (sectionTitleCoordinates.y2 + 4);
    return [popupX, popupY];
  }

  // Align the pop-up vertically with the section line following the current row
  var sectionLineCoordinates = findDiagonalCoordinates('sectionLine' + row);
  var popupY = (sectionLineCoordinates.y1 - getRollOverPopupHeight()); 
  return [popupX, popupY];
}
