function daumActiveX(obj,div){
	// generate html code
	// for ie obejct
	

	var tempDiv = document.getElementById(div);
	if (tempDiv == null) {
			return;
	}
	
	var html = '<object ';
	if (!obj.id && !obj.name){
		var r = Math.round(Math.random()*100);
		html += 'id="daumActiveXObject'+r+'" name="daumActiveXObject'+r+'" ';
	} else {
		if (obj.id) html += 'id="'+obj.id+'" ';
		else html += 'id="'+obj.name+'" ';
		if (obj.name) html += 'name="'+obj.name+'" ';
		else html += 'name="'+obj.id+'" ';
	}
	if (obj.type) html += 'type="'+obj.type+'" ';
	if (obj.classid) html += 'classid="'+obj.classid+'" ';
	if (obj.width) html += 'width="'+obj.width+'" ';
	if (obj.height) html += 'height="'+obj.height+'" ';
	if (obj.codebase) html += 'codebase="'+obj.codebase+'" ';
	// append events
	for (var i in obj.events){
		if (obj.events[i]){
			html += obj.events[i][0]+'="'+obj.events[i][1]+'" ';
		}
	}
	// end of object tag
	html += '>\n';
	// append params
	for (var i in obj.param){
		html += '<param name="'+obj.param[i][0]+'" value="'+obj.param[i][1]+'"/>\n';
	}

	// for ns embed
	html += '<embed ';
	if (!obj.id && !obj.name){
		var r = Math.round(Math.random()*100);
		html += 'id="daumActiveXObject'+r+'" name="daumActiveXObject'+r+'" ';
	} else {
		if (obj.id) html += 'id="'+obj.id+'" ';
		if (obj.name) html += 'name="'+obj.name+'" ';
	}
	if (obj.type) html += 'type="'+obj.type+'" ';
	if (obj.width) html += 'width="'+obj.width+'" ';
	if (obj.height) html += 'height="'+obj.height+'" ';
	// append params
	html += ' allowScriptAccess="always" ';
	for (var i in obj.param){
		if (obj.param[i][0]){
			if (obj.param[i][0]=='movie' || obj.param[i][0]=='src'){
				var _src = obj.param[i][1];
			}
			if (obj.param[i][0].toLowerCase()=='flashvars'){
				if (_src){
					var tmpArr = html.split('src="'+_src+'"');
					html = tmpArr[0]+' src="'+_src+obj.param[i][1]+'" '+tmpArr[1];
				} else {
					obj.param[obj.param.length] = obj.param[i];
				}
			} else {
				html += obj.param[i][0]+'="'+obj.param[i][1]+'" ';
			}
		}
	}

	html += '/>\n';
	html += '</object>';


	
	var isIE = (document.all)?true:false;
	if (isIE){
		document.getElementById(div).innerHTML = html;
	} else if (obj.type=='application/x-shockwave-flash' || obj.classid.toLowerCase()=='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'){
		document.getElementById(div).innerHTML = html;
	} else if (navigator.platform.indexOf('Win')>=0 && obj.classid.toLowerCase()=='clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95'){
		document.getElementById(div).innerHTML = html;
	}

	//window.alert (html);
}

function daumFlash(src,width,height,div,vars){

	var obj = new Object();
	obj.type = 'application/x-shockwave-flash';
	obj.classid = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
	obj.codebase = 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0';
	obj.wmode = 'transparent';
	obj.width = width;
	obj.height = height;

	var param = [
		['movie',src],
		['src',src],
		['quality','high'],
		['wmode','transparent'],
		['bgcolor','#FFFFFF'],
		['scale','exactfit'],
		['allowScriptAccess','always'],
		['pluginspage','http://www.macromedia.com/go/getflashplayer'],
	];
	if(vars){
		param[param.length] = ['FlashVars',"?&page_code="+vars];
	}
	obj.param = param;
	daumActiveX(obj,div);
}

var conId = 1;
function daumFlash03(src,width,height,div,vars){

	var obj = new Object();
	obj.type = 'application/x-shockwave-flash';
	obj.classid = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
	obj.codebase = 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0';
	obj.wmode = 'transparent';
	obj.scale = 'exactfit';
	obj.width = width;
	obj.height = height;

 	var param = [
		['movie',src],
		['src',src],
		['quality','high'],
		['wmode','transparent'],
		['bgcolor','#FFFFFF'], 
		['scale','exactfit'],
		['allowScriptAccess','always'],
		['pluginspage','http://www.macromedia.com/go/getflashplayer'],
	];
	if(vars){
		param[param.length] = ['FlashVars',"page_code="+vars];
	}
	obj.param = param;
	daumActiveX(obj,div);
}

function daumFlash04(src,width,height,div,vars){

	var obj = new Object();
	obj.type = 'application/x-shockwave-flash';
	obj.classid = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
	obj.codebase = 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0';
	obj.wmode = 'transparent';
	obj.scale = 'exactfit';
	obj.width = width;
	obj.height = height;

 	var param = [
		['movie',src],
		['src',src],
		['base',src],
		['quality','high'],
		['wmode','transparent'],
		['bgcolor','#FFFFFF'], 
		['scale','exactfit'],
		['allowScriptAccess','always'],
		['pluginspage','http://www.macromedia.com/go/getflashplayer'],
	];
	if(vars){
		param[param.length] = ['FlashVars',"page_code="+vars];
	}
	obj.param = param;
	daumActiveX(obj,div);
}

function daumActiveX02(obj,div){
	// generate html code
	// for ie obejct
	var html = '<object ';
	if (!obj.id && !obj.name){		
		html += 'id="FlashList" name="FlashList" ';
	} else {
		if (obj.id) html += 'id="'+obj.id+'" ';
		else html += 'id="'+obj.name+'" ';
		if (obj.name) html += 'name="'+obj.name+'" ';
		else html += 'name="'+obj.id+'" ';
	}
	if (obj.type) html += 'type="'+obj.type+'" ';
	if (obj.classid) html += 'classid="'+obj.classid+'" ';
	if (obj.width) html += 'width="'+obj.width+'" ';
	if (obj.height) html += 'height="'+obj.height+'" ';
	if (obj.codebase) html += 'codebase="'+obj.codebase+'" ';
	// append events
	for (var i in obj.events){
		if (obj.events[i]){
			html += obj.events[i][0]+'="'+obj.events[i][1]+'" ';
		}
	}
	// end of object tag
	html += '>\n';
	// append params
	for (var i in obj.param){
		html += '<param name="'+obj.param[i][0]+'" value="'+obj.param[i][1]+'"/>\n';
	}

	// for ns embed
	html += '<embed ';
	if (!obj.id && !obj.name){
		html += 'id="FlashList" name="FlashList" ';
	} else {
		if (obj.id) html += 'id="'+obj.id+'" ';
		if (obj.name) html += 'name="'+obj.name+'" ';
	}
	if (obj.type) html += 'type="'+obj.type+'" ';
	if (obj.width) html += 'width="'+obj.width+'" ';
	if (obj.height) html += 'height="'+obj.height+'" ';
	// append params
	html += ' allowScriptAccess="always" ';
	html += ' showLiveConnect="true" ';
	for (var i in obj.param){
		if (obj.param[i][0]){
			if (obj.param[i][0]=='movie' || obj.param[i][0]=='src'){
				var _src = obj.param[i][1];
			}
			if (obj.param[i][0].toLowerCase()=='flashvars'){
				if (_src){
					var tmpArr = html.split('src="'+_src+'"');
					html = tmpArr[0]+' src="'+_src+'&'+obj.param[i][1]+'" '+tmpArr[1];
				} else {
					obj.param[obj.param.length] = obj.param[i];
				}
			} else {
				html += obj.param[i][0]+'="'+obj.param[i][1]+'" ';
			}
		}
	}

	html += '/>\n';
	html += '</object>';
	var isIE = (document.all)?true:false;
	if (isIE){
		document.getElementById(div).innerHTML = html;
		//window.alert (html);
	} else if (obj.type=='application/x-shockwave-flash' || obj.classid.toLowerCase()=='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'){
		document.getElementById(div).innerHTML = html;
	} else if (navigator.platform.indexOf('Win')>=0 && obj.classid.toLowerCase()=='clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95'){
		document.getElementById(div).innerHTML = html;
	}
}

function daumFlash02(src,width,height,div, vars){

	var obj = new Object();
	obj.type = 'application/x-shockwave-flash';
	obj.classid = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
	obj.codebase = 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0';
	obj.wmode = 'transparent';
	obj.scale = 'exactfit';
	obj.width = width;
	obj.height = height;

	var param = [
		['movie',src],
		['src',src],
		['quality','high'],
		['wmode','transparent'],
		['bgcolor','#FFFFFF'], 
		['scale','exactfit'],
		['allowScriptAccess','always'],
		['pluginspage','http://www.macromedia.com/go/getflashplayer'],
	];
	if(vars){
		param[param.length] = ['FlashVars',"page_code="+vars];
	}
	obj.param = param;
	daumActiveX02(obj,div);
}

// 
function daumFlashWithNoTransparent(src,width,height,div,vars){

	var obj = new Object();
	obj.type = 'application/x-shockwave-flash';
	obj.classid = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
	obj.codebase = 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0';
	obj.wmode = 'transparent';
	obj.width = width;
	obj.height = height;

	var param = [
		['movie',src],
		['src',src],
		['quality','high'],
		['wmode','window'],
		['bgcolor','#FFFFFF'],
		['scale','exactfit'],
		['allowScriptAccess','always'],
		['pluginspage','http://www.macromedia.com/go/getflashplayer'],
	];
	if(vars){
		param[param.length] = ['FlashVars',"&page_code="+vars];
	}
	obj.param = param;
	daumActiveX(obj,div);
}

