/* Function: SWFloader(id, src, code, width, height, bgcolor, html)
 *  Purpose: Test for support of Macromedia's 'Small Web File' format.
 *           SWF files include Shockwave and Flash animations.
 *           Loader tests for JS and SWF support, then displays SWF or HTML
 *
 *  Options:___________________________________________________________________
 *     id = unique CSS ID for this object
 *     src = source file URL of the SWF file
 *     code = verion code level of the SWF source, for compatibility purposes
 *     width = width of the SWF to display
 *     height = height of the SWF to display
 *     bgcolor = the SWF's default background color, hexadecimal format
 *     html = HTML equivalent, JS encoded, for the SWF file that may not load
 *     NOTE: Remember to also provide this HTML equivalent in the NOSCRIPT.
 */
var SWFversion, SWFfile;
function SWFloader(SWFid, SWFsrc, SWFcode, SWFwidth, SWFheight, SWFbgcolor, SWFhtml) {
	var SWFsupport=0;
	SWFfile = SWFcode;
	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]; 
		}
	} else {
		if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
		 && (navigator.appVersion.indexOf("Win")!=-1)) {
			document.write("<scr" + "ipt language=\"VBScript\"\>/* <![CDATA[ */\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
			SWFversion = flashinstalled;
		}
	}
	if (SWFversion >= SWFcode) { // 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/software/flashplayer/\"\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=\"position: relative; width:" + SWFwidth + "; height:" + SWFheight
		 + "; margin: 0px auto; background-color:" + SWFbgcolor + "\">" + SWFhtml + "</div>");
	}
}
function SWFresults(){
	if (SWFversion > 0) {
		if (SWFversion >= SWFfile) {
			document.getElementById("results").childNodes[0].data = "Congratulations, your browser supports both the Javascript and the Shockwave/Flash file required for this demonstration. Your player is version " + SWFversion + " and the SWF file is version " + SWFfile + ".";
		} else {
			document.getElementById("results").childNodes[0].data = "Sorry, your browser supports the Javascript but it does not support the Shockwave/Flash file required for this demonstration. Your player is version " + SWFversion + " and the SWF file is version " + SWFfile + ".";
		}
	} else {
			document.getElementById("results").childNodes[0].data = "Sorry, your browser supports the Javascript but it does not have any support for Shockwave/Flash files.";
	}
}
window.onload = SWFresults;