/*
**	last modified 21 Sep 06 dbenston@alleni.com
**  added values to set menu to false (needed for custom right-click menu's)
**  added swLiveConnect
**  updated wmode, bgColor
**	Object and Embed tags
**	allowScriptAccess="always"
*/

function writeFlashTags(file, id, w, h, bg, al, scale, menu)
{
	var txt = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" " + 
				"type=\"application/x-shockwave-flash\" " + 
				"codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab\"" +
				"width=\""+w+"\" " +
				"height=\""+h+"\" " +
				"id=\""+id+"\" " + 
				"name=\""+id+"\" ";
	txt += 		"data=\""+file+"\"><param name=\"movie\" value=\""+file+"\" />";
	if (bg == null){
		txt += "<param name=\"bgcolor\" value=\"#000000\" />";
		txt += "<param name=\"wmode\" value=\"opaque\" />";
	}else if (bg.toLowerCase() == "transparent"){
		txt += "<param name=\"wmode\" value=\"transparent\" />";
	}else{
		txt += "<param name=\"bgcolor\" value=\"#"+bg+"\" />";
		txt += "<param name=\"wmode\" value=\"opaque\" />";
	}
	if(al != null){
		txt += "<param name=\"salign\" value=\""+al+"\" />";
	}
	if (scale != null){
		txt += "<param name=\"scale\" value=\""+scale+"\" />";
	}else{
		txt += "<param name=\"scale\" value=\"noscale\" />";
	}
	if (menu.toLowerCase() == "false") {
		txt += "<param name=\"menu\" value=\"false\" />";
	} else {
		txt += "<param name=\"menu\" value=\"true\" />";
	}
	txt += "<param name=\"allowScriptAccess\" value=\"always\" />";
	txt += "<param name=\"swLiveConnect\" value=\"true\" />";
	txt += "<embed src=\""+file+"\" quality=\"high\" width=\""+w+"\" height=\""+h+"\" name=\""+id+"\" id=\""+id+"\" align=\""+al+"\"";
    if (bg == null) {
		txt += "bgcolor=\"#000000\" ";
		txt += "wmode=\"opaque\" ";
	} else if (bg.toLowerCase() == "transparent") {
		txt += "wmode=\"transparent\" ";
	} else {
		txt += "bgcolor=\"#"+bg+"\" ";
		txt += "wmode=\"opaque\" ";
	}
	if (menu.toLowerCase() == "false") {
		txt += "menu=\"false\" ";
	} else {
		txt += "menu=\"true\" ";
	}
	txt += "play=\"true\" loop=\"false\" quality=\"high\" allowScriptAccess=\"sameDomain\" swLiveConnect=\"true\" type=\"application/x-shockwave-flash\"";
	txt += "pluginspage=\"http://www.macromedia.com/go/getflashplayer\"><\/embed>";	
	txt += "</object>";
	document.write(txt);
}
