//  Filename	: flash.js
//	Created		: 04/01/2006	Sandy Yu 	(sandywyu at gmail dot com)
//	Purpose		: embed all Flash objects using JS, due to MSIE's recent ActiveX control update. 
//	Usage		: 	fId = id/name of embed/object
//					swf = location of swf file
//					flashVars = value of FlashVars
//					width, height = width & height of swf
//					bgColor = background color, defaults to black
//					extraParam = any extra needed parameters...format of value - <param name="name" value="value"> 
//					extraEmbed = matching embed vars to match extraParams...format of value - name="value"

function embedFlashObj(fId,swf,flashVars,width,height,bgColor,extraParam,extraEmbed) {
	var color = (bgColor) ? bgColor : "#000000";
	var params = (extraParam) ? extraParam : "";
	var embeds = (extraEmbed) ? extraEmbed : "";
	
	//alert("writing");
	document.writeln('<object id="'+fId+'" align="top" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+width+'" height="'+height+'">');
	document.writeln('<param name="movie" value="'+swf+'">');
	document.writeln('<param name="quality" value="high">');
	document.writeln('<param name="wmode" value="transparent">');
	document.writeln('<param name="FlashVars" value="'+flashVars+'">');
	document.writeln('<param name="bgcolor" value="'+color+'">');
	document.writeln(params);
	document.writeln('<embed name="'+fId+'" src="'+swf+'" FlashVars="'+flashVars+'" bgcolor="'+color+'" wmode="transparent"  quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'" vspace="0" hspace="0" ' + embeds + ' ></embed>');
	document.writeln('</object>');
	//alert("done writing");
}