﻿showFlash = function(filename,width,height,id)
{
	//type
		// 0: mặc định là ghi ra màn hình chuổi này
		// 1: gán chuổi html này cho một ID với tên là id, nếu không tìm thấy id thì báo lỗi
	var str ='<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000"';
	str+=' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"';
	str+=' border="0" width="'+width+'" height="'+height+'">';
	str+='<param name="movie" value="'+filename+'">';
	str+='<param name="quality" value="High">';
	str+='<param name="menu" value="false">';
	str+='<param name="wmode" value="transparent">';
	str+='<embed src="'+filename+'" pluginspage="http://www.macromedia.com/go/getflashplayer"';
	str+=' type="application/x-shockwave-flash" width="'+width+'" height="'+height+'" quality="High" menu="false" wmode="transparent"></object>';
	if(id != undefined)
	{
		
		if(document.getElementById(id) != null)
		{
			document.getElementById(id).innerHTML = str;
			return;
		}
		else
		{
			alert("showFlash() Error\ncan't show flash because not found object has id [ "+id+" ]");
			return;
		}
	}		
	else
		document.write(str);
}
