/**************************************************************
 *
 * [embedswf.js] SWF embed HTML code generator.
 *      initial at 2006.012.11 by Hiroyuki Nakatsuka rev.1.00
 *          modified at 2008.05.21 by Blow Line Inc. rev.2.00
 *          modified at 2009.05.08 by Blow Line Inc. rev.3.00
 * @author : hiroyu-n@blowline.co.jp
**************************************************************/
function embedSwf_Str(id, w, h, file, fv ) {
	var htm="";
	htm+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="' + w + '" height="' + h + '" id="' + id + '" name="' + id  + '" align="middle">'+"\n";
	htm+='<param name="allowScriptAccess" value="sameDomain" />'+"\n";
	htm+='<param name="movie" value="' + file + '" />'+"\n";
	htm+='<param name="quality" value="high" />'+"\n";
	htm+='<param name="scale" value="noscale" />'+"\n";
	htm+='<param name="salign" value="lt" />'+"\n";
	htm+='<param name="allowFullScreen" value="true" />'+"\n";
	htm+='<param name="bgcolor" value="#ffffff" />'+"\n";
	htm+='<param name="FlashVars" value="' + fv + '" />'+"\n";
	htm+='<embed src="' + file + '" quality="high" scale="noscale" salign="lt" allowfullscreen="true" bgcolor="#ffffff" width="' + w + '" height="' + h + '" name="' + id + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer"'+"\n";
	htm+='FlashVars="' + fv + '" />'+"\n";
	htm+='</object>'+"\n";
	return htm;
}
function embedSwf(id, w, h, file, vars ) {
	var fv = "";
	if (vars) {
		for (i in vars) {
			fv += i + "=" + encodeURIComponent(vars[i]) + "&";
		}
	}
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="' + location.protocol + '//fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="' + w + '" height="' + h + '" id="' + id + '" name="' + id + '" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="' + file + '" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="scale" value="noscale" />');
	document.write('<param name="salign" value="lt" />');
	document.write('<param name="allowFullScreen" value="true" />');
	document.write('<param name="bgcolor" value="#ffffff" />');
	document.write('<param name="FlashVars" value="' + fv + '" />');
	document.write('<embed src="' + file + '" quality="high" scale="noscale" salign="lt" allowfullscreen="true" bgcolor="#ffffff" width="' + w + '" height="' + h + '" name="' + id + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="' + location.protocol + '//www.macromedia.com/go/getflashplayer"');
	document.write('FlashVars="' + fv + '" />');
	document.write('</object>');
}

function embedSwf_DOM(id, w, h, file, vars, parentObj) {
	var fv = "";
	if (vars) {
		for (i in vars) {
			fv += i + "=" + encodeURIComponent(vars[i]) + "&";
		}
	}
	var objEl = document.createElement("object");
	/*objEl.setAttribute("classid", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000");
	objEl.setAttribute("codebase", location.protocol + "//fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0");
	objEl.setAttribute("width", String(w));
	objEl.setAttribute("height", String(h));
	objEl.setAttribute("id", id);
	objEl.setAttribute("align", "middle");*/
	objEl.classid = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000";
	objEl.codebase = location.protocol + "//fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0";
	objEl.width = String(w);
	objEl.height = String(h);
	objEl.id = id;
	objEl.align = "middle";
	var param1El = document.createElement("param");
	param1El.name = "allowScriptAccess";
	param1El.value = "sameDomain";
	var param2El = document.createElement("param");
	param2El.name = "movie";
	param2El.value = file;
	var param3El = document.createElement("param");
	param3El.name = "quality";
	param3El.value = "high";
	var param4El = document.createElement("param");
	param4El.name = "scale";
	param4El.value = "noscale";
	var param5El = document.createElement("param");
	param5El.name = "salign";
	param5El.value = "lt";
	var param5bEl = document.createElement("param");
	param5bEl.name = "allowFullScreen";
	param5bEl.value = "true";
	var param6El = document.createElement("param");
	param6El.name = "bgcolor";
	param6El.value = "#ffffff";
	var param7El = document.createElement("param");
	param7El.name = "FlashVars";
	param7El.value = fv;
	var embedEl = document.createElement("embed");
	if(parentObj){
		parentObj.appendChild(objEl);
	}
	embedEl.setAttribute("src", file);
	embedEl.setAttribute("quality", "high");
	embedEl.setAttribute("scale", "noscale");
	embedEl.setAttribute("salign", "lt");
	embedEl.setAttribute("allowfullscreen", "true");
	embedEl.setAttribute("bgcolor", "#ffffff");
	embedEl.setAttribute("width", String(w));
	embedEl.setAttribute("height", String(h));
	embedEl.setAttribute("name", id);
	embedEl.setAttribute("align", "middle");
	embedEl.setAttribute("allowScriptAccess", "sameDomain");
	embedEl.setAttribute("type", "application/x-shockwave-flash");
	embedEl.setAttribute("pluginpage", location.protocol + "//www.macromedia.com/go/getflashplayer");
	embedEl.setAttribute("FlashVars", fv);
	objEl.appendChild(param1El);
	objEl.appendChild(param2El);
	objEl.appendChild(param3El);
	objEl.appendChild(param4El);
	objEl.appendChild(param5El);
	objEl.appendChild(param5bEl);
	objEl.appendChild(param6El);
	objEl.appendChild(param7El);
	objEl.appendChild(embedEl);
}
