﻿//* Programming By Park Bong Il (bipark@hotmail.com) *//
function OpenEmbWindow(url, w, h)
{
	window.open(url, 'OpenEmbWindow', 'toobar=0,scrollbars=0,menubar=0,resizable=0,width=' + w + ',height=' + h)
}

function writeScript(script)
{
    document.write(script);
}


//플래시 보기
/*
function objFlash(src, width, height)
{
	objFlash(src, width, height, "#FFFFFF");
}

function objFlash(src, width, height, bgColor)
{
    //<param name=\"scale\" value=\"noscale\" />
	document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\""+width+"\" height=\""+height+"\" VIEWASTEXT><param name=\"movie\" value=\""+src+"\" /><param name=\"quality\" value=\"high\" /><param name=\"menu\" value=\"false\" /><param name=\"bgcolor\" value=\""+bgColor+"\" /><param name=\"wmode\" value=\"transparent\" /><embed src=\""+src+"\" width=\""+width+"\" height=\""+height+"\" align=\"middle\" quality=\"high\" bgcolor=\""+bgColor+"\" wmode=\"transparent\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object>");		
}
*/

function objOpaqueFlash(src, width, height, bgColor)
{
    var strFlashTag = "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\""+width+"\" height=\""+height+"\" VIEWASTEXT><param name=\"movie\" value=\""+src+"\" /><param name=\"quality\" value=\"high\" /><param name=\"menu\" value=\"false\" />";
    
    if( bgColor != null)
        strFlashTag += "<param name=\"bgcolor\" value=\""+bgColor+"\" />";
    
    //strFlashTag += "<param name=\"wmode\" value=\"opaque\" />";
    strFlashTag += "<param name=\"wmode\" value=\"transparent\" />";
    strFlashTag += "<embed src=\""+src+"\" width=\""+width+"\" height=\""+height+"\" align=\"middle\" quality=\"high\" bgcolor=\""+bgColor+"\" wmode=\"opaque\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object>"
	document.write(strFlashTag);		
	//document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\""+width+"\" height=\""+height+"\" VIEWASTEXT><param name=\"movie\" value=\""+src+"\" /><param name=\"quality\" value=\"high\" /><param name=\"menu\" value=\"false\" /><param name=\"bgcolor\" value=\""+bgColor+"\" /><param name=\"wmode\" value=\"opaque\" /><embed src=\""+src+"\" width=\""+width+"\" height=\""+height+"\" align=\"middle\" quality=\"high\" bgcolor=\""+bgColor+"\" wmode=\"opaque\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object>");		
}

function objFlash(src, width, height, bgcolor, id, flashvars, wmode )
{
	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="' + src + '"/>';

		if(flashvars != null) {strFlashTag += '<param name="flashvars" value="' + flashvars + '"/>'};
		if(wmode != null) { strFlashTag += '<param name="wmode" VALUE="' + wmode + '"/>'; }
	    if(bgcolor != null ) { strFlashTag += '<param name="bgcolor" value="' + bgcolor + '"/>'; }
	    
		strFlashTag += '<param name="quality" value="best"/>';	
		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="' + src + '" ';
		strFlashTag += 'quality="best" ';
		if(bgcolor != null ) { 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);
}

//동영상 보기
function objMovie(src, width, height)
{
	objMovie(src, width, height, "", "true", "true", "false", "true", "1")
}

function objMovie(src, width, height, style)
{
	objMovie(src, width, height, style, "true", "true", "false", "true", "1")
}

function objMovie(src, width, height, style, showControls, showStatusBar, showDisply, autoStart, playCount)
{
	document.write("<object classid=\"clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95\" codebase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=6,4,5,715\" standby=\"loading microsoft windows media player components...\" type=\"application/x-oleobject\" width=\""+width+"\" height=\""+height+"\" style=\""+style+"\"><param name=\"filename\" value=\""+src+"\" /><param name=\"showcontrols\" value=\""+showControls+"\" /><param name=\"showstatusbar\" value=\""+showStatusBar+"\" /><param name=\"showdisplay\" value=\""+showDisply+"\" /><param name=\"autostart\" value=\""+autoStart+"\" /><param name=\"playcount\" value=\""+playCount+"\" /><param name=\"enablecontextmenu\" value=\"true\" /><param name=\"transparentatstart\" value=\"true\" /><param name=\"animationatstart\" value=\"true\" /><param name=\"volume\" value=\"-600\" /></object>");
}

function objMovie(src, width, height, style, showControls, showStatusBar, showDisply, autoStart, playCount, loop)
{
    var tag = "<object classid=\"clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95\" codebase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=6,4,5,715\" standby=\"loading microsoft windows media player components...\" type=\"application/x-oleobject\" width=\""+width+"\" height=\""+height+"\" style=\""+style+"\" loop=\"" + loop + "\">";
    tag += "<param name=\"filename\" value=\""+src+"\" />";
    tag += "<param name=\"showcontrols\" value=\""+showControls+"\" />";
    tag += "<param name=\"showstatusbar\" value=\""+showStatusBar+"\" />";
    tag += "<param name=\"showdisplay\" value=\""+showDisply+"\" />";
    tag += "<param name=\"autostart\" value=\""+autoStart+"\" />";
    tag += "<param name=\"playcount\" value=\""+playCount+"\" />";
    tag += "<param name=\"enablecontextmenu\" value=\"true\" />";
    tag += "<param name=\"transparentatstart\" value=\"true\" />";
    tag += "<param name=\"animationatstart\" value=\"true\" />";
    tag += "<param name=\"volume\" value=\"-600\" />";
    tag += "</object>";
    
    document.write(tag);
	//document.write("<object classid=\"clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95\" codebase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=6,4,5,715\" standby=\"loading microsoft windows media player components...\" type=\"application/x-oleobject\" width=\""+width+"\" height=\""+height+"\" style=\""+style+"\"><param name=\"filename\" value=\""+src+"\" /><param name=\"showcontrols\" value=\""+showControls+"\" /><param name=\"showstatusbar\" value=\""+showStatusBar+"\" /><param name=\"showdisplay\" value=\""+showDisply+"\" /><param name=\"autostart\" value=\""+autoStart+"\" /><param name=\"playcount\" value=\""+playCount+"\" /><param name=\"enablecontextmenu\" value=\"true\" /><param name=\"transparentatstart\" value=\"true\" /><param name=\"animationatstart\" value=\"true\" /><param name=\"volume\" value=\"-600\" /></object>");
}


function objMovieAutoSize(src)
{
	objMovieAutoSize(src, "", "true", "true", "false", "true", "1")
}

function objMovieAutoSize(src, style)
{
	objMovieAutoSize(src, style, "true", "true", "false", "true", "1")
}

function objMovieAutoSize(src, style, showControls, showStatusBar, showDisply, autoStart, playCount)
{
	document.write("<object classid=\"clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95\" codebase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=6,4,5,715\" standby=\"loading microsoft windows media player components...\" type=\"application/x-oleobject\" style=\""+style+"\"><param name=\"filename\" value=\""+src+"\" /><param name=\"showcontrols\" value=\""+showControls+"\" /><param name=\"showstatusbar\" value=\""+showStatusBar+"\" /><param name=\"showdisplay\" value=\""+showDisply+"\" /><param name=\"autostart\" value=\""+autoStart+"\" /><param name=\"playcount\" value=\""+playCount+"\" /><param name=\"autosize\" value=\"true\" /><param name=\"enablecontextmenu\" value=\"true\" /><param name=\"transparentatstart\" value=\"true\" /><param name=\"animationatstart\" value=\"true\" /><param name=\"volume\" value=\"-600\" /></object>");
}

// MP3 듣기
function objMp3(src, isHidden)
{
    objMp3(src, isHidden, true, false);
}

function objMp3(src, isHidden, isAutoStart, isRepeat)
{
    document.write("<EMBED invokeURLs=false SRC='" + src + "' HIDDEN=" + isHidden + " AUTOSTART=" + isAutoStart + " LOOP=" + isRepeat + ">");
}