function viewVOD(dataCode, gotopage, pagesize, arrmethod, arrdir, cat1, cat2, method, keyword)
{
	window.open('/04_media/vod_hit.asp?dataCode=' + dataCode + '&GotoPage=' + gotopage + '&Pagesize=' + pagesize + '&ArrayMethod=' + arrmethod + '&ArrayDir=' + arrdir + '&C1=' + cat1 + '&C2=' + cat2 + '&MT=' + method + '&KW=' + keyword, 'VOD_PLAYER', 'width=682, height=748, scrollbars=1');	//w=678
}

function sel_type(){
	var tForm = window.document.regForm;

	if (tForm.s_type[0].checked){
		id_file.style.display = 'block';
		id_url.style.display = 'none';
		}
	else{
		id_file.style.display = 'none';
		id_url.style.display = 'block';
		}
	}

//Ã¼Å© Ä«Å×°í¸® Á¾·ù
function checkCategoryKind(formName)
{
	if(formName.category_top[0].checked)
	{
		for(var i = 0; i < formName.category0.length; i++)
		{
			formName.category0[i].disabled = false;
		}
		for(var i = 0; i < formName.category1.length; i++)
		{
			formName.category1[i].disabled = false;
		}
		for(var i = 0; i < formName.category2.length; i++)
		{
			formName.category2[i].disabled = false;
		}
		for(var i = 0; i < formName.category3.length; i++)
		{
			formName.category3[i].disabled = true;
		}
	}
	else
	{
		for(var i = 0; i < formName.category0.length; i++)
		{
			formName.category0[i].disabled = true;
		}
		for(var i = 0; i < formName.category1.length; i++)
		{
			formName.category1[i].disabled = true;
		}
		for(var i = 0; i < formName.category2.length; i++)
		{
			formName.category2[i].disabled = true;
		}
		for(var i = 0; i < formName.category3.length; i++)
		{
			formName.category3[i].disabled = false;
		}
	}
}

//Ä«Å×°í¸®¼±ÅÃ¿©ºÎÃ¼Å©
function checkSelCategory(formName)
{
	var tempValue = false;

	if(formName.category_top[0].checked)
	{
		tempValue = false;

		for(var i = 0; i < formName.category0.length; i++)
		{
			if(formName.category0[i].checked)
			{
				tempValue = true;
				break;
			}
		}

		if(!tempValue) return false;

		tempValue = false;

		for(var i = 0; i < formName.category1.length; i++)
		{
			if(formName.category1[i].checked)
			{
				tempValue = true;
				break;
			}
		}

		if(!tempValue) return false;

		tempValue = false;

		for(var i = 0; i < formName.category2.length; i++)
		{
			if(formName.category2[i].checked)
			{
				tempValue = true;
				break;
			}
		}

		if(!tempValue)
			return false;
		else
			return true;
	}
	else
	{
		for(var i = 0; i < formName.category3.length; i++)
		{
			if(formName.category3[i].checked)
			{
				tempValue = true;
				break;
			}
		}

		if(!tempValue)
			return false;
		else
			return true;
	}
}

//¾²±â
function writeNow()
{
	var formName = document.regForm;
		
	//Á¦¸ñ ÀÔ·Â¿©ºÎ
	if(!isExist(formName.s_title.value))
	{
		window.alert("Á¦¸ñÀ» ½áÁÖ½Ê½Ã¿À.");
		formName.s_title.focus();
		return;
	}

	if(!checkSelCategory(formName))
	{
		window.alert("Ä«Å×°í¸®¸¦ ¼±ÅÃÇØÁÖ½Ê½Ã¿À.");
		return;
	}
	/*var isSelect = false;

	for(var i = 0; i < formName.category2.length; i++)
	{
		if(formName.category2[i].checked)
		{
			isSelect = true;
			break;
		}
	}

	if(!isSelect)
	{
		window.alert("³­ÀÌµµ Ä«Å×°í¸®¸¦ ¼±ÅÃÇØÁÖ½Ê½Ã¿À.");
		return;
	}

	isSelect = false;

	for(var i = 0; i < formName.category3.length; i++)
	{
		if(formName.category3[i].checked)
		{
			isSelect = true;
			break;
		}
	}

	if(!isSelect)
	{
		window.alert("±â¼ú/°æ±â Ä«Å×°í¸®¸¦ ¼±ÅÃÇØÁÖ½Ê½Ã¿À.");
		return;
	}*/
	//Á¦¸ñ ±ÛÀÚ¼ö
	if(GetByteLen(formName.s_title.value) > 100)
	{
		window.alert("Á¦¸ñÀº 100Byte¸¦ ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
		formName.s_title.focus();
		return;
	}

	if(formName.s_type[0].checked){
		if(!isExist(formName.s_file.value)){
			window.alert("µ¿¿µ»ó ÆÄÀÏÀ» ¼±ÅÃÇØ ÁÖ½Ê½Ã¿À.");
			formName.s_file.focus();
			return;
		}

		if (!extCheck('regForm', 's_file', 'wmv:asf:avi:mpg:mpeg')){
			return;
		}
	}
	else{
		if(!isExist(formName.s_url.value)){
			window.alert("µ¿¿µ»ó URLÀ» ¼±ÅÃÇØ ÁÖ½Ê½Ã¿À.");
			formName.s_url.focus();
			return;
		}

		if(GetByteLen(formName.s_url.value) > 260){
			window.alert("µ¿¿µ»ó URLÀº 260Bytes¸¦ ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
			formName.s_url.focus();
			return;
		}

		if (!extCheck('regForm', 's_url', 'wmv:wma:asf:asx:avi:mpg:mpeg')){
			return;
		}
	}

	//»ó¼¼¼³¸íÀÔ·Â¿©ºÎ
	if(!isExist(formName.s_desc.value)){
		window.alert("³»¿ëÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		formName.s_desc.focus();
		return;
	}

	if(GetByteLen(formName.s_desc.value) > 500){
		window.alert("³»¿ëÀº 500Bytes¸¦ ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
		formName.s_desc.focus();
		return;
	}
			
	formName.action = "vod_up_pro.asp";
	formName.submit();
}

//¾²±â2
function writeNow_2()
{
	var formName = document.regForm;
		
	//Á¦¸ñ ÀÔ·Â¿©ºÎ
	if(!isExist(formName.s_title.value))
	{
		window.alert("Á¦¸ñÀ» ½áÁÖ½Ê½Ã¿À.");
		formName.s_title.focus();
		return;
	}

	if(!checkSelCategory(formName))
	{
		window.alert("Ä«Å×°í¸®¸¦ ¼±ÅÃÇØÁÖ½Ê½Ã¿À.");
		return;
	}

	/*var isSelect = false;

	for(var i = 0; i < formName.category1.length; i++)
	{
		if(formName.category1[i].checked)
		{
			isSelect = true;
			break;
		}
	}

	if(!isSelect)
	{
		window.alert("³­ÀÌµµ Ä«Å×°í¸®¸¦ ¼±ÅÃÇØÁÖ½Ê½Ã¿À.");
		return;
	}

	isSelect = false;

	for(var i = 0; i < formName.category2.length; i++)
	{
		if(formName.category2[i].checked)
		{
			isSelect = true;
			break;
		}
	}

	if(!isSelect)
	{
		window.alert("±â¼ú/°æ±â Ä«Å×°í¸®¸¦ ¼±ÅÃÇØÁÖ½Ê½Ã¿À.");
		return;
	}*/
	//Á¦¸ñ ±ÛÀÚ¼ö
	if(GetByteLen(formName.s_title.value) > 100)
	{
		window.alert("Á¦¸ñÀº 100Byte¸¦ ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
		formName.s_title.focus();
		return;
	}

	if(formName.s_type[0].checked){
		if(!isExist(formName.s_file.value)){
			window.alert("µ¿¿µ»ó ÆÄÀÏÀ» ¼±ÅÃÇØ ÁÖ½Ê½Ã¿À.");
			formName.s_file.focus();
			return;
		}

		if (!extCheck('regForm', 's_file', 'wmv:asf:avi:mpg:mpeg')){
			return;
		}
	}
	else{
		if(!isExist(formName.s_url.value)){
			window.alert("µ¿¿µ»ó URLÀ» ¼±ÅÃÇØ ÁÖ½Ê½Ã¿À.");
			formName.s_url.focus();
			return;
		}

		if(GetByteLen(formName.s_url.value) > 260){
			window.alert("µ¿¿µ»ó URLÀº 260Bytes¸¦ ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
			formName.s_url.focus();
			return;
		}

		if (!extCheck('regForm', 's_url', 'wmv:wma:asf:asx:avi:mpg:mpeg')){
			return;
		}
	}

	//»ó¼¼¼³¸íÀÔ·Â¿©ºÎ
	if(!isExist(formName.s_desc.value)){
		window.alert("³»¿ëÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		formName.s_desc.focus();
		return;
	}

	if(GetByteLen(formName.s_desc.value) > 500){
		window.alert("³»¿ëÀº 500Bytes¸¦ ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
		formName.s_desc.focus();
		return;
	}
			
	formName.action = "vod_up_pro_2.asp";
	formName.submit();
}

//¼öÁ¤ÇÏ±â
function modifyNow()
{
	var formName = document.regForm;

	if(!checkSelCategory(formName))
	{
		window.alert("Ä«Å×°í¸®¸¦ ¼±ÅÃÇØÁÖ½Ê½Ã¿À.");
		return;
	}
		
	//Á¦¸ñ ÀÔ·Â¿©ºÎ
	if(!isExist(formName.s_title.value))
	{
		window.alert("Á¦¸ñÀ» ½áÁÖ½Ê½Ã¿À.");
		formName.s_title.focus();
		return;
	}
	//Á¦¸ñ ±ÛÀÚ¼ö
	if(GetByteLen(formName.s_title.value) > 100)
	{
		window.alert("Á¦¸ñÀº 100Byte¸¦ ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
		formName.s_title.focus();
		return;
	}
	//»ó¼¼¼³¸íÀÔ·Â¿©ºÎ
	if(!isExist(formName.s_desc.value)){
		window.alert("³»¿ëÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		formName.s_desc.focus();
		return;
	}

	if(GetByteLen(formName.s_desc.value) > 500){
		window.alert("³»¿ëÀº 500Bytes¸¦ ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù.");
		formName.s_desc.focus();
		return;
	}
			
	formName.action = "vod_mod_pro.asp";
	formName.submit();
}

//±Û»èÁ¦ÇÏ±â
function deleteArticle(dataCode, delkind, gotopage, pagesize, arrmethod, arrdir, cat1, cat2, method, keyword)
{
	if(confirm('°æ°í!\n\n»èÁ¦µÇ¸é º¹±¸ÇÒ¼ö ¾ø½À´Ï´Ù.\n\nÁ¤¸»·Î »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?'))
	{
		location.href='vod_del_pro.asp?dataCode=' + dataCode + '&GotoPage=' + gotopage + '&Pagesize=' + pagesize + '&ArrayMethod=' + arrmethod + '&ArrayDir=' + arrdir + '&C1=' + cat1 + '&C2=' + cat2 + '&MT=' + method + '&KW=' + keyword + '&delkind=' + delkind;
	}
}

//±Û¼öÁ¤ÇÏ±â
function modifyArticle(dataCode, modkind, gotopage, pagesize, arrmethod, arrdir, cat1, cat2, method, keyword)
{
	if(confirm('°æ°í!\n\n¼öÁ¤ÇÏ½Ã°Ú½À´Ï±î?'))
	{
		//frames.boarderszoneMain.location.href='vod_mod.asp?dataCode=' + dataCode + '&GotoPage=' + gotopage + '&Pagesize=' + pagesize + '&ArrayMethod=' + arrmethod + '&ArrayDir=' + arrdir + '&C1=' + cat1 + '&C2=' + cat2 + '&MT=' + method + '&KW=' + keyword;
		window.open('vod_mod.asp?dataCode=' + dataCode + '&GotoPage=' + gotopage + '&Pagesize=' + pagesize + '&ArrayMethod=' + arrmethod + '&ArrayDir=' + arrdir + '&C1=' + cat1 + '&C2=' + cat2 + '&MT=' + method + '&KW=' + keyword + '&modkind=' + modkind, 'boarderszoneMain');
	}
}

// È®ÀåÀÚ Ã¼Å©
function extCheck(frm, clm, ext){
	var str = eval(frm + '.' + clm + '.value');
	
	if (ext.indexOf(':') > 0){
		var tmp = ext.split(':');
		
		var chknum = 0;
		for (i=0; i<tmp.length; i++){
			if (str.substr(str.lastIndexOf('.') + 1, str.length - str.lastIndexOf('.')).toLowerCase() == tmp[i]){
				chknum = 1;
				//break;
				}
			}
		if (chknum == 0){
			alert('Áö¿øµÇÁö¾Ê´Â Æ÷¸ËÀÔ´Ï´Ù.\n['+ext+']');
			return false;
			}
		}
	else{
		if (str.substr(str.lastIndexOf('.') + 1, str.length - str.lastIndexOf('.')).toLowerCase() != ext){
			alert('Áö¿øµÇÁö¾Ê´Â Æ÷¸ËÀÔ´Ï´Ù.\n['+ext+']');
			return false;
			}
		}

	return true;
	}

function ShowProgress() 
{ 
	if(document.regForm.s_type[0].checked){
	   strAppVersion = navigator.appVersion; 
	   if (document.regForm.s_file.value != "") {
		  if (strAppVersion.indexOf('MSIE')!=-1 && 
			  strAppVersion.substr(strAppVersion.indexOf('MSIE')+5,1) > 4) { 

			  winstyle = "dialogWidth=385px; dialogHeight:150px; center:yes"; 
			  window.showModelessDialog("show_progress.asp?nav=ie", null, winstyle); 
		  } 
		  else { 
			  winpos = "left=" + ((window.screen.width-380)/2)+",top=" +
				   ((window.screen.height-110)/2); 
			  winstyle = "width=380,height=110,status=no,toolbar=no,menubar=no," + 
				   "location=no,resizable=no,scrollbars=no,copyhistory=no," + winpos; 
			  window.open("show_progress.asp",null,winstyle); 
		  } 
	   }
	   return true; 
	}
}

function deleteMediaComment(dataCode, commentCode)
{
	if(confirm("¹Ù·Î »èÁ¦µË´Ï´Ù.\n\nÁ¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?"))
	{
		location.href = "vod_comment_delete.asp?dataCode=" + dataCode + "&commentCode=" + commentCode;
	}
}