function writeSwf(path,sId,w,h,cl,prm){

var swf_param = prm;
var swf_src = path + swf_param;
var swf_width = w;
var swf_height = h;
var swf_id = sId + '_2';
var swf_align = 'middle';
var swf_quality = 'high';
var swf_scale = 'noscale';
var swf_salign = 'lt';
var swf_align = 'left';
var swf_bgcolor = cl;

var swf_classid = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
var swf_codebase = 'https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0';
var swf_allowScriptAccess = 'sameDomain';
var swf_type = 'application/x-shockwave-flash';
var swf_pluginspage = 'https://www.macromedia.com/go/getflashplayer';

swf_code = '<object classid="' + swf_classid + '" codebase="' + swf_codebase + '" width="' + swf_width + '" height="' + swf_height + '" id="mm_001" align="' + swf_align + '">';
swf_code += '<param name="allowScriptAccess" value="' + swf_allowScriptAccess + '" />';
swf_code += '<param name="movie" value="' + swf_src + '" />';
swf_code += '<param name="quality" value="' + swf_quality + '" />';
swf_code += '<param name="scale" value="' + swf_scale + '" />';
swf_code += '<param name="salign" value="' + swf_salign + '" />';

if (swf_bgcolor != 'none') {
swf_code += '<param name="bgcolor" value="' + swf_bgcolor + '" />';
}
else {
swf_code += '<param name="wmode" value="transparent" />';
}

swf_code += '<embed id="mm_002" src="' + swf_src + '" quality="' + swf_quality + '" bgcolor="' + swf_bgcolor + '" wmode="transparent" width="' + swf_width + '" height="' + swf_height + '" name="' + swf_id + '" align="' + swf_align + '" allowScriptAccess="' + swf_allowScriptAccess + '" type="' + swf_type + '" pluginspage="' + swf_pluginspage + '" scale="' + swf_scale + '" salign="' + swf_salign + '" />';
swf_code += '</object>';


window.document.write(swf_code);
//window.alert(swf_code);
}

function writeInnerSwf(path,sId,w,h,cl,prm){

	var swf_param = prm;
	var swf_src = path + swf_param;
	var swf_width = w;
	var swf_height = h;
	var swf_id = sId + '_2';
	var swf_align = 'middle';
	var swf_quality = 'high';
	var swf_scale = 'noscale';
	var swf_salign = 'lt';
	var swf_align = 'left';
	var swf_bgcolor = cl;
	
	var swf_classid = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
	var swf_codebase = 'https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0';
	var swf_allowScriptAccess = 'sameDomain';
	var swf_type = 'application/x-shockwave-flash';
	var swf_pluginspage = 'https://www.macromedia.com/go/getflashplayer';
	
	swf_code = '<object classid="' + swf_classid + '" codebase="' + swf_codebase + '" width="' + swf_width + '" height="' + swf_height + '" id="mm_001" align="' + swf_align + '">';
	swf_code += '<param name="allowScriptAccess" value="' + swf_allowScriptAccess + '" />';
	swf_code += '<param name="movie" value="' + swf_src + '" />';
	swf_code += '<param name="quality" value="' + swf_quality + '" />';
	swf_code += '<param name="scale" value="' + swf_scale + '" />';
	swf_code += '<param name="salign" value="' + swf_salign + '" />';
	
	if (swf_bgcolor != 'none') {
	swf_code += '<param name="bgcolor" value="' + swf_bgcolor + '" />';
	}
	else {
	swf_code += '<param name="wmode" value="transparent" />';
	}
	
	swf_code += '<embed id="mm_002" src="' + swf_src + '" quality="' + swf_quality + '" bgcolor="' + swf_bgcolor + '" wmode="transparent" width="' + swf_width + '" height="' + swf_height + '" name="' + swf_id + '" align="' + swf_align + '" allowScriptAccess="' + swf_allowScriptAccess + '" type="' + swf_type + '" pluginspage="' + swf_pluginspage + '" scale="' + swf_scale + '" salign="' + swf_salign + '" />';
	swf_code += '</object>';
	

//	$(#mm_swf).html(swf_code);
	document.getElementById('mm_swf').innerHTML = swf_code;
}




function writeSwf3(path,sId,w,h,cl,prm){

var swf_param = prm;
var swf_src = path + swf_param;
var swf_width = w;
var swf_height = h;
var swf_id = sId + '_2';
var swf_align = 'middle';
var swf_quality = 'high';
var swf_scale = 'noscale';
var swf_salign = 'lt';
var swf_align = 'left';
var swf_bgcolor = cl;

var swf_classid = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
var swf_codebase = 'https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0';
var swf_allowScriptAccess = 'sameDomain';
var swf_type = 'application/x-shockwave-flash';
var swf_pluginspage = 'https://www.macromedia.com/go/getflashplayer';

swf_code = '<object classid="' + swf_classid + '" codebase="' + swf_codebase + '" width="' + swf_width + '" height="' + swf_height + '" id="mm_001" align="middle">';
swf_code += '<param name="allowScriptAccess" value="' + swf_allowScriptAccess + '" />';
swf_code += '<param name="movie" value="' + swf_src + '" />';
swf_code += '<param name="quality" value="' + swf_quality + '" />';
swf_code += '<param name="scale" value="' + swf_scale + '" />';
swf_code += '<param name="salign" value="' + swf_salign + '" />';

if (swf_bgcolor != 'none') {
swf_code += '<param name="bgcolor" value="' + swf_bgcolor + '" />';
}
else {
swf_code += '<param name="wmode" value="transparent" />';
}

swf_code += '<embed id="mm_002" src="' + swf_src + '" quality="' + swf_quality + '" bgcolor="' + swf_bgcolor + '" wmode="transparent" width="' + swf_width + '" height="' + swf_height + '" name="' + swf_id + '" align="' + swf_align + '" allowScriptAccess="' + swf_allowScriptAccess + '" type="' + swf_type + '" pluginspage="' + swf_pluginspage + '" scale="' + swf_scale + '" salign="' + swf_salign + '" />';
swf_code += '</object>';


window.document.write(swf_code);
//window.alert(swf_code);
}


function writeSwf3B(path,sId,w,h,cl){

var swf_src = path + '?r='+Math.random();
var swf_width = w;
var swf_height = h;
var swf_id = sId + '_2';
var swf_align = 'middle';
var swf_quality = 'high';
var swf_scale = 'noscale';
var swf_salign = 'lt';
var swf_align = 'left';
var swf_bgcolor = cl;

var swf_classid = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
var swf_codebase = 'https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0';
var swf_allowScriptAccess = 'sameDomain';
var swf_type = 'application/x-shockwave-flash';
var swf_pluginspage = 'https://www.macromedia.com/go/getflashplayer';

swf_code = '<object classid="' + swf_classid + '" codebase="' + swf_codebase + '" width="' + swf_width + '" height="' + swf_height + '" id="mm_001" align="middle">';
swf_code += '<param name="allowScriptAccess" value="' + swf_allowScriptAccess + '" />';
swf_code += '<param name="movie" value="' + swf_src + '" />';
swf_code += '<param name="quality" value="' + swf_quality + '" />';
swf_code += '<param name="scale" value="' + swf_scale + '" />';
swf_code += '<param name="salign" value="' + swf_salign + '" />';

if (swf_bgcolor != 'none') {
swf_code += '<param name="bgcolor" value="' + swf_bgcolor + '" />';
}
else {
swf_code += '<param name="wmode" value="transparent" />';
}

swf_code += '<embed id="mm_002" src="' + swf_src + '" quality="' + swf_quality + '" bgcolor="' + swf_bgcolor + '" wmode="transparent" width="' + swf_width + '" height="' + swf_height + '" name="' + swf_id + '" align="' + swf_align + '" allowScriptAccess="' + swf_allowScriptAccess + '" type="' + swf_type + '" pluginspage="' + swf_pluginspage + '" scale="' + swf_scale + '" salign="' + swf_salign + '" />';
swf_code += '</object>';


window.document.write(swf_code);
//window.alert(swf_code);
}

function writeSwf4(path,sId,w,h,cl,prm){

	var swf_param = prm;
	var swf_src = path + swf_param;
	var swf_width = w;
	var swf_height = h;
	var swf_id = sId + '_2';
	var swf_align = 'middle';
	var swf_quality = 'high';
	var swf_scale = 'noscale';
	var swf_salign = 'lt';
	var swf_align = 'left';
	var swf_bgcolor = '#FFFFFF';
	
	var swf_classid = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
	var swf_codebase = 'https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0';
	var swf_allowScriptAccess = 'sameDomain';
	var swf_type = 'application/x-shockwave-flash';
	var swf_pluginspage = 'https://www.macromedia.com/go/getflashplayer';
	
	swf_code = '<object classid="' + swf_classid + '" codebase="' + swf_codebase + '" width="' + swf_width + '" height="' + swf_height + '" id="mm_001" align="' + swf_align + '">';
	swf_code += '<param name="allowScriptAccess" value="' + swf_allowScriptAccess + '" />';
	swf_code += '<param name="movie" value="' + swf_src + '" />';
	swf_code += '<param name="quality" value="' + swf_quality + '" />';
	swf_code += '<param name="scale" value="' + swf_scale + '" />';
	swf_code += '<param name="salign" value="' + swf_salign + '" />';
	swf_code += '<param name="bgcolor" value="' + swf_bgcolor + '" />';
	swf_code += '<embed id="mm_002" src="' + swf_src + '" quality="' + swf_quality + '" bgcolor="' + swf_bgcolor + '" width="' + swf_width + '" height="' + swf_height + '" name="' + swf_id + '" align="' + swf_align + '" allowScriptAccess="' + swf_allowScriptAccess + '" type="' + swf_type + '" pluginspage="' + swf_pluginspage + '" scale="' + swf_scale + '" salign="' + swf_salign + '" />';
	swf_code += '</object>';
	
	
	window.document.write(swf_code);
	//window.alert(swf_code);
}


function writeSwfWidthHeightMax(filepath,bgColor){

// var bgColor = '#000000';
//	var rnd = Math.random();
// var swfPath = filepath + '?t=' + rnd;
 var swfPath = filepath;	

 swf_code  = '<object';
 swf_code += ' classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"';
 swf_code += ' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"';
 swf_code += ' width="100%"';
 swf_code += ' height="100%"';
 swf_code += ' id="top001"';
 swf_code += ' align="middle">';
 swf_code += '	<param name="allowScriptAccess" value="sameDomain" />';
 swf_code += '	<param name="movie" value="' + swfPath + '" />';
 swf_code += '	<param name="quality" value="high" />';
 swf_code += '	<param name="scale" value="exactfit" />';
 swf_code += '	<param name="salign" value="lt" />';
 swf_code += '	<param name="bgcolor" value="' + bgColor + '" />';
// swf_code += '	<param name="wmode" value="transparent" />';
 swf_code += '	<embed src="' + swfPath + '"';
 swf_code += '	 quality="high"';
 swf_code += '	 scale="exactfit"';
 swf_code += '	 salign="lt"';
 swf_code += '	 bgcolor="' + bgColor + '"';
// swf_code += '	 wmode="transparent"';
 swf_code += '	 width="100%"';
 swf_code += '	 height="100%"';
 swf_code += '	 name="top001"';
 swf_code += '	 align="middle"';
 swf_code += '	 allowScriptAccess="sameDomain"';
 swf_code += '	 type="application/x-shockwave-flash"';
 swf_code += '	 pluginspage="http://www.macromedia.com/go/getflashplayer"/>';
 swf_code += '</object>';

 window.document.write(swf_code);

}

