// Function to position the nav tabs

var popupTimerHandle = null;

// maybe used?

function showBox(div) {
    if (popupTimerHandle != null) {
       clearTimeout(popupTimerHandle);
       popupTimerHandle = null;
   }

  divObj = document.getElementById(div);
   divObj.style.display = 'block';
}

function positionTab(div, parentObj) {
  divObj = document.getElementById(div);
  var top = findPosY(parentObj);
  var left = findPosX(parentObj);
  
  // new
  
     if (popupTimerHandle != null) {
        clearTimeout(popupTimerHandle);
        popupTimerHandle = null;
    }
	
	// end new
  
  divObj.style.top = (top - 160) + "px";
  divObj.style.left = (left - 0) + "px";
  divObj.style.display = 'block';
}

function hideBox(div) {
    popupTimerHandle = setTimeout("reallyHideBox('" + div + "');", 250);
}

function reallyHideBox(div) {
    divObj = document.getElementById(div);
    divObj.style.display = 'none';
}


 // Function to find the X position of an element
 function findPosX(obj)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }		
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

 // Function to find the Y position of an element
  function findPosY(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
				
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }

