//----------------------------------------------------------------------

function insertIE6iFrame( obj )
{
  var ieMat = document.createElement("iframe");

  ieMat.style.width = obj.offsetWidth + "px";
  ieMat.style.height = obj.offsetHeight + "px";  
  ieMat.style.zIndex = -1;
  ieMat.style.position = "absolute";
  ieMat.style.top = "0";
  ieMat.style.left = "0";
  
  obj.insertBefore( ieMat, obj.firstChild );
  obj.style.zIndex = "99";
}

//----------------------------------------------------------------------

function removeIE6iFrame( obj )
{
  obj.removeChild( obj.firstChild );
}

//----------------------------------------------------------------------

function getPageX( obj )
{
  return ( obj.offsetParent ) ? ( obj.offsetLeft + getPageX(obj.offsetParent) ) : obj.offsetLeft;
}

//----------------------------------------------------------------------

function getPageY( obj )
{
  return ( obj.offsetParent ) ? ( obj.offsetTop + getPageY(obj.offsetParent) ) : obj.offsetTop;
}

//----------------------------------------------------------------------

function getWidth( obj )
{
  if ( obj.style["width"] )
    return obj.style["width"];
  else if ( obj.currentStyle )
    return obj.offsetWidth;
  else if ( document.defaultView && document.defaultView.getComputedStyle ) {
    var s = document.defaultView.getComputedStyle(obj, "");
    return s && s.getPropertyValue("width");
  }
  else
    return null;
}
