// ½Ç¸íÈ®ÀÎ
function checkDigit_socno(socno)
{
	if(socno == "7002271786193" || socno == "6206012472026") {
		return 'NO';// ¼­ºñ½º¼¾ÅÍ ¿äÃ» by fywowng 04.09.09 Ãß°¡ 
	}
	var socnoStr = socno.toString();
	a = socnoStr.substring(0, 1);
	b = socnoStr.substring(1, 2);
	c = socnoStr.substring(2, 3);
	d = socnoStr.substring(3, 4);
	e = socnoStr.substring(4, 5);
	f = socnoStr.substring(5, 6);
	g = socnoStr.substring(6, 7);
	h = socnoStr.substring(7, 8);
	i = socnoStr.substring(8, 9);
	j = socnoStr.substring(9, 10);
	k = socnoStr.substring(10, 11);
	l = socnoStr.substring(11, 12);
	m = socnoStr.substring(12, 13);
	month = socnoStr.substring(2,4);
	day = socnoStr.substring(4,6);
	socnoStr1 = socnoStr.substring(0, 7);
	socnoStr2 = socnoStr.substring(7, 13);

	/* 2004.03.20 ¿ùÀÏ valid check */
	if(month <= 0 || month > 12) return 'N';
	if(day <= 0 || day > 31) return 'N';

	/* 2004.03.20 ÁÖ¹Îµî·ÏµÞÀÚ¸® Ã¹¹øÂ° ¹øÈ£ À¯È¿¼º Ã¼Å© (1,2,3,4) are only valid -- by muse */
	if(g > 4 || g == 0) return 'N';

	/* 2004.05.07 ÁÖ¹Îµî·Ï¹øÈ£¿¡ °ø¹éÀÌ µé¾î°¡µµ °¡ÀÔÀÌ µÇ´Â °æ¿ì°¡ ¹ß»ýÇÏÁö ¾Êµµ·Ï -- by fywowng*/
	if (isNaN(socnoStr1) || isNaN(socnoStr2))
	{
		return 'N';
	}

	temp=a*2+b*3+c*4+d*5+e*6+f*7+g*8+h*9+i*2+j*3+k*4+l*5;
	temp=temp%11;
	temp=11-temp;
	temp=temp%10;
	
	if(temp == m)
	return 'Y';
	else
	return 'N';
}

function checkFgnNo(socno)
{
	var total =0;
	var parity = 0;

	var fgnNo = new Array(13);

	for(i=0;i < 13;i++) fgnNo[i] = parseInt(socno.charAt(i));

	if(fgnNo[11] < 6) return false;

	if((parity = fgnNo[7]*10 + fgnNo[8])&1) return false;


	var weight = 2;

	for(i=0,total=0;i < 12;i++)
	{
		var sum = fgnNo[i] * weight;
		total += sum;

		if(++weight > 9) weight=2;
	}

	if((total = 11 - (total%11)) >= 10) total -= 10;
	if((total += 2) >= 10) total -= 10;
	if(total != fgnNo[12]) return false;

	return true;
}

function loadRealName( retVal )
{
	if( retVal == 1 ){
		alert( "½Ç¸íÈ®ÀÎÀÌ ½ÇÆÐÇÏ¿´½À´Ï´Ù. ½Ç¸íÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
		document.form.txtName.focus();
	}
	else
		document.form.txtName.focus();
	
	return;
}

function submitRealName(form)
{
	if( form.txtName.value == '' ){
		alert("ÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä.");
		form.txtName.focus();
		form.txtName.select();
		return false;
	}

	if( form.txtJumin01.value.length != 6 ){
		alert("À¯È¿ÇÑ ÁÖ¹Îµî·Ï¹øÈ£°¡ ¾Æ´Õ´Ï´Ù.");
		form.txtJumin01.focus();
		return false;
	}

	if( form.txtJumin02.value == '' ){
		alert("ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸®¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		form.txtJumin02.focus();
		return false;
	}

	if( form.txtJumin02.value.length != 7){
		alert("À¯È¿ÇÑ ÁÖ¹Îµî·Ï¹øÈ£°¡ ¾Æ´Õ´Ï´Ù.");
		form.txtJumin02.focus();
		return false;
	}

	var socno = (form.txtJumin01.value + form.txtJumin02.value);
	var rVal1 = checkDigit_socno(socno);
	if( rVal1 == 'N' ){
	alert("ÁÖ¹Îµî·Ï¹øÈ£°¡ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
	form.txtJumin01.focus();
	return false;
	}else if(rVal1 == 'NO'){
		alert("°¡ÀÔÀÌ ±ÝÁöµÈ »ç¿ëÀÚÀÔ´Ï´Ù.");
	form.txtJumin01.focus();
	return false;
	}

	if( validNAME(form.txtName.value) == 0){
		form.txtName.focus();
		form.txtName.select();
		return false;
	}
	return true;
}

function isNumeric(s)
{
	var isNum = /\d/;
	if( !isNum.test(s) ) return 0;
	return 1;
}

function view_question(id,id2)
{
	if (document.all[id].style.display == "none")
	{
		document.all[id].style.display = "";
	}
	else
	{
		document.all[id].style.display = "none";
	}
}

function WriteFlash(file, w, h) {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="' + w + '" height="' + h + '">');
	document.write('<param name=movie value="' + file + '">');
	document.write('<param name=quality value=high>');
	document.write('<embed src="' + file + '" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="' + w + '" height="' + h + '">');
	document.write('</embed> ');
document.write('</object>');

}

function funcMemberKindView(value)
{
	if (value == "per")
	{
		document.all["divPer"].style.display = "";
		document.all["divCo"].style.display = "none";
	}
	else if (value == "co")
	{
		document.all["divPer"].style.display = "none";
		document.all["divCo"].style.display = "";
	}
}


function funcJumpMenu(obj)
{
	window.open(obj.value);
}