<!--
/*
FlashActive
	path : /js/FlashActive.js
	author : hamhaja <hamhaja@nextez.co.kr>
	since : 2006-02-27

	usage :
		new FlashActive();		// °´Ã¼ ÃÊ±âÈ­
		<div flash src='' width='' height='' style='height='></div>

		or

		<script language='javascript'>
		<!--
			flash_active_write('flash.swf', 400, 300, 'high', 'transparent');
		//-->
		</script>


	attribute :
		src : °æ·Î
		width : ³Êºñ
		height : ³ôÀÌ
		quality :
*/
FlashActive = function()
{
    if (!document.body.getAttribute) return false;
	if (document.getElementsByTagName)
    {
		var els = document.getElementsByTagName('div');
		for (var i=0; i<els.length; i++)
		{
			if (els[i].getAttribute("flash") != null)
				this.init(els[i]);
		}
    }
}
FlashActive.prototype.init = function(el)
{
	if (el.getAttribute("src") != null) var src = el.getAttribute("src");
	else var src = '';
	if (el.getAttribute("width") != null) var width = el.getAttribute("width");
	else var width = '';
	if (el.getAttribute("height") != null) var height = el.getAttribute("height");
	else var height = '';
	if (el.getAttribute("quality") != null) var quality = el.getAttribute("quality");
	else var quality = 'high';
	if (el.getAttribute("wmode") != null) var wmode = el.getAttribute("wmode");
	else var wmode = '';

	var _html = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"  codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"" + width + "\" height=\"" + height + "\"><param name=\"movie\" value=\"" + src + "\">";
	if (wmode != '')
		_html += "<param name=\"wmode\" value=\"" + wmode + "\">";
	_html += "<param name=\"quality\" value=\"" + quality + "\"><embed src=\"" + src + "\" quality=\"" + quality + "\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + width + "\" height=\"" + height + "\"></embed></object>";
	el.innerHTML = _html;
}
function flash_active_write(src, width, height, quality, wmode, ssl)
{
	var protocol = "http://";
	if (ssl == 'on') protocol = "https://";

	if (src != '')
	{
		var _html = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"  codebase=\"" + protocol + "download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"" + width + "\" height=\"" + height + "\"><param name=\"movie\" value=\"" + src + "\">";
		if (wmode != '')
			_html += "<param name=\"wmode\" value=\"" + wmode + "\">";
		_html += "<param name=\"quality\" value=\"" + quality + "\"><embed src=\"" + src + "\" quality=\"" + quality + "\" pluginspage=\"" + protocol + "www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + width + "\" height=\"" + height + "\"></embed></object>";
		document.write(_html);
	}
}
function active_object(tagname)
{
    var els = document.getElementsByTagName(tagname);
    for (var i=0; i<els.length; i++)
    {
        var div = document.createElement("DIV");
        var parentNode = els[i].parentNode;
        parentNode.insertBefore(div, els[i]);
        div.appendChild(els[i]);
        div.innerHTML = div.innerHTML;
    }
}
function flash_code_write(code)
{
	document.write(code);
}
//-->
