/*

Helper-script to replace 'active' content in IE, because of the 
implications of the Eola patent trial.

Idea:
Call Eola.replace with the ID of an <object> element to be replaced.

*/

var Eola = {
	isIE: /*@cc_on @if (@_win32) true @else @*/false/*@end @*/,
	replace: function(id) {
		if (!Eola.isIE) return;
		var elm = document.getElementById(id);
		if (elm) {
			var parent = elm.parentNode;
			
			/*
			var replacement = document.createElement('object');
			//replacement.setAttribute('id', elm.getAttribute('id'));
			replacement.setAttribute('classid', 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000');
			replacement.setAttribute('width', elm.getAttribute('width'));
			replacement.setAttribute('height', elm.getAttribute('height'));

			replacement.setAttribute('movie', elm.getAttribute('data'));

			for (var child = elm.firstChild; child != null; child = child.nextSibling)
			{
				replacement.appendChild(child.cloneNode());
			}

			//parent.replaceChild(replacement, elm);
			elm.outerHTML = replacement.outerHTML;

			var wrapper = document.createElement('div');
			wrapper.setAttribute('id', elm.getAttribute('id'));
			parent.replaceChild(wrapper, elm);
			*/
			elm.outerHTML = '<embed id="' + elm['id'] + '" src="' + elm['data'] + '" width="' + elm['width'] + '" height="' + elm['height'] + '" wmode="transparent"></embed>';
		}
	}
}
