function replaceFlash(e, swfLocation)
{
	if (e && e.getElementsByTagName("object")[0] && (!swfLocation || (swfLocation && !expressScriptCheck(e, swfLocation))) && window.ActiveXObject)
	{
		var	ret = e.innerHTML; // this can vary wildly in IE
		var movie = getFlashAttribute(ret, "data", "movie");
		var wmode = getFlashAttribute(ret, "wmode");
		
		ret = ret.replace("</OBJECT>", movie + wmode + "</OBJECT>");
		
		e.innerHTML = ret;
	}
}

function getFlashAttribute(tag, name, newName)
{
	var ret = "";
	
	if (tag.indexOf(name) >= 0)
	{
		var val = tag.substring(tag.toLowerCase().indexOf(name + "=") + name.length + 1); // strip out the value
		var end = Math.min(val.indexOf(" "), val.indexOf(">")); // there's no telling if this is the last attribute in the <object> tag opener
		
		val = val.substring(0, end);
		
		if (val.indexOf("\"") == 0)
		{
			val = val.substring(1, end - 1);
		}
		
		if (newName)
		{
			name = newName;
		}
		
		ret = "<PARAM NAME='" + name + "' VALUE='" + val + "'>";
	}
	
	return ret;
}

function expressScriptCheck(e, swfLocation)
{
	// Globals
	// Major version of Flash required
	var requiredMajorVersion = 8;
	// Minor version of Flash required
	var requiredMinorVersion = 0;
	// Minor version of Flash required
	var requiredRevision = 0;
	// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
	var hasProductInstall = DetectFlashVer(6, 0, 65);
	// Version check based upon the values defined in globals
	var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	// Check to see if a player with Flash Product Install is available and the version does not meet the requirements for playback
	if ( hasProductInstall && !hasReqestedVersion ) {
		// MMdoctitle is the stored document.title value used by the installation process to close the window that started the process
		// This is necessary in order to close browser windows that are still utilizing the older version of the player after installation has completed
		// DO NOT MODIFY THE FOLLOWING FOUR LINES
		// Location visited after installation is complete if installation is required
		var MMPlayerType = (window.ActiveXObject ? "ActiveX" : "PlugIn");
		var MMredirectURL = window.parent ? window.parent.location : window.location;
		var MMdoctitle = document.title;
		var obj = e.getElementsByTagName("object")[0];
		
		e.innerHTML = '<object type="application/x-shockwave-flash" width="' + obj.getAttribute("width") + '" height="' + obj.getAttribute("height") + '" data="' + swfLocation + '?MMredirectURL=' + MMredirectURL + '&MMplayerType=' + MMPlayerType + '&MMdoctitle=' + MMdoctitle + '" wmode="transparent">' +
		'<param name="movie" value="' + swfLocation + '?MMredirectURL=' + MMredirectURL + '&MMplayerType=' + MMPlayerType + '&MMdoctitle=' + MMdoctitle+'" />' +
		'<param name="wmode" value="transparent" />' +
		'</object>';
		
		return true;
	}
	
	return false;
}