/* Function Call = SWFloader(id,src,code,width,height,bgcolor,html)
 *	SWF = Macromedia's 'Small Web File' format for Shockwave and Flash
 *	loader = tests for JavaScript and SWF support, then displays file or HTML
 *	id = unique CSS ID for this object
 *	src = source file URL for the SWF
 *	code = code level verion of the source SWF, for compatibility purposes
 *	width = width of the SWF to display
 *	height = height of the SWF to display
 *	bgcolor = the SWF's default, hexadecimal background color
 *	html = HTML equivalent for the SWF file that may not load
 *  Note: NOSCRIPT DIV also needs WIDTH, HEIGHT, and BGCOLOR defined besides the HTML
*/
function SWFloader(SWFid,SWFsrc,SWFcode,SWFwidth,SWFheight,SWFbgcolor,SWFhtml) {
	var SWFsupport=0, SWFversion=0;
	var SWFplugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"])
	 ?	navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0; // SWF support test
	if (SWFplugin) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
		for (var i = 0; i < words.length; ++i) {
			if (isNaN(parseInt(words[i]))) continue;
			SWFversion = words[i]; 
		}
		SWFsupport = (SWFversion >= SWFcode);
	} else {
		if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win")!=-1)) {
			document.write("<scr" + "ipt language=\"VBScript\"\><!--\n"); // hiding SCRIPT from MacIE4.5
			document.write("flashinstalled = 0\n");
			document.write("on error resume next\n");
			document.write("For i = 2 to 10\n");
			document.write(" If Not(IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.\" & i))) Then\n");
			document.write(" Else\n");
			document.write("  flashinstalled = i\n");
			document.write(" End If\n");
			document.write("Next\n");
			document.write("// --></scr" + "ipt\>\n"); // hiding SCRIPT from MacIE4.5
			SWFsupport = (flashinstalled >= SWFcode);
		}
	}
	if (SWFsupport) { // Load SWF file (JS and SWF supported)
		document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"\n");
		document.write(" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="
		 + SWFcode + ",0,0,0\"\n");
		document.write(" id=\"" + SWFid + "\" width=\"" + SWFwidth + "\" height=\"" + SWFheight + "\">\n");
		document.write(" <param name=\"quality\" value=\"high\" />\n");
		document.write(" <param name=\"scale\" value=\"exactfit\" />\n");
		document.write(" <param name=\"bgcolor\" value=\"" + SWFbgcolor + "\" />\n");
		document.write(" <param name=\"movie\" value=\"" + SWFsrc + "\" />\n");
		document.write(" <embed type=\"application/x-shockwave-flash\"\n");
		document.write("  pluginspage=\"http://www.macromedia.com/go/getflashplayer\"\n");
		document.write("  width=\"" + SWFwidth + "\" height=\"" + SWFheight + "\"\n");
		document.write("  quality=\"high\" scale=\"exactfit\" bgcolor=\"" + SWFbgcolor + "\"\n");
		document.write("  src=\"" + SWFsrc + "\">\n");
		document.write(" </embed>\n");
		document.write("</object>\n");
	} else { // Display HTML (JS supported but not SWF)
		document.write("<div style=\"width:" + SWFwidth + "; height:" + SWFheight
		 + "; background-color:" + SWFbgcolor + "\">" + SWFhtml + "</div>");
	}
}

