/*	----------------------------------------------------------------------------------------------

MACROMEDIA FLASH EMBED SCRIPT

This script fixes the recent problems concerning Microsoft Internet Explorer's update that causes
embeded ActiveX elements to not work correctly on websites. Specifically it deals
with embedding Macromedia Flash elements. This script was written by Prodotools (prodotools.com)
in May of 2006. Please distribute it freely and always include comments and credit.

--------------------------------------------------------------------------------------------------

INSTRUCTIONS

EXTERNAL JAVASCRIPT FILE
This script MUST run from it's own JavaScript file and CANNOT be included in the HTML page.
The name of the script file MUST be "ax_embed.js" and included in the same directory as the HTML
page containing the Flash element. Include all of the lines here including instructions and do not
add anything else to the file.

IN THE HTML HEAD
Copy and past the following line of code between the <head> and </head> tags of your HTML document:

	<script language="javascript" src="ax_embed.js"></script>

IN THE HTML BODY
Copy and past the following lines of code in the place where you want to display the Flash element:

<script language="javascript" type="text/javascript">
	flashEmbed(number, number, "string", "string");//width, height, src, flashVars (optional)
</script>

Note that you must specify the width, height, src, and flashVars (if any) in the function call. In
example, the function call might look like this:

	flashEmbed(600, 200, "myCoolFlashMovie.swf", "myVariable=true");
	
I hope this helps some people.
[d] darrin@prodotools.com

---------------------------------------------------------------------------------------------- */

function flashEmbed(width, height, src, flashVars){
	var flashVarsCode1 = "";
	var flashVarsCode2 = "";
	if (flashVars){
		flashVarsCode1 = "<param name='flashVars' value='"+flashVars+"'>";
		flashVarsCode2 = "flashVars='"+flashVars+"'";
	}
	var htmlCode = escape(
		"<object width='"+width+"' height='"+height+"' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' "+
		"codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0'>"+
		flashVarsCode1+
		"<param name='movie' value='"+src+"' />"+
		"<param name='quality' value='high' />"+
		"<embed src='"+src+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' "+
		"type='application/x-shockwave-flash' width='"+width+"' height='"+height+"' "+flashVarsCode2+">"+
		"</embed></object>");
	document.write(unescape(htmlCode));
}

function popAlert(theUrl,alertWidth,alertHeight){
	this.screenWidth=screen.width;
	this.screenHeight=screen.height;
	fromTop=(screenHeight/2)-(alertHeight/2);
	fromLeft=(screenWidth/2)-(alertWidth/2);
	windowParams="width="+alertWidth+", height="+alertHeight+", top="+fromTop+", left="+fromLeft+", menubar=no, status=no, toolbar=no, location=no, scrollbars=no, status=no, title=no resizable=no";
	window.open(theUrl, "Alert", windowParams);
}