function popupWindow(loc, width, height) {
  var popup = window.open(loc, "", "width=" + width + ",height=" + height +

                                  ", scrollbars=yes");
//  event.returnValue = false;
return false;
}

 var isIE = (window.opera) ? false : (document.all) ? true : false;

function showHint(hintParent) {
  var hint = document.getElementById(hintParent);
  hint.style.display = "block";
//  hint.style.left = event.x;
//  hint.style.top = event.y;
}

function showHintPos(hintParent, elem) {
  var hint = document.getElementById(hintParent);
  var selectedPosX = -10;
  var selectedPosY = 2;
  var theElement = elem;
  var theElemHeight = theElement.offsetHeight;
  var theElemWidth = theElement.offsetWidth;
  while(theElement != null){
    selectedPosX += theElement.offsetLeft;
    selectedPosY += theElement.offsetTop;
    theElement = theElement.offsetParent;
  }

  hint.style.left = selectedPosX;
  hint.style.top = selectedPosY + theElemHeight
  hint.style.display = "block";

  if(isIE){
    var myIFrame = document.getElementById('iFrameIEHack');
    myIFrame.style.width = hint.offsetWidth;
    myIFrame.style.height = hint.offsetHeight - 15;
    myIFrame.style.left = findPosX(hint);
    myIFrame.style.top = findPosY(hint) + 15;
    myIFrame.style.visibility='visible';
  }
}

function hideHint(hintParent) {
  var hint = document.getElementById(hintParent);
  hint.style.display = "none";
  if (isIE){
    var myIFrame = document.getElementById('iFrameIEHack');
    myIFrame.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;
}

