function includeSwf(url, id, width, height, transparent) {
	document.write(getSwfHtml(url, id, width, height, transparent));
}

function getSwfHtml(url, id, width, height, transparent) {
	var theHtml = 	"<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width=\"" + width + "\" height=\"" + height + "\" id=\"" + id + "\" align=\"middle\">" +
				"<param name=\"allowScriptAccess\" value=\"sameDomain\" />" +
				"<param name=\"movie\" value=\"" + url + "\" />" +
				"<param name=\"quality\" value=\"high\" />" +
				"<param name=\"scale\" value=\"noscale\" />" +
				"<param name=\"salign\" value=\"tl\" />" +
				"<param name=\"bgcolor\" value=\"#ffffff\" />";

	if(transparent)
		theHtml += "<param name=\"wmode\" value=\"transparent\" />";

	theHtml += "<embed";

	if(transparent)
		theHtml += " wmode=\"transparent\""

	theHtml +=	" src=\"" + url + "\" quality=\"high\" scale=\"noscale\" salign=\"tl\" swliveconnect=\"true\" bgcolor=\"#ffffff\" width=\"" + width + "\" height=\"" + height + "\" name=\"" + id + "\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />" +
				"</object>";

	return theHtml;
}

function writeSwf(targetDivId, url, id, width, height, transparent) {
	var theHtml = getSwfHtml(url, id, width, height, transparent);
	var targetDiv = document.getElementById(targetDivId);
	targetDiv.innerHTML = theHtml;
}