﻿// src   : source url
// fid   : flash id
// width : source width
// height: source height
// mode  : wmode ("" for none, transparent, opaque ...)
function flash(src,fid,width,height,mode){
	document.writeln("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'");
    document.writeln("codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'");
    document.writeln("width=" + width + " height=" + height + " id=" + fid + ">");
    document.writeln("<param name=wmode value=" + mode + " />");
    document.writeln("<param name=movie value=" + src + " />");
    document.writeln("<param name=quality value=high />");
    document.writeln("<embed src='" + src + "' quality='high' wmode='" + mode + "' ");
    document.writeln("type='application/x-shockwave-flash' ");
    document.writeln("pluginspage='http://www.macromedia.com/shockwave/download/index.cgi");
    document.writeln("?p1_prod_version=shockwaveflash' width=" + width + " height=" + height + ">");
    document.writeln("</embed>");
    document.writeln("</object>");
//  document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width=" + width + " height=" + height + " id=" + fid + "><param name=wmode value=" + mode + " /><param name=movie value=" + src + " /><param name=quality value=high /><embed src=" + src + " quality=high wmode=" + mode + " type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" width=" + width + " height=" + height + "></embed></object>");
}

// write document contents
function print(src){
  //document.write(src);
}

function GetFlashTagSource(source, width, height) {
	var idx = location.href.toLowerCase().indexOf("https://");
	var httpType = (idx >= 0 ? "https://" : "http://");

	return '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=httpType + "download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + width + '" height="' + height + '">      <param name="movie" value="' + source + '"><param name="quality" value="high"><param name="wmode" value="transparent"><embed wmode="transparent"  src="' + source + '" quality="high" pluginspage=httpType + "www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed></object>';
}

function IE_Flash_Change(source, width, height) {
    document.write(GetFlashTagSource(source, width, height));
}

function render_flash(url, width, height) {

    if (navigator.appName.indexOf("Microsoft") > -1) {
        /*document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + width + '" height="' + height + '" VIEWASTEXT>');*/
        document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width=100% height="' + height + '" VIEWASTEXT>');
        document.write('<param name="allowScriptAccess" value="sameDomain" />');
        document.write('<param name="movie" value="' + url + '">');
        document.write('<param name="quality" value="best">');
        document.write('<param name="wmode" value="transparent">');
        document.write('<param name="menu" value="false" />');
        document.write('<param name="scale" value="noscale" />');
        document.write('<embed src="' + url + '" allowScriptAccess="sameDomain" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '" wmode="transparent"></embed>');
        document.write('</object>');

    } else {  // 익스플로러가 아닐 경우 
        /*document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + width + '" height="' + height + '" VIEWASTEXT>');*/
        document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width=100%  height="' + height + '" VIEWASTEXT>');
        document.write('<param name="allowScriptAccess" value="sameDomain" />');
        document.write('<param name="movie" value="' + url + '">');
        document.write('<param name="quality" value="best">');
        document.write('<param name="wmode" value="transparent">');
        document.write('<param name="menu" value="false" />');
        document.write('<param name="scale" value="noscale" />');
        document.write('<embed src="' + url + '" allowScriptAccess="sameDomain" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width=100%  height="' + height + '" wmode="transparent"></embed>');
        document.write('</object>');

    }


}

