function insertFlash(id, contentPath, altText, width, height, flashVersion, extraParams) {

	var protocol = "http";
	if (document.URL.indexOf("https") == 0) {
		protocol = "https";
	}	

	var html = "<" + "object" + " classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' ";
	html += "codebase='" + protocol + "://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=" + flashVersion + "' ";

	if (width > 0) {
		html += "width='" + width + "' ";
	}
	if (height > 0) {
		html += "height='" + height + "' ";
	}
	if (extraParams != "") {
		html += extraParams + " ";
	}
    
    html += "id='" + altText + "'>";
    html += "<param name='movie' value='" + contentPath + "' />";
    html += "<param name='quality' value='high' />";
    html += "<param name='bgcolor' value='#FFFFFF' />";
    html += "<param name='wmode' value='transparent' />";
    html += "<param name='allowScriptAccess' value='sameDomain' />";
    html += "<embed src='" + contentPath + "' quality='high' bgcolor='#FFFFFF' ";
    html += "name='" + altText + "' ";
    if (width > 0) {
		html += "width='" + width + "' ";
	}
	if (height > 0) {
		html += "height='" + height + "' ";
	}
	if (extraParams != "") {
		html += extraParams + " ";
	}
	html += "wmode='transparent' ";
	html += "allowScriptAccess='sameDomain' ";
    html += "type='application/x-shockwave-flash' ";
    html += "pluginspage='" + protocol + "://www.macromedia.com/go/getflashplayer' />";
    html += "</object>";
    
    document.getElementById(id).innerHTML = html;
}