function createFlashObject(sFlashObjectId, width, height, version, addr, style) {
	var oElement = document.getElementById(sFlashObjectId);
	var HTMLString = '<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
	HTMLString = HTMLString + 'CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#' + version + '" ';
	HTMLString = HTMLString + 'ID="' + sFlashObjectId + '" ';
	HTMLString = HTMLString + 'WIDTH="' + width + '" ';
	HTMLString = HTMLString + 'HEIGHT="' + height + '" ';
	HTMLString = HTMLString + 'STYLE="' + style + '" ';
	HTMLString = HTMLString + '>';
	HTMLString = HTMLString + '<PARAM NAME="movie" VALUE="' + addr + '">';
	HTMLString = HTMLString + '<PARAM NAME="quality" VALUE="high"><PARAM NAME="bgcolor" VALUE="#FFFFFF">';
	HTMLString = HTMLString + '<PARAM NAME="wmode" VALUE="Transparent">';
	HTMLString = HTMLString + '<EMBED src="' + addr + '" quality=high bgcolor=#ffffff WIDTH="' + width + '" HEIGHT="' + height + '" NAME="' + sFlashObjectId + '" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>';
	HTMLString = HTMLString + '</OBJECT>';
	
	var flashVersion = (getFlashVersion().split(',').shift()) - 0;
	var minVersion = (version.split(',').shift()) - 0;
	if (flashVersion >= minVersion) {
		oElement.innerHTML = HTMLString;
	} else {
		oElement.innerHTML = '<p style="float: left; border: 1px solid black; margin: 0; padding: 10px 10px; width: ' + (width - 22) + 'px; height: ' + (height - 22) + 'px;" >You need the <a href="http://get.adobe.com/flashplayer/">latest version of Flash</a> installed to use this tool</p>';
	}
}

function getFlashVersion(){
	// ie
	try {
		try {
			// avoid fp6 minor version lookup issues
			// see: http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
			var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');
			try { axo.AllowScriptAccess = 'always'; }
			catch(e) { return '6,0,0'; }
		} catch(e) {}
		return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1];
		// other browsers
	} catch(e) {
		try {
			if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){
				return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
			}
		} catch(e) {}
	}
	return '0,0,0';
}
