
/*
IE Flash ActiveContent Activation Script
Author: Faisal Iqbal (chall3ng3r)
Blog: http://www.orison.biz/blog/chall3ng3r/

Feel free to modify or distribute.
*/
 
/*
Method: FlashObject
 Param1: SWF path
 Param2: Movie width
 Param3: Movie height
 Param4: BGColor
 Param5: Flashvars (Optional)
*/

/*
modify by k.s.c 2007-11-15
*/
function FlashObject(swf, width, height, bgcolor, id, flashvars)
{
    var strFlashTag = new String();
    
    if (navigator.appName.indexOf("Microsoft") != -1)
    {
        strFlashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
        strFlashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=version=8,0,0,0" ';
        strFlashTag += 'id="' + id + '" width="' + width + '" height="' + height + '">';
        strFlashTag += '<param name="movie" value="' + swf + '"/>';
        
        if(flashvars != null) {strFlashTag += '<param name="flashvars" value="' + flashvars + '"/>'};
        strFlashTag += '<param name="quality" value="best"/>';
        strFlashTag += '<param name="bgcolor" value="' + bgcolor + '"/>';
        strFlashTag += '<param name="menu" value="false"/>';
        strFlashTag += '<param name="salign" value="LT"/>';
        strFlashTag += '<param name="scale" value="noscale"/>';
        strFlashTag += '<param name="wmode" value="transparent"/>';
        strFlashTag += '<param name="allowScriptAccess" value="sameDomain"/>';
        strFlashTag += '</object>';
    }
    else
    {
        strFlashTag += '<embed src="' + swf + '" ';
        strFlashTag += 'quality="best" ';
        strFlashTag += 'bgcolor="' + bgcolor + '" ';
        strFlashTag += 'width="' + width + '" ';
        strFlashTag += 'height="' + height + '" ';
        strFlashTag += 'menu="false" ';
        strFlashTag += 'scale="noscale" ';
         strFlashTag += 'id="' + id + '" ';
        strFlashTag += 'salign="LT" ';
       //  strFlashTag += 'wmode="transparent" ';
        strFlashTag += 'allowScriptAccess="sameDomain" ';
        if(flashvars != null) {strFlashTag += 'flashvars="' + flashvars + '" '};
        strFlashTag += 'type="application/x-shockwave-flash" ';
        strFlashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
        strFlashTag += '</embed>';
    }

 document.write(strFlashTag);
}
 
  



//////////////////////////////////////
// IE Embed patch
//
// @author iezn@iezn.com
// @homepage http://iezn.com
// @create date 2006.04.19
// @last modify 2007.02.15
// @version 0.42
// ¹èÆ÷½Ã À§³»¿ëÀ» Æ÷ÇÔÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù
//////////////////////////////////////
/**
* embed ÆÐÄ¡ Àû¿ë ÄÁÅ×ÀÌ³Ê
* nullÀÎ°æ¿ì document °ªÀ» ±âº»À¸·Î ÇÕ´Ï´Ù
* id°ªÀ» ¼³Á¤ÇÑ°æ¿ì ¼³Á¤¹üÀ§ ³»¿¡¸¸ Àû¿ëÀÌ µË´Ï´Ù
* 
* º»¹®ÀÌ³ª ÀÏºÎ ³ëµå¿¡¸¸ Àû¿ëÇÒ°æ¿ì ÇØ´ç ³ëµåÀÇ id °ªÀ» ÀÔ·ÂÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù
* ¿¹)
* var __embed_target_id = "contents";
* ·Î Ã³¸®ÇÑ°æ¿ì body ³»¿¡ <ÅÂ±× id="contents">ÇÃ·¡½¬,µ¿¿µ»ó...</ÅÂ±×>
* ¾È¿¡ ³»¿ë¿¡¸¸ ÆÐÄ¡°¡ Àû¿ëµË´Ï´Ù
*/
if(typeof(__embed_target_id)=='undefined'){
	var __embed_target_id = null;
}

/**
* embed ÆÐÄ¡¸¦ Àû¿ëÇÒ ÅÂ±×¸¦ ¼³Á¤ÇÕ´Ï´Ù
* ±âº»°ªÀº object,eembed,appelt ÅÂ±×ÀÔ´Ï´Ù
* false °ªÀÎ°æ¿ì ÆÐÄ¡¿¡¼­ Á¦¿ÜµË´Ï´Ù
*/
if(typeof(__embed_tags)=='undefined'){
	var __embed_tags = {object:true,embed:true,applet:false}
}

/**
* ÇÃ·¡½¬ÆÄÀÏÁß flashvars ¸¦ »ç¿ëÇÒ°æ¿ì ÇØ´ç ÇÃ·¡½¬ÀÇ ¿ÀºêÁ§Æ®¾ÆÀÌµð:true °ªÀ¸·Î object¸¦ µî·ÏÇØ ÁÖ¼¼¿ä
*/
var __flash_force_objs = {};
if(navigator.userAgent.toLowerCase().indexOf('opera')==-1){//opera out
	if(document.attachEvent){
		document.write('<style type="text/css">');
		document.write('object,embed{display:none;}');
		document.write('</style>');
		document.attachEvent('onreadystatechange',
			function (){				
				if(__embed_target_id===null){
					var __target = document;
				}else{
					var __target = document.getElementById(__embed_target_id);
				}
				if (document.readyState == "complete"){
					function _replace(obj){
						var obj_re = document.createElement(obj.outerHTML);					
						obj_re.style.display='inline';
						obj.parentNode.replaceChild(obj_re,obj);
					}
					function _inner(obj){
						obj.style.display='inline';					
						var html = obj.outerHTML;
						var classid = obj.classid.toLowerCase();
						if(classid=='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' && typeof(__flash_force_objs[obj.id])=='undefined'){//flash ÀÎ°æ¿ì
							obj.insertAdjacentHTML('beforeBegin',html);
							obj.parentNode.removeChild(obj);
						}else if(classid=='clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b'){
							//ÄüÅ¸ÀÓ

						}else{
							//º¯°æÇÏ°íÀÚÇÏ´Â ActiveX classid ¸¦ Ãß°¡ÇÏ½Ã±â ¹Ù¶ø´Ï´Ù
							if(classid=='clsid:6bf52a52-394a-11d3-b153-00c04f79faa6' || //media 7
							classid=='clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95' || //6.4
							classid=='clsid:6bf52a52-394a-11d3-b153-00c04f79faa6' ||
							classid=='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'
							){
								embed_pos = html.indexOf('embed');
								if(embed_pos!=-1){//embed °¡ Á¸ÀçÇÏ´Â°æ¿ì
									var embed = '<'+html.substr(embed_pos);
									embed = embed.substr(0,embed.length-9);
									obj.insertAdjacentHTML('beforeBegin',embed);
									obj.parentNode.removeChild(obj);
								}else{
									//object·Î¸¸ µÇ¾î ÀÖ´Â°æ¿ì µ¿¿µ»ó ºÎºÐ¸¸ ÆÐÄ¡ÇÑ´Ù
									var embed = document.createElement('embed');
									if(obj.id){
										embed.id = obj.id;
									}
									var total = obj.childNodes.length;
									//embed.setAttribute('autostart',0);
									if(obj.width){
										embed.setAttribute('width',obj.width);
									}
									if(obj.height){
										embed.setAttribute('height',obj.height);
									}
									for(var k=0;k<total;k++){
										n = obj.childNodes.item(k).getAttribute("name");
										v = obj.childNodes.item(k).getAttribute("value");
										if(n=='URL' || n=='url' || n=='FileName'){
											n = 'src';
										}
										embed.setAttribute(n,v);
									}
									if(embed.getAttribute('src')){
										embed.style.display = 'inline';
										obj.parentNode.replaceChild(embed,obj);
									}else{
										//ÆÄÀÏ¿¢¼¼½º object°¡ ¾Æ´Ñ°æ¿ì´Â À¯ÁöÇÑ´Ù								
									}
								}
							}
						}
					}

					if(__embed_tags.object===true){
						var objs = __target.getElementsByTagName('object');
						var i = objs.length;
						while(i-->0){
							_inner(objs[i]);
						}
					}
					if(__embed_tags.embed===true){
						var objs = __target.getElementsByTagName('embed');
						var i = objs.length;
						while(i-->0){
							_replace(objs[i])
						}
					}

					if(__embed_tags.applet===true){
						var objs = __target.getElementsByTagName('applet');
						var i = objs.length;
						while(i-->0){
							_replace(objs[i])
						}
					}
				}
			}
		);
	}
}


