// external_script.js
function CreateControl(DivID, flashFile, Width, Height, align, bgColor) {

  var d = fetch_object(DivID);
  	    d.innerHTML = chckVersion(flashFile, Width, Height, align, bgColor);
}

function fetch_object(idname)
{
	if (document.getElementById)
	{
		return document.getElementById(idname);
	}
	else if (document.all)
	{
		return document.all[idname];
	}
	else if (document.layers)
	{
		return document.layers[idname];
	}
	else
	{
		return null;
	}
}	 

// Check if Flash is on machine/ what version etc..this checking 8 
var MM_FlashCanPlay;
var MM_contentVersion = 6;
var MM_PluginVersion;

var MM_FlashPlayString="";
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;

function chckVersion(flashFile, Width, Height, align, bgColor) {

if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		MM_PluginVersion = words[i]; 
	    }
	MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}

if ( MM_FlashCanPlay ) {
	MM_FlashPlayString = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'
	MM_FlashPlayString += '  codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" '
	MM_FlashPlayString += ' width="'+Width+'" height="'+Height+'" id="'+flashFile+'" align="'+align+'">'
	MM_FlashPlayString += ' <param name="allowScriptAccess" value="sameDomain" /> <param name="movie" value="'+flashFile+'.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="'+bgColor+'" /> <param name="wmode" value="transparent" /> '
	MM_FlashPlayString += ' <embed "wmode=transparent" src="'+flashFile+'.swf" quality="high" bgcolor="'+bgColor+'" ' 
	MM_FlashPlayString += ' width="'+Width+'" height="'+Height+'" name="'+flashFile+'" align="'+align+'"'
	MM_FlashPlayString += ' allowScriptAccess="sameDomain" type="application/x-shockwave-flash" swLiveConnect="true" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
	MM_FlashPlayString += ' </OBJECT>'
} else{
	MM_FlashPlayString = '<img src="'+flashFile+'.png" width="'+Width+'" height="'+Height+'" alt="" usemap="#m_rhccFinal" style="background-color: Black;" border="0" />';

}

return MM_FlashPlayString;


}

/*
<embed src="rhMUOne.swf" quality="high" bgcolor="#ffffff" width="228" height="598" swLiveConnect=true id="rhMUOne" name="rhMUOne" align="top" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
*/