//Some of the window utility functions used by the dealersites ftls is placed here.
//Author: sa
//11/19/2007

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1];
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 ;

/**
 * Find the position of an object.
 */
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 ];
  }
}

/**
 * Shift the 'div' relative to 'rootDiv'.
 */
function shiftRelativeX(divId, rootDivId)
{

  //Re position the left panel relative to rootDiv.
  var rootDiv = document.getElementById(rootDivId);
  var rootCoordinates = findPosition(rootDiv);
  var div = document.getElementById(divId);
  var divCoordinates = findPosition(div);
  
  div.style.left = (rootCoordinates[0] + divCoordinates[0]) + "px";
}