function setAttribute(object, attribute, value)
{
	return object[attribute] = value;
}

function resetAttribute(object, attribute)
{
	return setAttribute(object, attribute, object[attribute]);
}

function resetInnerHTML(object)
{
	return resetAttribute(object, "innerHTML");
}

// Re-assign all "embedded applications" to fix Eolas patent crap
function fixEolas(target)
{
	// Default target to current document
	if (!target) target = document;
	
	// Re-assign all objects (and remember all embeds that are processed)
	var objects = target.getElementsByTagName("object");
	for (var objectIndex = 0; objectIndex < objects.length; objectIndex++)
	{
		/* adding these 2 lines will fail the swfobject script */
		/*var object = objects[objectIndex];
		object.outerHTML = object.outerHTML;*/
	    
		var embed = object.getElementsByTagName("embed");
		if (embed) embed.__processed__ = true;
	}

	// Re-assign all embeds that were not processed yet
	var embeds = document.getElementsByTagName("embed");
	for (var embedIndex = 0; embedIndex < embeds.length; embedIndex++)
	{
		var embed = embeds[embedIndex];
		
		if (!embed.__processed__) embed.outerHTML = embed.outerHTML;
	}
}

fixEolas();
