//POPUP
function popupWindow(win_url,win_name,w,h,scroll,resize)
{
	var x,y;
	x 	= (screen.width) ? (screen.width-w)/2 : 0;
	y 	= (screen.height) ? (screen.height-h)/2 : 0;
	
	var settings = 'height='+h+',width='+w+',top='+y+',left='+x+',scrollbars='+scroll+',resizable='+resize+'';
	var win = window.open(win_url,win_name,settings);	
}

// ÇÃ·¡½Ã »ðÀÔ =======================================================================================================

function FlashObject(swf, width, height, bgcolor, id, flashvars)
{
    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="' + swf + '"/>';
        
        if(flashvars != null) {strFlashTag += '<param name="flashvars" value="' + flashvars + '"/>'};
        strFlashTag += '<param name="quality" value="best"/>';
        strFlashTag += '<param name="bgcolor" value="' + bgcolor + '"/>';
        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="' + swf + '" ';
        strFlashTag += 'quality="best" ';
        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 MediaObjectTag(filename,width,height,objname,autostart,showcontrols,showstatusbar,transparentatstart) {
	document.write('<object name="'+objname+'" id="'+objname+'" width="'+width+'" height="'+height+'"	classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=6,4,7,1112" standby="loading windows media player components..." type="application/x-oleobject">');
	document.write('<param name="filename" value="'+filename+'" />');						//½ºÆ®¸®¹ÖµÉ ÆÄÀÏÀÇ °æ·Î
	document.write('<param name="autostart" value="'+autostart+'" />');					//ÆäÀÌÁö°¡ ¿­¸± ¶§ ÀÚµ¿À¸·Î µ¿¿µ»óÀÌ ½ÇÇàµÉÁö¿¡ ´ëÇÑ ¿É¼Ç
	document.write('<param name="showcontrols" value="'+showcontrols+'" />');		//'Àç»ý', 'ÀÏ½ÃÁ¤Áö', 'Á¤Áö' ¿Í ÄÁÆ®·Ñ¹Ù¿¡ ´ëÇÑ »ðÀÔ. 
	document.write('<param name="showstatusbar" value="'+showstatusbar+'" />');	//¹öÆÛ¸µ ¹× ½ºÆ®¸®¹Ö ¼ö½Å¿¡ ´ëÇÑ Á¤º¸Ç¥½Ã »ðÀÔ.
	document.write('<param name="transparentatstart" value="'+transparentatstart+'" />'); //¹öÆÛ¸µ½Ã °ËÀº»öÀÇ ¹Ìµð¾î È­¸éÀÌ º¸¿©ÁúÁö ¿©ºÎ.

	document.write('<param name="ShowAudioControls" value="1">');						//º¼·ýÁ¶Àý¹Ù¿¡ ´ëÇÑ »ðÀÔ. (0:¹Ì»ðÀÔ, 1:»ðÀÔ)
	document.write('<param name="sendmouseclickevents" value="false">');
	document.write('<param name="allowchangedisplaysize" value="0">');
	document.write('<param name="enablefullscreencontrols" value="false">');
	document.write('<PARAM NAME="EnableContextMenu" VALUE="false">');
	document.write('<param name="sendmousemoveevents" value="false">');
	document.write('<param name="sendmouseclickevents" value="false">');
	document.write('<param name="sendkeyboardevents" value="false">');
	document.write('<param name="clicktoplay" value="false">');
	document.write('<param name="showpositioncontrols" value="0">');		//ÄÁÆ®·Ñ¹ÙÀÇ ¼¼ºÎ±â´É ¹öÆ° »ðÀÔ.
	document.write('<param name="autosize" value="0">');
	document.write('<param name="autoresize" value="0">');
	document.write('<param name="animationatstart" value="1">');  //À©µµ¿ì ¹Ìµð¾î ·Î°í¸¦ º¸¿©ÁÙÁö¿¡ ´ëÇÑ ¿É¼Ç. ¹Ø¿¡ ±×¸² 1¹øºÎºÐ
	
	document.write('<EMBED TYPE="application/x-mplayer2" SRC="mms://147.6.114.76:8080/upload/ktsaga/ktsaga_01_track.wma" NAME="'+objname+'" WIDTH="'+width+'" HEIGHT="'+height+'" />');
	document.write('</object>')

}

function playIt(objName)	{
	var obj = eval(objName);
	if ((navigator.userAgent.indexOf('IE') > -1) && (navigator.platform == "Win32"))	{	obj.Play();	}
	else	{	document.obj.Play();	}
}

function pauseIt(objName)	{	
	var obj = eval(objName);
	if ((navigator.userAgent.indexOf('IE') > -1) && (navigator.platform == "Win32"))	{	
		if (obj.PlayState == 2)	{	obj.Pause();	}
	}	else	{	
		if (document.obj.GetPlayState() == 2)	{	document.obj.Pause();	}
	}
}

function stopIt(objName)	{
	var obj = eval(objName);
	if ((navigator.userAgent.indexOf('IE') > -1) && (navigator.platform == "Win32"))	{	obj.Stop();	}
	else	{	document.obj.Stop();		}
}

function getVOD(objName,f1,f2) {
	var obj = eval(objName);
	if( strlen(f1) != 0) {
		obj.filename = f1;
		if(strlen(f2))obj.src = f2;
		else obj.src = f1;
	}
}

function volChange(UpDown, objName)	{
	var obj = eval(objName);
	if ((navigator.userAgent.indexOf("IE") > -1) && (navigator.platform == "Win32"))	{	var curVol = obj.Volume;	}
	else	{	var curVol = document.obj.GetVolume();		}

	if (UpDown == "up")	{
		curVol = -(Math.abs(curVol) - 200);
		if (curVol > -1)	{	curVol = -1;	}
	}
	else if (UpDown == "down")	{	
		curVol = -(Math.abs(curVol) + 200);
		if (curVol < -10000)	{	curVol = -10000;	}
	}
	else	{	
		if ( vol == -10000 ){  vol = curVol; curVol = -10000; }
		else {  curVol = vol; vol = -10000; }
	}

	curVol = Math.floor(curVol);
	if ((navigator.userAgent.indexOf("IE") > -1) && (navigator.platform == "Win32"))	{	obj.Volume = curVol;	}
	else	{	document.obj.SetVolume(curVol);	}
}

// ÀÌ¹ÌÁö ·Ñ¿À¹ö =======================================================================================================

function CHIMG(obj){
   var str = obj.src;               
   if(str.indexOf('_on.gif') < 0){         
    ss = str.substr(0, str.indexOf('.gif'))      
    obj.src = ss + "_on.gif";                         
   }else{                                      
    ss = str.substr(0, str.indexOf('_on.gif'))
    obj.src = ss + ".gif";
   }
  }


// ³×ºñ°ÔÀÌ¼Ç =======================================================================================================

// Home
function Home(){
	window.location.href = 'http://www.dmbdrive.com';
}
