<!--
var isSubmit = false;

function CheckForm(SrCommentFrom) {

if (!isSubmit) {

	if (isField(SrCommentFrom.comment_view.value) == "") {
		alert("\n²¿¸´¸»ÀÌ ºñ¾î ÀÖ½À´Ï´Ù. ³»¿ëÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		SrCommentFrom.comment_view.focus();
		return false;
	}

	isSubmit = true;
	return true;
	}

else {
	alert("µî·Ï ÁßÀÔ´Ï´Ù. Àá½Ã ±â´Ù¸®¼¼¿ä.");
	return;
	}
}

function CheckRecomForm(SrRecomForm) {

if (!isSubmit) {
	isSubmit = true;
	return true;
	}

else {
	alert("µî·Ï ÁßÀÔ´Ï´Ù. Àá½Ã ±â´Ù¸®¼¼¿ä.");
	return;
	}
}

function GoSrDelete(SrCommentFrom)
{
	yesorder = confirm("ÄÚ¸àÆ®¸¦ »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?")

	if ( yesorder != true )
	{
		isSubmit = false;
		return false;
	}
	else
	{
		isSubmit = true;
		return true;
	}
}

function isField(keyword) {
	var st_num,key_len;
	st_num = keyword.indexOf(" ");
	while (st_num != -1){
		keyword = keyword.replace(" ", "");
		st_num  = keyword.indexOf(" ");
	}
	key_len=keyword.length;
	return key_len;
}

function GrowChar(length_limit, seq)
{
	var comment='';
	comment = eval("document.SrCommentFrom.comment_"+seq);
//	alert(comment);
	var form = document.SrCommentFrom;
//	alert(comment.value);
	var length = calculate_msglen(comment.value);
	textlimit.innerText = length;
	if (length > length_limit) {
		alert("ÃÖ´ë " + length_limit + "byteÀÔ´Ï´Ù.\n\nÃÊ°úµÈ ±ÛÀÚ´Â ÀÚµ¿À¸·Î »èÁ¦µË´Ï´Ù.");
		comment.value = comment.value.replace(/\r\n$/, "");
		comment.value = assert_msglen(comment.value, length_limit);
/*
	} else if (length == length_limit) {
		form.comment.value = form.comment.value.replace(/\r\n$/, "");
*/
	}
}

function calculate_msglen(message)
{
	var nbytes = 0;

	for (i=0; i<message.length; i++) {
		var ch = message.charAt(i);
		if(escape(ch).length > 4) {
			nbytes += 2;
		} else if (ch == '\n') {
			if (message.charAt(i-1) != '\r') {
				nbytes += 1;
			}
		} else if (ch == '<' || ch == '>') {
			nbytes += 4;
		} else {
			nbytes += 1;
		}
	}

	return nbytes;
}

function assert_msglen(message, maximum)
{
	var inc = 0;
	var nbytes = 0;
	var msg = "";
	var msglen = message.length;

	for (i=0; i<msglen; i++) {
		var ch = message.charAt(i);
		if (escape(ch).length > 4) {
			inc = 2;
		} else if (ch == '\n') {
			if (message.charAt(i-1) != '\r') {
				inc = 1;
			}
		} else if (ch == '<' || ch == '>') {
			inc = 4;
		} else {
			inc = 1;
		}
		if ((nbytes + inc) > maximum) {
			break;
		}
		nbytes += inc;
		msg += ch;
	}
	textlimit.innerText = nbytes;
	return msg;
}

function GoSrLogin(returnURL)
{
	yesorder = confirm("ÄÚ¸ÇÆ®¸¦ ³²±â½Ã·Á¸é ·Î±×ÀÎÀÌ ÇÊ¿äÇÕ´Ï´Ù.\n\n·Î±×ÀÎÀ» ÇÏ½Ã°Ú½À´Ï±î?")

	if ( yesorder == true )
		top.location.href = "/member/SR_Login.asp?path="+returnURL;
}

function GoSrMemJoin()
{
	yesorder = confirm("ÄÚ¸ÇÆ®¸¦ ³²±â½Ã·Á¸é ½ÇÅ©·Îµå Ãß°¡Á¤º¸ ÀÔ·ÂÀÌ ÇÊ¿äÇÕ´Ï´Ù.\n\nÃß°¡Á¤º¸ ÀÔ·ÂÀ» ÇÏ½Ã°Ú½À´Ï±î?")

	if ( yesorder == true )
		top.location.href = "/member/member_point.asp";
}

function GoSrMemCharCng()
{
	yesorder = confirm("ÀÛ¼ºÀÚ¸¦ Ä³¸¯ÅÍ¸íÀ¸·Î º¯°æÇÏ¼Å¾ß ÄÚ¸àÆ®¸¦ ³²±æ ¼ö ÀÖ½À´Ï´Ù.\n\nÄ³¸¯ÅÍ¸íÀ» º¯°æ ÇÏ½Ã°Ú½À´Ï±î?")

	if ( yesorder == true )
		UserCharCng();
}

function StopLimitExcess()
{
	alert("ÀÛ¼º Á¦ÇÑ °³¼ö¸¦ ÃÊ°úÇÏ¿© ´õ ÀÌ»ó ÄÚ¸ÇÆ®¸¦ ÀÛ¼ºÇÒ ¼ö ¾ø½À´Ï´Ù.");
}

/*
function GoSrLogin1(returnURL)
{
	document.SrCommentFrom.action = "/member/SR_Login.asp?path="+returnURL;
	document.SrCommentFrom.submit();
}
*/



function GoRcLogin(returnURL)
{
	yesorder = confirm("ÃßÃµÀ» ÇÏ½Ã·Á¸é ·Î±×ÀÎÀÌ ÇÊ¿äÇÕ´Ï´Ù.\n\n·Î±×ÀÎÀ» ÇÏ½Ã°Ú½À´Ï±î?")

	if ( yesorder == true )
		top.location.href = "/member/SR_Login.asp?path="+returnURL;
}

function GoRcMemJoin()
{
	yesorder = confirm("ÃßÃµÀ» ÇÏ½Ã·Á¸é ½ÇÅ©·Îµå Ãß°¡Á¤º¸ ÀÔ·ÂÀÌ ÇÊ¿äÇÕ´Ï´Ù.\n\nÃß°¡Á¤º¸ ÀÔ·ÂÀ» ÇÏ½Ã°Ú½À´Ï±î?")

	if ( yesorder == true )
		top.location.href = "/member/member_point.asp";
}










function ShowReply(obj,idx) {
	var showobj = obj+idx;
	var ho = eval('document.getElementById(\''+showobj+'\')');
	//var sImg_up = "reply_" + idx + "_imgup";
	//var sImg_down = "reply_" + idx + "_imgdown";

	if (ho.style.display == "none") {
		ho.style.display = "block";
		//eval(sImg_up).style.display = ""
		//eval(sImg_down).style.display = "none";
	}
	else {
		ho.style.display = "none";
		//eval(sImg_up).style.display = "none";
		//eval(sImg_down).style.display = ""
	}
	try {
		window.syncHeight("showBody");
	}
	catch ( err ) {
	// do noting
	}
}


var isSubmit2 = false;

function CheckForm2(flag) {

	var SrCommentFrom = eval("document.SrCommentFrom"+flag);

	var comment_view = eval("SrCommentFrom.comment_view"+flag);

	if (!isSubmit2) {

		if (isField(comment_view.value) == "") {
			alert("\n²¿¸´¸»ÀÌ ºñ¾î ÀÖ½À´Ï´Ù. ³»¿ëÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			comment_view.focus();
			return false;
		}

		isSubmit2 = true;
		return true;
		}

	else {
		alert("µî·Ï ÁßÀÔ´Ï´Ù. Àá½Ã ±â´Ù¸®¼¼¿ä.");
		return;
		}
}

function GrowCharRe(length_limit, seq, flag)
{
	var SrCommentFrom = eval("document.SrCommentFrom"+flag);

	var comment = eval("SrCommentFrom.comment_"+seq+flag);

	var textlimit = eval("textlimit"+flag);

	var length = calculate_msglenRe(comment.value);
	textlimit.innerText = length;

	if (length > length_limit) {
		alert("ÃÖ´ë " + length_limit + "byteÀÔ´Ï´Ù.\n\nÃÊ°úµÈ ±ÛÀÚ´Â ÀÚµ¿À¸·Î »èÁ¦µË´Ï´Ù.");
		comment.value = comment.value.replace(/\r\n$/, "");
		comment.value = assert_msglenRe(comment.value, length_limit, flag);
	}
}

function calculate_msglenRe(message)
{
	var nbytes = 0;

	for (i=0; i<message.length; i++) {
		var ch = message.charAt(i);
		if(escape(ch).length > 4) {
			nbytes += 2;
		} else if (ch == '\n') {
			if (message.charAt(i-1) != '\r') {
				nbytes += 1;
			}
		} else if (ch == '<' || ch == '>') {
			nbytes += 4;
		} else {
			nbytes += 1;
		}
	}

	return nbytes;
}

function assert_msglenRe(message, maximum, flag)
{
	var inc = 0;
	var nbytes = 0;
	var msg = "";
	var msglen = message.length;
	var textlimit = eval("textlimit"+flag);

	for (i=0; i<msglen; i++) {
		var ch = message.charAt(i);
		if (escape(ch).length > 4) {
			inc = 2;
		} else if (ch == '\n') {
			if (message.charAt(i-1) != '\r') {
				inc = 1;
			}
		} else if (ch == '<' || ch == '>') {
			inc = 4;
		} else {
			inc = 1;
		}
		if ((nbytes + inc) > maximum) {
			break;
		}
		nbytes += inc;
		msg += ch;
	}
	textlimit.innerText = nbytes;
	return msg;
}



// ½ÇÅ© ¼±¹° ¸Þ¼¼Áö
function GrowChar_SilkGiftMsg(length_limit)
{
	var comment='';
	comment = eval("document.regform.GiftMsg");

	var form = document.regform;

	var length = calculate_msglen(comment.value);
	textlimit.innerText = length;
	if (length > length_limit) {
		alert("ÃÖ´ë " + length_limit + "byteÀÔ´Ï´Ù.\n\nÃÊ°úµÈ ±ÛÀÚ´Â ÀÚµ¿À¸·Î »èÁ¦µË´Ï´Ù.");
		comment.value = comment.value.replace(/\r\n$/, "");
		comment.value = assert_msglen(comment.value, length_limit);
	}
}
//-->