// ¹æ¼Û¿¡¼­ »ç¿ëµÇ´Â AOD, VOD Àç»ý±â
function Pay_End(szChk,no,id)
{
	if (szChk == "true")
	{
		open_viplayer(no,id);
	}
	else
	{
		alert('°áÁ¦ÀÛ¾÷ÀÌ Ãë¼Ò µÇ¾ú½À´Ï´Ù.');
	}
}


function pay_open(price,goodno,id) 
{
	var url;
	url = "/2002_mem/popup_settle/regist.asp?price="+price+"&goodno="+goodno+"&id="+id+"&r_url=tv_vod";
	winobject =window.open(url,"new","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,menubar=no,alwaysRaised=yes,width=640,height=440")
	winobject.opener.name="opener";
}

function open_free_vod(file_name)
{
	window.open("/etomatotv/vi_player_new_free.asp?file_name=" + file_name, "vi_player", "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,width=728,height=560");			
	//window.open("http://www.etomato.com/etomatotv/vi_player_new_free.asp?file_name=" + file_name, "vi_player", "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,width=728,height=560");			
}

function open_freeNews_vod(no)
{
	window.open("http://www.newstomato.co.kr/News/popup_news_vod.asp?no=" + no, "vi_player", "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,width=728,height=560");			
	//window.open("http://www.etomato.com/EtomatoNews/vi_player_new_free1.asp?file_name=" + file_name, "vi_player", "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,width=728,height=560");			
}

// ºñÈ¸¿ø °áÁ¦½Ã ¿ÀÇÂÇÏ´Â ÇÔ¼ö
function pay_biopen(price,goodno) 
{
var url;

	url = "http://www.etomato.com/2002_mem/popup_bi/Check_Jumin.asp?price="+price+"&goodno="+goodno+"&r_url=tv_vod";
	window.open(url,"bi_new","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,menubar=no,alwaysRaised=yes,width=640,height=440")
	//winobject.opener.name="bi_new";

}


// (ºñÈ¸¿ø°áÁ¦½Ã) ¹æ¼Û¿¡¼­ »ç¿ëµÇ´Â AOD, VOD Àç»ý±â
function Pay_biEnd(szChk,no)
{
	if (szChk == "true")
	{
		open_viplayer(no,'');
	}
	else
	{
		alert('°áÁ¦ÀÛ¾÷ÀÌ Ãë¼Ò µÇ¾ú½À´Ï´Ù.');
	}
}


// ºñÈ¸¿ø °áÁ¦¸¦ Ã³¸®ÇÒ¶§ ·Î±×ÀÎ ºÎºÐÀÔ´Ï´Ù.
function login_pass(szId,szPwd)
{
	document.add_val2.log_id.value = szId;
	document.add_val2.log_pwd.value = szPwd;
	document.add_val2.val2.value = document.add_val.val2.value;
	document.add_val2.val3.value =document.add_val.val3.value;
	document.add_val2.val4.value = document.add_val.val2.value;
	document.add_val2.val5.value = document.add_val.val3.value;
	document.add_val2.submit();
}

/************************************************************************/
/*		À¯·á±ÇÇÑ ¾øÀ¸¸é, stop ½ÃÅ°´Â ºÎºÐ; ´Ù¸¥ °÷Àº ¼öÁ¤ÇÏÁö ¾Ê¾ÒÀ½	*/ 
/************************************************************************/

function mute()
{
	if ((navigator.userAgent.indexOf('IE') > -1) && (navigator.platform == "Win32")) 
	{
		MediaPlayer2.mute = true;
	}
	else
	{
		document.MediaPlayer2.mute = true;
	}    
}

function LoginTimeChk() {
	alert(1);
	display();
}

function TransTimeToNum( var_time )	{
	return var_time.getFullYear() * 100000000 + (var_time.getMonth() + 1) * 1000000  + var_time.getDate() * 10000 + var_time.getHours() * 100 + var_time.getMinutes()
}


//½Ã°£Áö³ª¸é ½ºÅé½ÃÅ²´Ù.
function display() {
	setTimeout("stopIt();", 60000);
}

function stopIt()	{
	if ((navigator.userAgent.indexOf('IE') > -1) && (navigator.platform == "Win32")) 
	{
		MediaPlayer2.Stop();
	}
	else
	{
		document.MediaPlayer2.Stop();
	}
	
}

function main_player_display() {
	setTimeout("timer()", 3000);
	setTimeout("main_player_run('mainplayer')", 3000);
}


function timer() {
	if(start >= 0){
		document.getElementById("player_sec1").innerHTML = "<b>¹Ì¸®º¸±â È­¸é</b>: <span style='font-family:µ¸¿ò;font-size:8pt;letterspacing:0px;color:red;font-weight:bold;'>" + start + "</span>ÃÊ ³²¾Ò½À´Ï´Ù. <a href='javascript:main_player_control();' style='color:green;'>[ÁßÁö]</a>";
		setTimeout('timer()', 1000);
	}
	start--;
	if(start == -1) {
		main_player_control();
	}
}

function main_player_control() {
	stopIt();
	main_ontomato_player_on.style.display = 'none';
	main_ontomato_player_off.style.display = '';
}

function main_player_run(txtid) {
	document.getElementById("location_mainplayer").innerHTML=document.getElementById(txtid).value;
}
