code: function(container, scrollOffset)
  	{
  		var offsetLeft = 0;
  		var offsetTop = 0;
  		
  		// Ignores document scroll origin for fixed elements
  		var fixed = false;
  		var node = container;
  		var b = document.body;
  		var d = document.documentElement;
  
  		while (node != null && node != b && node != d && !fixed)
  		{
  			var style = mxUtils.getCurrentStyle(node);
  			
  			if (style != null)
  			{
  				fixed = fixed || style.position == 'fixed';
  			}
  			
  			node = node.parentNode;
  		}
  		
  		if (!scrollOffset && !fixed)
  		{
  			var offset = mxUtils.getDocumentScrollOrigin(container.ownerDocument);
  			offsetLeft += offset.x;
  			offsetTop += offset.y;
  		}
  		
  		var r = container.getBoundingClientRect();
  		
  		if (r != null)
  		{
  			offsetLeft += r.left;
  			offsetTop += r.top;
  		}
  		
  		return new mxPoint(offsetLeft, offsetTop);
  	}
docs: Function: getOffset
  
  Returns the offset for the specified container as an <mxPoint>. The
  offset is the distance from the top left corner of the container to the
  top left corner of the document.
  
  Parameters:
  
  container - DOM node to return the offset for.
  scollOffset - Optional boolean to add the scroll offset of the document.
  Default is false.