// ################## Script For Flash & ActiveX #########################

// +++++++++++++  MakeFlashString(f_file, width, height) +++++++++++++++++
// 
// f_file : flash filename
// width : source width
// height : source height
// 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

function MakeFlashString(f_file, width, height) {
	if (navigator.appName.charAt(0) == 'M') {			// IE
		return "<object classid=\"CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000\" id=\"flashplayer\" name=\"flashplayer\" codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width="+width+" height="+height+"><param name='movie' value='"+f_file+"'><param name='quality' value='high'><param name='loop' value='true'><param name='wmode' value='transparent'></object>";
	} else {	
		return "<embed type='application/x-shockwave-flash' src='"+f_file+"' width="+width+" height="+height+"></embed>"; 
	}
}

function MakeFlashString_white(f_file, width, height)
{
	return "<object classid=\"CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000\" id=\"flashplayer\" name=\"flashplayer\" codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width="+width+" height="+height+"><param name='movie' value='"+f_file+"'><param name='quality' value='high'><param name='loop' value='true'></object>";
}


// +++++++++++  MakeMediaPlayerString(admin, width, height) ++++++++++++++
// 
// admin : logadmin value
// width : source width
// height : source height
// 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

function MakeMediaPlayerString(admin, width, height)
{
	if (admin=="0") {
		return "<OBJECT classid='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6' id='MediaPlayer' name='MediaPlayer' width="+width+" height="+height+">" + 
				"<param name='autoStart' value='true'>" +
				"<param name='uiMode' value='full'>" +
				"<param name='animationAtStart' value='false'>" +
				"<param name='transparentAtStart' value='true'>" +
				"<param name='stretchToFit' value='true'>" +
				"<param name='showStatusBar' value='true'>" +
				"<param name='showTracker' value='true'>" +
				"<param name='showDisplay' value='false'>" +
				"<param name='EnableContextMenu' value='true'>" +
			   "</OBJECT>";
	} else {
		return "<OBJECT classid='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6' id='MediaPlayer' name='MediaPlayer' width="+width+" height="+height+">" +
				"<param name='autoStart' value='true'>" +
				"<param name='uiMode' value='full'>" +
				"<param name='animationAtStart' value='false'>" +
				"<param name='transparentAtStart' value='true'>" +
				"<param name='stretchToFit' value='true'>" +
				"<param name='showStatusBar' value='true'>" +
				"<param name='showTracker' value='true'>" +
				"<param name='showDisplay' value='false'>" +
				"<param name='EnableContextMenu' value='false'>" +
			   "</OBJECT>";
	}
}


// +++++++++++++  InnerMovieWrite(parm_id, width, height) +++++++++++++++++
// 
// parm_id : object clsid
// width : source width
// height : source height
// 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

function InnerMovieWrite(parm_id, width, height)
{
	var mediaStr= "<OBJECT ID='"+parm_id+"' classID='clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6' width='"+width+"' height='"+height+"'>" +
					"<param name='enableContextMenu' value='false'/>" +
					"<param name='stretchToFit'		value='true' />" +
					"<param name='uimode'			value='none' />" +
					"<param name='ShowControls'		value='false' />" +
					"<param name='Autorewind'		value='true' />" +
					"<param name='AutoStart'		value='false' /></OBJECT>";
	DocumentWrite(mediaStr);
}


// +++++++++++++  DioDeoPlayerWrite(admin, pid, width, height, src, adv) +++++++++++++++++
// 
// admin : logadmin value
// pid : player id
// width : player width
// height : height height
// src : mms filename
// adv : advertiser source filename
//
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

function DioDeoPlayerWrite(admin, pid, width, height, src, adv)
{
	err_msg = "ÀÌ¹Ì »èÁ¦µÈ ¿µ»óÀÌ°Å³ª ÀÏ½ÃÀûÀÎ ¼­¹ö ¹®Á¦·Î ÀÎÇØ µ¿¿µ»óÀ» ·ÎµåÇÏÁö ¸øÇÏ¿´½À´Ï´Ù.  \n\n¿µ»ó ¾Æ·¡ Reload ¹öÆ°À» Å¬¸¯ÇÏ¿© »õ·Î ·ÎµùÀ» ÇØ º¸½Ã±â ¹Ù¶ø´Ï´Ù. \n\n¸¸¾à, ¿¡·¯°¡ Áö¼ÓµÉ °æ¿ì webmaster@diodeo.com À¸·Î ¹®ÀÇÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.";
	if (admin=="0") {
		var playerStr= "<OBJECT classid='CLSID:a79a1664-9145-4b61-a34b-0139959ee714' codebase='http://www.diodeo.com/DioDeoPlayer.cab#version=1,0,0,9' width="+width+" height="+height+" id='"+pid+"'>" +
						"<param name='SRC' value='"+src+"'/>"+
						"<param name='ADVER' value='"+adv+"'/>" +
						"<param name='ERRMSG' value='"+err_msg+"' />" +
					  "</OBJECT>";
	} else {
		var playerStr= "<OBJECT ID='MagicLockOCX' classid='CLSID:9B75502C-BBED-4BBD-8FE2-822E5E0AD32C' width='0' height='0' codebase='http://www.diodeo.com/DioDeoPlayer.cab#Version=1,0,2,9'></OBJECT>" +
					  "<OBJECT classid='CLSID:a79a1664-9145-4b61-a34b-0139959ee714' codebase='http://www.diodeo.com/DioDeoPlayer.cab#version=1,0,0,9' width="+width+" height="+height+" id='"+pid+"'>" +
						"<param name='SRC' value='"+src+"'/>"+
						"<param name='ADVER' value='"+adv+"'/>" +
						"<param name='ERRMSG' value='"+err_msg+"' />" +
					  "</OBJECT>";
	}

	DocumentWrite(playerStr);
}


// ++++++++++++++++++++++  DocumentWrite(src) ++++++++++++++++++++++++++++
// 
// Direct Write Page
// 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

function DocumentWrite(src)
{
	document.write(src);
}

