/**
 * Work around for Microsoft's security "feature" that prevents the flash player activeX
 * control from working until the user accepts a message.  
 * 
 * See: http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/activating_activex.asp
 */
function writeSwf(id, swfUrl, width, height, flashVars)
{
	
	var flashVarsString = "";
	
	// build query string from array provided
	if(flashVars)
	{
		for(i=0; i<flashVars.length; i++)
		{
			flashVarsString += flashVars[i] + "&";
		}
	}	

	
	document.write("<object id='" + id + "' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' ");
	document.write("codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'  ");
	document.write("width='" + width + "'  ");
	document.write("height='" + height + "'  ");
	document.write("align='middle'> ");
	document.write("<param name='allowScriptAccess' value='always' /> ");
	document.write("<param name='movie' value='" + swfUrl + "' /> ");
	document.write("<param name='quality' value='high' /> ");
    document.write("<param name='scale' value='noscale' /> ");
        //document.write("<param name='wmode' value='transparent' /> ");
	document.write("<param name='salign' value='lt' /> ");
	document.write("<param name='bgcolor' value='#ffffff' /> ");
	document.write("<param name='FlashVars' value='" + flashVarsString + "' />");
	document.write("<embed src='" + swfUrl + "'  name='" + id + "'");
	document.write("	quality='high'  ");
    document.write("    scale='noscale'  ");
    	//document.write("    wmode='transparent'  ");
	document.write("	salign='lt'  ");
	document.write("	bgcolor='#ffffff'  ");
	document.write("	width='" + width + "'  ");
	document.write("	height='" + height + "'  ");
	document.write("	align='middle'  ");
	document.write("	allowScriptAccess='always'  ");
	document.write("	swLiveConnect='true'  ");
	document.write("	type='application/x-shockwave-flash'  ");
	document.write("	pluginspage='http://www.macromedia.com/go/getflashplayer'  ");
	document.write("	flashVars='" + flashVarsString + "'/>");
	document.write("</object> ");
}