// Quick way to test for Navigator 4.x or IE 4.x
var version4 = (navigator.appVersion.charAt(0) == "4"); 

function displayPopup(url,name,height,width,evnt) {
 var properties = "scrollbars,resizable,toolbar=0,location=0,height="+height
 properties = properties+",width="+width
 if(evnt != null) {
  if(navigator.appName == "Microsoft Internet Explorer") {
  properties = properties+",left=300"//+(evnt.screenX + 10)
  properties = properties+",top=200"//+(evnt.screenY + 10)
 }else { // Navigator coordinates must be adjusted for scrolling
  properties = properties+",left=300"//+(evnt.screenX - pageXOffset + 10)
  properties = properties+",top=200"//+(evnt.screenY - pageYOffset + 10)
  }
 }
 popupHandle = open(url,name,properties)
}

function closePopup() {
 if(popupHandle != null && !popupHandle.closed) popupHandle.close()
}
    var cX = 0; var cY = 0;
    function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}
    function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}

    if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
    else { document.onmousemove = UpdateCursorPosition; }
    function GetX(){
      if(typeof(window.pageXOffset) == 'number')
        return window.pageXOffset;
      else if(document.body && document.body.scrollLeft)
        return document.body.scrollLeft;
      else
        return document.documentElement.scrollLeft;
    }
    function GetY(){
      if(typeof(window.pageYOffset) == 'number')
        return window.pageYOffset;
      else if(document.body && document.body.scrollTop)
        return document.body.scrollTop;
      else
        return document.documentElement.scrollTop;
    }
    function Show_popup(objectID)
    {
      var x, y;
      var docX, docY;
      docX = GetX();
      docY = GetY();
      x = cX + docX - 60;
      y = cY + docY + 5;
      var ob = document.getElementById(objectID);
      ob.style.visibility = "visible";
      ob.style.left = x + "px";
      ob.style.top = y + "px";
    }
    function Show_popup_note(objectID, strRec, bAdd)
    {
      var x, y;
      var docX, docY;
      docX = GetX();
      docY = GetY();
      x = cX + docX - 60;
      y = cY + docY + 5;
      var ob = document.getElementById(objectID);
      ob.style.visibility = "visible";
      ob.style.left = x + "px";
      ob.style.top = y + "px";
      eval("set_AddEditMode" + strRec)(bAdd);
    }
    function Show_popup_center(objectID, curElem)
    {
      var x, y;
      var docX, docY;
      docX = GetX();
      docY = GetY();
      x = cX + docX - 180;
      y = cY + docY + 5;
      var ob = document.getElementById(objectID);
      ob.style.visibility = "visible";
      ob.style.left = x + "px";
      ob.style.top = y + "px";
    }
    function Show_popup_right(objectID)
    {
      var x, y;
      var docX, docY;
      docX = GetX();
      docY = GetY();
      x = cX + docX - 400;
      y = cY + docY + 5;
      var ob = document.getElementById(objectID);
      ob.style.visibility = "visible";
      ob.style.left = x + "px";
      ob.style.top = y + "px";
    }
    function Show_popup_bottom(objectID)
    {
      var x, y;
      var docX, docY;
      docX = GetX();
      docY = GetY();
      var ob = document.getElementById(objectID);
      x = cX + docX - 60;
      y = cY + docY - ob.offsetHeight - 5;
      ob.style.visibility = "visible";
      ob.style.left = x + "px";
      ob.style.top = y + "px";
    }
function Hide_popup(objectID)
{
      var ob = document.getElementById(objectID);
      ob.style.visibility = "hidden";
      ob.style.left = "-1000px";
      ob.style.top = "-1000px";
}
