function idCheckClick()
{
	// ¾ÆÀÌµð Áßº¹ °Ë»ç

	var form = document.idCheckForm;
	var id = document.procForm.id.value;

	if(id.length <= 0)
	{
		alert("¾ÆÀÌµð¸¦ ÀÔ·Â ÇÏ¼¼¿ä.");
		return false;
	}

	form.id.value = id;
	form.target = "idCheckFrame";
	form.action = "idcheck.jsp";
	form.submit();
}

function zipcodeClick()
{
	// ÀÚÅÃ ¿ìÆí¹øÈ£ Ã£±â

	var form = document.homeZipcodeForm;

	var width = 418;
	var height = 272;

	var title = "zipcode";

	var leftpos = ( screen.width - width ) / 2;
	var toppos = ( screen.height - height ) / 2;
	var option = "width=" + width + ", height=" + height + ", left=" + leftpos + ", top=" + toppos + ", scrollbars=yes, resizable=no";

	window.open('', title, option);

	form.target = "zipcode";
	form.action = "/common/zipcode.jsp";
	form.submit();
}

function homeZipcodeClick()
{
	// ÀÚÅÃ ¿ìÆí¹øÈ£ Ã£±â

	var form = document.homeZipcodeForm;

	var width = 418;
	var height = 272;

	var title = "zipcode";

	var leftpos = ( screen.width - width ) / 2;
	var toppos = ( screen.height - height ) / 2;
	var option = "width=" + width + ", height=" + height + ", left=" + leftpos + ", top=" + toppos + ", scrollbars=yes, resizable=no";

	window.open('', title, option);

	form.target = "zipcode";
	form.action = "zipcode.jsp";
	form.submit();
}

function corpZipcodeClick()
{
	// È¸»ç ¿ìÆí¹øÈ£ Ã£±â

	var form = document.corpZipcodeForm;

	var width = 418;
	var height = 272;

	var title = "zipcode";

	var leftpos = ( screen.width - width ) / 2;
	var toppos = ( screen.height - height ) / 2;
	var option = "width=" + width + ", height=" + height + ", left=" + leftpos + ", top=" + toppos + ", scrollbars=yes, resizable=no";

	window.open('', title, option);

	form.target = "zipcode";
	form.action = "zipcode.jsp";
	form.submit();
}

function passwdCheck(id, passwd)
{
	// ºñ¹Ð¹øÈ£ À¯È¿¼º °Ë»ç

	var isChar = false;
	var isNum = false;
	
	if (id == passwd)
	{
		alert("ºñ¹Ð¹øÈ£´Â ¾ÆÀÌµð¶û °°À» ¼ö ¾ø½À´Ï´Ù.");
		return false;
	}
	
	if(passwd.length < 6 || passwd.length > 12)
	{
		alert("ºñ¹Ð¹øÈ£´Â 6~12ÀÚ »çÀÌ¸¦ ÀÔ·ÂÇÏ¼¼¿ä...");
		return false;
	}
	
	for (i=0; i<passwd.length; i++)
	{
		char = passwd.charAt(i);
		charState = charCheck( char );
		numState = numCheck( char );
		if (charState) isChar = true;
		if (numState) isNum = true;
		if (charState == false && numState == false)
		{
			alert("ºñ¹Ð¹øÈ£´Â ¿µ¾î ¹× ¼ýÀÚ¸¸ °¡´ÉÇÕ´Ï´Ù...");
			return false;
		}
	}
	
	if (isChar == false || isNum == false)
	{
		alert("ºñ¹Ð¹øÈ£´Â ¿µ¾î ¹× ¼ýÀÚ¸¦ Á¶ÇÕÇÏ¿© ÀÔ·Â ÇÏ¼¼¿ä...");
		return false;
	}
	
	return true;
}

function charCheck( value )
{
	// ÀÔ·Â °ªÀÌ ¹®ÀÚÀÎÁö °Ë»ç

	if (value.search(/[a-zA-Z]/) == -1) return false;
	else return true;
}

function numCheck( value )
{
	// ÀÔ·Â °ªÀÌ ¼ýÀÚÀÎÁö °Ë»ç

	if (value.search(/[0-9]/) == -1) return false;
	else return true;
}

function emailCheck(email)
{
	// ÀÌ¸ÞÀÏ À¯È¿¼º °Ë»ç

	if(email.search(/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/) == -1 )
	{
		alert("ÀüÀÚ¿ìÆíÁÖ¼ÒÀÇ Çü½ÄÀº '°èÁ¤@[È£½ºÆ®|µµ¸ÞÀÎ]'°ú °°ÀÌ ±¸¼ºµÇ¾î¾ß ÇÕ´Ï´Ù.");
		return false;
	}

	return true;
}

function phoneCheck(phone1, phone2, phone3)
{
	// ÀüÈ­¹øÈ£ À¯È¿¼º °Ë»ç

	if(phone1.length <= 0 || phone2.length <= 0 || phone3.length <= 0) return false;

	if(numCheck(phone1) == false) return false;
	if(numCheck(phone2) == false) return false;
	if(numCheck(phone3) == false) return false;

	return true;
	
}

function emailChange()
{
	var form = document.procForm;
	var mail = form.mailTail.value;

	form.email2.value = mail;
}

function jumin_check(strJumin1, strJumin2)
{
	// ÁÖ¹Îµî·Ï¹øÈ£ °Ë»ç

	var chk =0
	var yy = strJumin1.substring(0,2)
	var mm = strJumin1.substring(2,4)
	var dd = strJumin1.substring(4,6)
	var sex = strJumin2.substring(0,1)

	if ((strJumin1.length != 6 )||
			 (yy <20 || mm <1 || mm>12 ||dd<1) ) {
		
	return false;
	}
	if ( !(strJumin2.length == 7 )&& ( ( sex = 1) || (sex =2) ) ) {
		
	return false;
	}

	// ÁÖ¹Îµî·Ï¹øÈ£ validation check
	for (var i = 0; i <=5 ; i++) { 
	chk = chk + ((i%8+2) * parseInt(strJumin1.substring(i,i+1)))
	}
	for (var i = 6; i <=11 ; i++) { 
	chk = chk + ((i%8+2) * parseInt(strJumin2.substring(i-6,i-5)))
	}
	chk = 11 - (chk %11)
	chk = chk % 10

	if (chk != strJumin2.substring(6,7)) {
	
	return false;
	} 

	return true;
}