function doWriteFlash(url, width, height, replacementGif, replacementUrl){
var MM_contentVersion = 6;
var plugin 	= (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
var esWin 	= navigator.appVersion.indexOf("Win");
var esIE 	= navigator.userAgent.indexOf("MSIE");
var isHttps	= document.location.href.indexOf("https");


if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	    }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}else if (navigator.userAgent && esIE>=0) {
	for(var i=7; i>0; i--){
		flashVersion = 0;
		try{
			var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);
			flashVersion = i;
		}
		catch(e){
		}
	}
	MM_FlashCanPlay = flashVersion;
}

	if (isHttps > -1) {
		document.write('<IMG SRC='+replacementGif+' BORDER=0>');
	}else if( MM_FlashCanPlay ) {
		document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
		document.write('  codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
		document.write(' ID="script" WIDTH="'+width+'" HEIGHT="'+height+'" ALIGN="">');
		document.write(' <PARAM NAME=movie VALUE='+url+'> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <PARAM NAME=wmode VALUE=opaque>  '); 
		document.write(' <EMBED src='+url+' quality=high bgcolor=#FFFFFF  ');
		document.write(' swLiveConnect=FALSE WIDTH="'+width+'" HEIGHT="'+height+'" NAME="script" ALIGN="" wmode="opaque"');
		document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="https://www.macromedia.com/go/getflashplayer">');
		document.write(' </EMBED>');
		document.write(' </OBJECT>');
	}else{
		if(replacementUrl){
			document.write('<a href='+replacementUrl+'><IMG SRC='+replacementGif+' BORDER=0></a>');
		} else{
			document.write('<IMG SRC='+replacementGif+' BORDER=0>');
		}
	}
}
