﻿/* From: http://neilmosafi.blogspot.com/2007/11/sharepoint-dragging-webparts-causes.html */
function MSOLayout_GetRealOffset(StartingObject, OffsetType, EndParent)
{
	var realValue=0;
	if (!EndParent)
		EndParent=document.body;
	
	for (var currentObject=StartingObject; currentObject && currentObject != EndParent && currentObject != document.body; currentObject=currentObject.offsetParent)
	{
		var offset = eval('currentObject.offset'+OffsetType);
		if (offset)
			realValue+=offset;
	}
	
	return realValue;
}

/* From: http://www.sharepointblogs.com/mossman/archive/2007/09/13/fixing-the-name-dll-activex-problem-the-mossman-way.aspx */ 
function ProcessDefaultOnLoad(onLoadFunctionNames)
{
	//** Uncomment this to see when this runs
	//alert('Fixing the Issue');
	
	ProcessPNGImages();
	UpdateAccessibilityUI();
	
	//** We comment out the offending ootb function
	//** and leave the rest of the functions as they were
	//ProcessImn();
	for (var i=0; i < onLoadFunctionNames.length; i++)
	{
		var expr="if(typeof("+onLoadFunctionNames[i]+")=='function'){"+onLoadFunctionNames[i]+"();}";
		eval(expr);
	}
	if (typeof(_spUseDefaultFocus)!="undefined")
		DefaultFocus();
}