/**

 * IE embed 활성화(패치)

 *

 * 작성자 : 정 혁 (jjjhyeok@naver.com)

 * 작성일 : 2007.10.15

 */



/**

 * make flash contents

 *

 * @s : source url

 * @d : flash id

 * @w : source width

 * @h : source height

 * @t : wmode ("" for none, transparent, opaque ...)

 */

function make_flash(s, d, w, h, t) {
	var embed = "";
	embed += "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"" + w + "\" height=\"" + h + "\" id=\"" + d + "\">";
	embed += "<param name=\"Movie\" value=\"" + s + "\" />";
	embed += "<param name=\"Src\" value=\"" + s + "\" />";
	embed += "<param name=\"WMode\" value=\"" + t + "\" />";
	embed += "<param name=\"Quality\" value=\"high\" />";
	embed += "<param name=\"Menu\" value=\"false\" />";
	embed += "<embed type=\"application/x-shockwave-flash\" src=\"" + s +"\" id=\"" + d + " quality=\"high\" wmode=\"" + t + "\" width=\"" + w + "\" height=\"" + h + "\"></embed>";
	embed += "</object>";
	documentwrite(embed);
}


/**

 * make movie contents

 *

 * @s : source url

 * @d : movie id

 * @w : source width

 * @h : source height

 * @auto: autostart

 * @ctrl : controls

 * @status : statusbar

 * @etc : etc options

 */

function make_movie(s, d, w, h, auto, ctrl, status, etc) {

	if (auto == undefined) auto = 1;

	if (ctrl == undefined) ctrl = 1;

	if (etc == undefined) etc = '';



	var wh = "";

	// controls : 45px, status : 23px;

	if (parseInt(w) && parseInt(h)) {

		if (ctrl) h += 45;

		if (status) h += 23;

		wh = " width='" + w + "' height='" + h +"'";

	}



	// for FF! (true:1, false:0)

	var opt = " invokeURLs='false' loop='1'";

	opt += " autostart='" + auto + "'";

	opt += " showcontrols='" + ctrl + "'";

	if (status != undefined) opt += " showstatusbar='" + status + "'";

	//opt += " showaudiocontrols='0' showpositioncontrols='0' showtracker='0'";

	var embed = "<embed id='" + d + "' src='" + s + "'" + wh + opt + etc +"></embed>";

	documentwrite(embed);

}



// write document contents

function documentwrite(src) {

	document.write(src);

}



// assign code innerHTML

function setcode(target, code) {

	target.innerHTML = code;

}
