//±â»çµî·ÏÆûÃ¼Å©
function checkNewsRegistForm()
{
	var formName = document.NewRegistForm;

	if(!checkBlank(formName.News_Title.value))
	{
		window.alert("Á¦¸ñÀ» ÀÔ·ÂÇØÁÖ½Ê½Ã¿À.");
		formName.News_Title.focus();
		return;
	}
	if(GetByteLen(formName.News_Title.value) > 200)
	{
		window.alert("Á¦¸ñÀº 200Byte±îÁö¸¸ Çã¿ëÇÕ´Ï´Ù.");
		formName.News_Title.focus();
		return;
	}
	if(formName.News_Category.value == "")
	{
		window.alert("ºÐ·ù¸¦ ¼±ÅÃÇØÁÖ½Ê½Ã¿À.");
		formName.News_Category.focus();
		return;
	}
	if(GetByteLen(formName.News_Subtitle.value) > 400)
	{
		window.alert("Á¦¸ñÀº 400Byte±îÁö¸¸ Çã¿ëÇÕ´Ï´Ù.");
		formName.News_Subtitle.focus();
		return;
	}

	if (formName.News_Category.value == "7")
	{
		if (formName.News_Banner.value != "" && formName.News_Image.value == "")
		{
			window.alert("¹è³Ê¾÷·Îµå½Ã ÀÌ¹ÌÁö°¡ ¿ì¼±ÀûÀ¸·Î ¾÷·Îµå µÇ¾î¾ß ÇÕ´Ï´Ù.");
			return;
		}
	}

	formName.jw.ImgFileReadUrl = formName.ImgFileReadUrl.value;

	if(formName.jw.HttpSendImg("/common/uploadFile.asp?objKind=News") < 0)
	{
		alert(formName.jw.GetHTTPErrText());
		return false;
	}
		
	formName.jw.MFFileReadUrl = formName.MFFileReadUrl.value;
		
	if(formName.jw.HttpSendMediaFlash("/common/uploadFile.asp?objKind=News") < 0)
	{
		alert(formName.jw.GetHTTPErrText());
		return false;
	}
		
	if(!formName.jw.IsInput)
	{
		window.alert("»óÇ°»ó¼¼Á¤º¸¸¦ ÀÔ·ÂÇØÁÖ½Ê½Ã¿À.");
		return;
	}

	formName.News_Content.value = formName.jw.BodyHtml;

	formName.action = "News_Regist.asp";
	formName.submit();
}
//±â»ç¸®ÇÃÆûÃ¼Å©
function writeNewsComment()
{
	var formName = document.CommentWriteForm;

	if(!checkBlank(formName.Comment.value))
	{
		window.alert("´äº¯ ³»¿ëÀ» ½áÁÖ½Ê½Ã¿À.");
		formName.Comment.focus();
		return;
	}

	formName.action = "News_Comment_Write.asp";
	formName.submit();
}
//±â»ç¼öÁ¤ÆûÃ¼Å©
function checkNewsModifyForm()
{
	var formName = document.NewsModifyForm;

	if(!checkBlank(formName.News_Title.value))
	{
		window.alert("Á¦¸ñÀ» ÀÔ·ÂÇØÁÖ½Ê½Ã¿À.");
		formName.News_Title.focus();
		return;
	}
	if(GetByteLen(formName.News_Title.value) > 200)
	{
		window.alert("Á¦¸ñÀº 200Byte±îÁö¸¸ Çã¿ëÇÕ´Ï´Ù.");
		formName.News_Title.focus();
		return;
	}
	if(formName.News_Category.value == "")
	{
		window.alert("ºÐ·ù¸¦ ¼±ÅÃÇØÁÖ½Ê½Ã¿À.");
		formName.News_Category.focus();
		return;
	}
	if(GetByteLen(formName.News_Subtitle.value) > 400)
	{
		window.alert("Á¦¸ñÀº 400Byte±îÁö¸¸ Çã¿ëÇÕ´Ï´Ù.");
		formName.News_Subtitle.focus();
		return;
	}


	formName.jw.ImgFileReadUrl = formName.ImgFileReadUrl.value;

	if(formName.jw.HttpSendImg("/common/uploadFile.asp?objKind=News") < 0)
	{
		alert(formName.jw.GetHTTPErrText());
		return false;
	}
		
	formName.jw.MFFileReadUrl = formName.MFFileReadUrl.value;
		
	if(formName.jw.HttpSendMediaFlash("/common/uploadFile.asp?objKind=News") < 0)
	{
		alert(formName.jw.GetHTTPErrText());
		return false;
	}
		
	if(!formName.jw.IsInput)
	{
		window.alert("»óÇ°»ó¼¼Á¤º¸¸¦ ÀÔ·ÂÇØÁÖ½Ê½Ã¿À.");
		return;
	}

	formName.News_Content.value = formName.jw.BodyHtml;

	formName.action = "News_Modify.asp";
	formName.submit();
}
//±â»ç»èÁ¦
function deleteNews(NewsID, Parameter)
{
	if(confirm("°æ°í!\n\n»èÁ¦ÇÏ½Ã¸é º¹±¸°¡ ºÒ°¡´ÉÇÕ´Ï´Ù.\n\n»èÁ¦ÇÏ½Ã°Ú½À´Ï±î?"))
	{
		location.href="News_Delete.asp?NewsID=" + NewsID + "&Parameter=" + Parameter;
	}
}

//´º½º ÄÚ¸àÆ® ´çÃ·ÀÚ ¼±Á¤
function ncCommentGiftSelect(MEM_NICK, NC_CODE, PARAMETER)
{
	if(confirm("[" + MEM_NICK + "]´ÔÀ» ´çÃ·ÀÚ·Î ¼±Á¤ÇÏ½Ã°Ú½À´Ï±î?"))
	{
		location.href = "News_comment_select.asp?NC_CODE=" + NC_CODE + "&PARAMETER=" + PARAMETER;
	}
}
//´º½º ÄÚ¸àÆ® ´çÃ·ÀÚ ¼±Á¤Ãë¼Ò
function ncCommentGiftSelectCancel(NC_CODE, PARAMETER)
{
	if(confirm("´çÃ·À» Ãë¼ÒÇÏ½Ã°Ú½À´Ï±î?"))
	{
		location.href = "News_comment_select_cancel.asp?NC_CODE=" + NC_CODE + "&PARAMETER=" + PARAMETER;
	}
}

function checkLinkNewsRegistForm()
{
	var formName = document.NewRegistForm;

	if(!checkBlank(formName.News_Title.value))
	{
		window.alert("Á¦¸ñÀ» ÀÔ·ÂÇØÁÖ½Ê½Ã¿À.");
		formName.News_Title.focus();
		return;
	}
	if(GetByteLen(formName.News_Title.value) > 100)
	{
		window.alert("Á¦¸ñÀº 100Byte±îÁö¸¸ Çã¿ëÇÕ´Ï´Ù.");
		formName.News_Title.focus();
		return;
	}

	if(!checkBlank(formName.News_URL.value))
	{
		window.alert("Á¦¸ñÀ» ÀÔ·ÂÇØÁÖ½Ê½Ã¿À.");
		formName.News_URL.focus();
		return;
	}
	if(GetByteLen(formName.News_URL.value) > 300)
	{
		window.alert("Á¦¸ñÀº 300Byte±îÁö¸¸ Çã¿ëÇÕ´Ï´Ù.");
		formName.News_URL.focus();
		return;
	}
	
	formName.action = "LinkNews_Regist_pro.asp";
	formName.submit();
}

function checkLinkNewsModifyForm()
{
	var formName = document.NewRegistForm;

	if(!checkBlank(formName.News_Title.value))
	{
		window.alert("Á¦¸ñÀ» ÀÔ·ÂÇØÁÖ½Ê½Ã¿À.");
		formName.News_Title.focus();
		return;
	}
	if(GetByteLen(formName.News_Title.value) > 100)
	{
		window.alert("Á¦¸ñÀº 100Byte±îÁö¸¸ Çã¿ëÇÕ´Ï´Ù.");
		formName.News_Title.focus();
		return;
	}

	if(!checkBlank(formName.News_URL.value))
	{
		window.alert("Á¦¸ñÀ» ÀÔ·ÂÇØÁÖ½Ê½Ã¿À.");
		formName.News_URL.focus();
		return;
	}
	if(GetByteLen(formName.News_URL.value) > 300)
	{
		window.alert("Á¦¸ñÀº 300Byte±îÁö¸¸ Çã¿ëÇÕ´Ï´Ù.");
		formName.News_URL.focus();
		return;
	}
	
	formName.action = "LinkNews_Modify_pro.asp";
	formName.submit();
}

function LinkNewsEdit(idx, param)
{
	location.href = "LinkNews_Modify_Form.asp?LID=" + idx + "&" + param;
}

function LinkNewsDel(idx, param)
{
	var chk = confirm("Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?");

	if (chk)
	{
		location.href = "LinkNews_Delete_Pro.asp?LID=" + idx + "&" + param;
	}
}

function NewsCmtDel(NC_CODE, PARAMETER)
{
	var chk = confirm("Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?");

	if (chk)
	{
		location.href = "News_Comment_Delete.asp?NC_CODE=" + NC_CODE + "&PARAMETER=" + PARAMETER;
	}
}